Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

CallChain class

CallChain class
[Platform]

Functions

class MBED_DEPRECATED ("CallChain has been deprecated and will be removed.") CallChain
 Group one or more functions in an instance of a CallChain, then call them in sequence using CallChain::call().

Function Documentation

class mbed::MBED_DEPRECATED ( "CallChain has been deprecated and will be removed."   )

Group one or more functions in an instance of a CallChain, then call them in sequence using CallChain::call().

Used mostly by the interrupt chaining code, but can be used for other purposes.

Note:
Synchronization level: Not protected

Example:

 #include "mbed.h"

 CallChain chain;

 void first(void) {
     printf("'first' function.\n");
 }

 void second(void) {
     printf("'second' function.\n");
 }

 class Test {
 public:
     void f(void) {
         printf("A::f (class member).\n");
     }
 };

 int main() {
     Test test;

     chain.add(second);
     chain.add_front(first);
     chain.add(&test, &Test::f);
     chain.call();
 }

Create an empty chain

Parameters:
size(optional) Initial size of the chain

Create an empty chain

Add a function at the end of the chain

Parameters:
funcA pointer to a void function
Returns:
The function object created for 'func'

Add a function at the end of the chain

Parameters:
objpointer to the object to call the member function on
methodpointer to the member function to be called
Returns:
The function object created for 'obj' and 'method'

Add a function at the beginning of the chain

Parameters:
funcA pointer to a void function
Returns:
The function object created for 'func'

Add a function at the beginning of the chain

Parameters:
objpointer to the object to call the member function on
methodpointer to the member function to be called
Returns:
The function object created for the object and method pointers

Get the number of functions in the chain

Get a function object from the chain

Parameters:
ifunction object index
Returns:
The function object at position 'i' in the chain

Look for a function object in the call chain

Parameters:
fthe function object to search
Returns:
The index of the function object if found, -1 otherwise.

Clear the call chain (remove all functions in the chain).

Remove a function object from the chain

  • f the function object to remove
Returns:
true if the function object was found and removed, false otherwise.

Call all the functions in the chain in sequence

Definition at line 76 of file CallChain.h.