Mbed OS Reference
Loading...
Searching...
No Matches
OperationList< T > Class Template Reference
Inheritance diagram for OperationList< T >:
OperationListBase

Public Member Functions

 OperationList ()
 Create a new empty operation list. More...
 
 ~OperationList ()
 Destroy this object and abort all operations. More...
 
void add (T *op)
 Add an operation to the list. More...
 
void remove (T *op)
 Remove an operation from the list. More...
 
T * dequeue_raw ()
 Dequeue the head of the list. More...
 
bool empty ()
 Check if the list is empty. More...
 
void add (AsyncOp *op)
 Add an operation to the list. More...
 
void remove (AsyncOp *op)
 Remove an operation from the list. More...
 
void remove_all ()
 Abort all operations. More...
 
void process ()
 Process the operation list. More...
 

Detailed Description

template<class T>
class OperationList< T >

Definition at line 30 of file OperationList.h.

Constructor & Destructor Documentation

◆ OperationList()

Create a new empty operation list.

Definition at line 36 of file OperationList.h.

◆ ~OperationList()

Destroy this object and abort all operations.

Definition at line 44 of file OperationList.h.

Member Function Documentation

◆ add() [1/2]

void add ( T *  op)

Add an operation to the list.

If the list was empty then call process on this operation

Parameters
opOperation to add

Definition at line 56 of file OperationList.h.

◆ remove() [1/2]

void remove ( T *  op)

Remove an operation from the list.

If this was the head of the list then process the next element in the list.

Parameters
opOperation to remove

Definition at line 69 of file OperationList.h.

◆ dequeue_raw()

T * dequeue_raw ( )

Dequeue the head of the list.

Remove the head of the operation list without completing it or processing the next element. The caller must call the AsnycOp::complete() function of the returned object. Additionally process() must be called on this object if there are still elements in the list.

Returns
The asynchronous op at the head of the list

Definition at line 85 of file OperationList.h.

◆ empty()

bool empty ( )
inherited

Check if the list is empty.

Returns
true if the list is empty false otherwise

◆ add() [2/2]

void add ( AsyncOp op)
inherited

Add an operation to the list.

If the list was empty then call process on this operation

Parameters
opOperation to add

◆ remove() [2/2]

void remove ( AsyncOp op)
inherited

Remove an operation from the list.

If this was the head of the list then process the next element in the list.

Parameters
opOperation to remove

◆ remove_all()

void remove_all ( )
inherited

Abort all operations.

◆ process()

void process ( )
inherited

Process the operation list.

This allow the operation at the head of the list to perform processing