Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
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:
-
func A pointer to a void function
- Returns:
- The function object created for 'func'
Add a function at the end of the chain
- Parameters:
-
obj pointer to the object to call the member function on method pointer 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:
-
func A pointer to a void function
- Returns:
- The function object created for 'func'
Add a function at the beginning of the chain
- Parameters:
-
obj pointer to the object to call the member function on method pointer 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:
-
i function object index
- Returns:
- The function object at position 'i' in the chain
Look for a function object in the call chain
- Parameters:
-
f the 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.
Generated on Tue Jul 12 2022 13:55:25 by
1.7.2