Jerryscript::ContextList< ClassType > Class Template Reference
Manages a list of contexts. More...
#include <Context.h>
Inheritance diagram for Jerryscript::ContextList< ClassType >:
Collaboration diagram for Jerryscript::ContextList< ClassType >:
Public Types | |
| using | Callback = Delegate< void(ClassType &ctx)> |
Public Types inherited from LinkedObjectListTemplate< ClassType > | |
| using | Iterator = typename LinkedObjectTemplate< ClassType >::template IteratorTemplate< ClassType, ClassType *, ClassType & > |
| using | ConstIterator = typename LinkedObjectTemplate< ClassType >::template IteratorTemplate< const ClassType, const ClassType *, const ClassType & > |
Public Member Functions | |
| void | foreach (Callback callback) |
| Invoke callback once for each context via task queue. More... | |
Public Member Functions inherited from OwnedLinkedObjectListTemplate< ClassType > | |
| OwnedLinkedObjectListTemplate ()=default | |
| OwnedLinkedObjectListTemplate (const OwnedLinkedObjectListTemplate &other)=delete | |
| OwnedLinkedObjectListTemplate & | operator= (const OwnedLinkedObjectListTemplate &other)=delete |
| ~OwnedLinkedObjectListTemplate () | |
| bool | remove (ClassType *object) |
| void | clear () |
Public Member Functions inherited from LinkedObjectListTemplate< ClassType > | |
| LinkedObjectListTemplate ()=default | |
| LinkedObjectListTemplate (ClassType *object) | |
| ClassType * | head () |
| const ClassType * | head () const |
| Iterator | begin () |
| ConstIterator | begin () const |
| Iterator | end () |
| ConstIterator | end () const |
| bool | add (ClassType *object) |
| bool | add (const ClassType *object) |
| bool | insert (ClassType *object) |
| bool | insert (const ClassType *object) |
| ClassType * | pop () |
| size_t | count () const |
| bool | contains (const ClassType &object) const |
Public Member Functions inherited from LinkedObjectList | |
| LinkedObjectList () | |
| LinkedObjectList (LinkedObject *object) | |
| bool | add (LinkedObject *object) |
| bool | add (const LinkedObject *object) |
| bool | insert (LinkedObject *object) |
| bool | insert (const LinkedObject *object) |
| bool | remove (LinkedObject *object) |
| LinkedObject * | pop () |
| void | clear () |
| LinkedObject * | head () |
| const LinkedObject * | head () const |
| bool | isEmpty () const |
Additional Inherited Members | |
Protected Attributes inherited from LinkedObjectList | |
| LinkedObject * | mHead {nullptr} |
Detailed Description
template<class ClassType>
class Jerryscript::ContextList< ClassType >
Manages a list of contexts.
Member Typedef Documentation
◆ Callback
template<class ClassType >
| using Jerryscript::ContextList< ClassType >::Callback = Delegate<void(ClassType& ctx)> |
Member Function Documentation
◆ foreach()
template<class ClassType >
|
inline |
Invoke callback once for each context via task queue.
When calling into contexts we can do this:
JS::ContextList<MyContext> contexts;
...
int value = 12;
for(auto& ctx: contexts) {
ctx.customNotify(str, value);
}
However, with many containers system responsiveness may be adversely affected. Instead, separate the calls out like this:
Note that all parameters are captured by copy (using [=]) as, for example, str will be destroyed when it goes out of scope.
The documentation for this class was generated from the following file:
#define F(string_literal)
Wrap a string literal stored in flash and access it using a String object.
Definition: WString.h:113
Manages a list of contexts.
Definition: Libraries/jerryscript/src/include/Jerryscript/Context.h:204
Public Types inherited from
1.8.17