Marsyas
0.6.0-alpha
|
#include <EvEvent.h>
Inherited by EvExpr, EvGetUpd, and EvValUpd.
Public Member Functions | |
bool | checkupd (std::string c1, std::string c2, TmControlValue v, mrs_natural t) |
convenience method for concrete events to use when checking types of values against path names during updctrl. This method constitutes two checks (c1=c2 and v=t) that must be true to return true. | |
virtual EvEvent * | clone ()=0 |
clone this event and all its parameters. This method must be implemented so that scheduled events may be copied. | |
virtual void | dispatch ()=0 |
the action to be performed by the event. This method is called when the event is due. Since Marsyas is not threaded, this method will block so be careful not to do too much. | |
void | doRepeat () |
force the event to update its dispatch time and decrement its repeat count based on the repetition information. If the event does not repeat then this method is meaningless and doesn't do anything. This method is used by the dispatch() method of the timer. | |
EvEvent () | |
EvEvent (std::string t, std::string n) | |
std::string | getName () const |
get the name of the event, hopefully a unique identifier | |
std::string | getPrefix () const |
the prefix is a concatenation of type and name as "type/name" | |
Repeat | getRepeat () |
get the repetition information for this event | |
virtual mrs_natural | getRepeatCount () |
get the repetition count for this event | |
virtual std::string | getRepeatInterval () |
get the repetition time interval for this event. | |
mrs_natural | getTime () const |
get the time that this event is to be dispatched | |
std::string | getType () const |
get the type of the event which is usually the class name | |
virtual bool | repeat () |
report if the event is to be repeated | |
virtual std::string | repeat_interval (std::string interval) |
the reason for this method escapes me. It simply returns parameter supplied but obviously could be overridden for whatever reason. Although this method is never actually called by anyone right now. | |
void | setName (std::string n) |
set the name of the event, should be a unique identifier | |
virtual void | setRepeat (Repeat r) |
set the repeat state of this event | |
void | setTime (mrs_natural t) |
set the time at which this event is to be dispatched | |
virtual void | setTimer (TmTimer *t) |
set the timer on which this event is scheduled. This method is called by the timer's post method when the scheduled event is posted on the timer. | |
virtual void | updctrl (std::string cname, TmControlValue value) |
update event parameters dynamically. Parameters of the event may be updated while the event is on the heap. The support for modifiable parameters is dependent on the implementation of concrete events. Unsupported parameter updates should generate warnings. | |
virtual | ~EvEvent () |
Friends | |
class | EvEventDispatchComparator |
std::ostream & | operator<< (std::ostream &, EvEvent &) |
std::istream & | operator>> (std::istream &, EvEvent &) |
EvEvent | ( | ) |
Definition at line 26 of file EvEvent.cpp.
EvEvent | ( | std::string | t, |
std::string | n | ||
) |
Definition at line 28 of file EvEvent.cpp.
~EvEvent | ( | ) | [virtual] |
Definition at line 34 of file EvEvent.cpp.
bool checkupd | ( | std::string | c1, |
std::string | c2, | ||
TmControlValue | v, | ||
mrs_natural | t | ||
) |
convenience method for concrete events to use when checking types of values against path names during updctrl. This method constitutes two checks (c1=c2 and v=t) that must be true to return true.
As an example, the call: checkupd(cname,"mrs_string/control",value,tmcv_string) might appear in updctrl(...) and checks the path name against the specific parameter "mrs_string/control" for an exact match. Next, the type of the value supplied will be checked against the type enumeration tmcv_string. The type enumerations can be found in the TmControlValue class.
c1 | a path name to compare against c2 |
c2 | a path name to compare against c1 |
v | a control value to check |
t | a type enumeration from the TmControlValue class representing the expected type |
Definition at line 145 of file EvEvent.cpp.
virtual void dispatch | ( | ) | [pure virtual] |
void doRepeat | ( | ) |
force the event to update its dispatch time and decrement its repeat count based on the repetition information. If the event does not repeat then this method is meaningless and doesn't do anything. This method is used by the dispatch() method of the timer.
Definition at line 113 of file EvEvent.cpp.
std::string getName | ( | ) | const |
get the name of the event, hopefully a unique identifier
Definition at line 43 of file EvEvent.cpp.
std::string getPrefix | ( | ) | const |
the prefix is a concatenation of type and name as "type/name"
Definition at line 49 of file EvEvent.cpp.
get the repetition information for this event
Definition at line 85 of file EvEvent.cpp.
mrs_natural getRepeatCount | ( | ) | [virtual] |
get the repetition count for this event
Definition at line 73 of file EvEvent.cpp.
std::string getRepeatInterval | ( | ) | [virtual] |
get the repetition time interval for this event.
If this event does not repeat then the returned time interval is undefined (may be an empty string). It is best to check to see if there is repeat information prior to reading the interval.
Definition at line 79 of file EvEvent.cpp.
mrs_natural getTime | ( | ) | const |
get the time that this event is to be dispatched
Definition at line 61 of file EvEvent.cpp.
std::string getType | ( | void | ) | const |
get the type of the event which is usually the class name
Definition at line 37 of file EvEvent.cpp.
bool repeat | ( | ) | [virtual] |
report if the event is to be repeated
Reimplemented in EvExpr.
Definition at line 97 of file EvEvent.cpp.
std::string repeat_interval | ( | std::string | interval | ) | [virtual] |
the reason for this method escapes me. It simply returns parameter supplied but obviously could be overridden for whatever reason. Although this method is never actually called by anyone right now.
interval | an interval of time |
Definition at line 103 of file EvEvent.cpp.
void setName | ( | std::string | n | ) |
set the name of the event, should be a unique identifier
n | a unique identifier |
Definition at line 55 of file EvEvent.cpp.
set the repeat state of this event
r | new repetition information for this event |
Definition at line 91 of file EvEvent.cpp.
void setTime | ( | mrs_natural | t | ) |
set the time at which this event is to be dispatched
t | the dispatch time for this event |
Definition at line 67 of file EvEvent.cpp.
set the timer on which this event is scheduled. This method is called by the timer's post method when the scheduled event is posted on the timer.
t | the timer on which this event is posted. |
Reimplemented in EvExpr.
Definition at line 132 of file EvEvent.cpp.
void updctrl | ( | std::string | cname, |
TmControlValue | value | ||
) | [virtual] |
update event parameters dynamically. Parameters of the event may be updated while the event is on the heap. The support for modifiable parameters is dependent on the implementation of concrete events. Unsupported parameter updates should generate warnings.
cname | the path name of the parameter to be modified. |
value | the value to be assigned |
Reimplemented in EvValUpd, and EvExpr.
Definition at line 138 of file EvEvent.cpp.
friend class EvEventDispatchComparator [friend] |
std::ostream& operator<< | ( | std::ostream & | , |
EvEvent & | |||
) | [friend] |
std::istream& operator>> | ( | std::istream & | , |
EvEvent & | |||
) | [friend] |