|
Click
|
A basic activity signal and notification provider that can reschedule any dependent Task objects. More...
Public Member Functions | |
| ActiveNotifier (SearchOp op=SEARCH_STOP) | |
| Construct an ActiveNotifier. | |
| ~ActiveNotifier () | |
| Destroy an ActiveNotifier. | |
| int | add_activate_callback (callback_type f, void *v) |
| Register an activate callback with this Notifier. | |
| void | remove_activate_callback (callback_type f, void *v) |
| Unregister an activate callback with this Notifier. | |
| void | listeners (Vector< Task * > &v) const |
| Return the listener list. | |
| void | set_active (bool active, bool schedule=true) |
| Set the associated signal's activity, possibly scheduling any listener tasks. | |
| void | wake () |
| Set the associated signal to active and schedule any listener tasks. | |
| void | sleep () |
| Set the associated signal to inactive. | |
Public Member Functions inherited from Notifier | |
| Notifier (SearchOp op=SEARCH_STOP) | |
| Constructs a Notifier. | |
| Notifier (const NotifierSignal &signal, SearchOp op=SEARCH_STOP) | |
| Constructs a Notifier associated with a given signal. | |
| virtual | ~Notifier () |
| Destruct a Notifier. | |
| bool | initialized () const |
| Return whether the Notifier is initialized. | |
| int | initialize (const char *name, Router *router) |
| Initialize the associated NotifierSignal, if necessary. | |
| const NotifierSignal & | signal () const |
| Return this Notifier's associated NotifierSignal. | |
| SearchOp | search_op () const |
| Return this Notifier's search operation. | |
| bool | active () const |
| Returns whether the associated signal is active. | |
| bool | safe_active () const |
| Returns whether the associated signal is active. | |
| bool | set_active (bool active) |
| Set the associated signal's activity. | |
| void | wake () |
| Set the associated signal to active. | |
| void | sleep () |
| Set the associated signal to inactive. | |
| int | add_listener (Task *task) |
| Register a listener with this Notifier. | |
| void | remove_listener (Task *task) |
| Unregister a listener with this Notifier. | |
| int | add_dependent_signal (NotifierSignal *signal) |
| Register a dependent signal with this Notifier. | |
| void | remove_dependent_signal (NotifierSignal *signal) |
| Unregister a dependent signal with this Notifier. | |
Additional Inherited Members | |
Public Types inherited from Notifier | |
| enum | SearchOp { SEARCH_STOP = 0 , SEARCH_CONTINUE , SEARCH_CONTINUE_WAKE } |
| typedef void(* | callback_type) (void *, Notifier *) |
Static Public Member Functions inherited from Notifier | |
| static NotifierSignal | upstream_empty_signal (Element *e, int port) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | upstream_empty_signal (Element *e, int port, Task *task) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | upstream_empty_signal (Element *e, int port, Notifier *dependent_notifier) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | upstream_signal (Element *e, int port, Task *task, const char *signal) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | upstream_empty_signal (Element *e, int port, callback_type f, void *user_data) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | upstream_signal (Element *e, int port, callback_type f, void *user_data, const char *signal) |
| Calculate and return the NotifierSignal derived from all empty notifiers upstream of element e's input port. | |
| static NotifierSignal | downstream_full_signal (Element *e, int port) |
| Calculate and return the NotifierSignal derived from all full notifiers downstream of element e's output port. | |
| static NotifierSignal | downstream_full_signal (Element *e, int port, Task *task) |
| Calculate and return the NotifierSignal derived from all full notifiers downstream of element e's output port. | |
| static NotifierSignal | downstream_full_signal (Element *e, int port, Notifier *dependent_notifier) |
| Calculate and return the NotifierSignal derived from all full notifiers downstream of element e's output port. | |
| static NotifierSignal | downstream_full_signal (Element *e, int port, callback_type f, void *user_data) |
| Calculate and return the NotifierSignal derived from all full notifiers downstream of element e's output port. | |
| static NotifierSignal | upstream_empty_signal (Element *e, int port, int) |
| static NotifierSignal | upstream_empty_signal (Element *e, int port, int, Notifier *) |
| static NotifierSignal | downstream_full_signal (Element *e, int port, int) |
| static NotifierSignal | downstream_full_signal (Element *e, int port, int, Notifier *) |
Static Public Attributes inherited from Notifier | |
| static const char | EMPTY_NOTIFIER [] = "empty" |
| static const char | FULL_NOTIFIER [] = "full" |
A basic activity signal and notification provider that can reschedule any dependent Task objects.
ActiveNotifier, whose base class is Notifier, combines a basic activity signal with the ability to wake up any dependent Task objects when that signal becomes active. Notifier clients are called listeners. Each listener corresponds to a Task object. The listener generally goes to sleep – i.e., becomes unscheduled – when it runs out of work and the corresponding activity signal is inactive. The ActiveNotifier class will wake up the listener when it becomes active by rescheduling the relevant Task.
Elements that contain ActiveNotifier objects will generally override Element::cast() or Element::port_cast(), allowing other parts of the configuration to find the Notifiers.
| ActiveNotifier::ActiveNotifier | ( | SearchOp | op = SEARCH_STOP | ) |
Construct an ActiveNotifier.
| op | controls notifier path search |
Constructs an ActiveNotifier object, analogous to the Notifier::Notifier(SearchOp) constructor. (See that constructor for more information on op.)
| ActiveNotifier::~ActiveNotifier | ( | ) |
Destroy an ActiveNotifier.
|
virtual |
Register an activate callback with this Notifier.
| f | callback function |
| user_data | callback data for f |
When this Notifier's associated signal is activated, this Notifier should call f(user_data, this). Not all types of Notifier provide this functionality. The default implementation does nothing.
If f is null, then user_data is a Task pointer passed to add_listener.
Reimplemented from Notifier.
|
virtual |
Unregister an activate callback with this Notifier.
| f | callback function |
| user_data | callback data for f |
Undoes the effect of all prior add_activate_callback(f, user_data) calls. Does nothing if (f,user_data) was never added. The default implementation does nothing.
If f is null, then user_data is a Task pointer passed to remove_listener.
Reimplemented from Notifier.
Return the listener list.
| [out] | v | collects listener tasks |
Pushes all listener Task objects onto the end of v.
|
inline |
Set the associated signal's activity, possibly scheduling any listener tasks.
never
| active | true iff the signal should be active |
| schedule | if true, wake up listener tasks |
If active and schedule are both true, and the signal was previously inactive, then any listener Tasks are scheduled with Task::reschedule().
|
inline |
Set the associated signal to active and schedule any listener tasks.
If the signal was previously inactive, then any listener Tasks are scheduled with Task::reschedule().
|
inline |
Set the associated signal to inactive.