Mistake on this page?
Report an issue in GitHub or email us
OperationListBase.h
1 /*
2  * Copyright (c) 2018-2019, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef MBED_OPERATION_LIST_BASE_H
19 #define MBED_OPERATION_LIST_BASE_H
20 
21 #include "LinkedListBase.h"
22 #include "Mutex.h"
23 
24 class AsyncOp;
25 
27 public:
28 
29  /**
30  * Create a new empty operation list
31  */
33 
34  /**
35  * Destroy this object and abort all operations
36  */
38 
39  /**
40  * Check if the list is empty
41  *
42  * @return true if the list is empty false otherwise
43  */
44  bool empty();
45 
46  /**
47  * Add an operation to the list
48  *
49  * If the list was empty then call process on this
50  * operation
51  *
52  * @param op Operation to add
53  */
54  void add(AsyncOp *op);
55 
56  /**
57  * Remove an operation from the list
58  *
59  * If this was the head of the list then process the
60  * next element in the list.
61  *
62  * @param op Operation to remove
63  */
64  void remove(AsyncOp *op);
65 
66  /**
67  * Dequeue the head of the list
68  *
69  * Remove the head of the operation list without completing it
70  * or processing the next element. The caller must call the
71  * AsnycOp::complete() function of the returned object.
72  * Additionally process() must be called on this object
73  * if there are still elements in the list.
74  *
75  * @return The async op at the head of the list
76  */
78 
79  /**
80  * Abort all operations
81  */
82  void remove_all();
83 
84  /**
85  * Process the operation list
86  *
87  * This allow the operation at the head of the list to perform processing
88  */
89  void process();
90 
91 private:
92  friend class AsyncOp;
93 
94  LinkedListBase _list;
95 };
96 
97 #endif
~OperationListBase()
Destroy this object and abort all operations.
void process()
Process the operation list.
void remove_all()
Abort all operations.
bool empty()
Check if the list is empty.
void add(AsyncOp *op)
Add an operation to the list.
AsyncOp * dequeue_raw()
Dequeue the head of the list.
OperationListBase()
Create a new empty operation list.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.