Marsyas  0.5.0-beta1
Public Member Functions | Friends
EvEvent Class Reference

EvEvent. More...

#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 EvEventclone ()=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 &)

Detailed Description

EvEvent.

Author:
Neil Burroughs inb@cs.uvic.ca

Definition at line 38 of file EvEvent.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
c1a path name to compare against c2
c2a path name to compare against c1
va control value to check
ta type enumeration from the TmControlValue class representing the expected type
Returns:
true if both checks succeed

Definition at line 145 of file EvEvent.cpp.

virtual EvEvent* clone ( ) [pure virtual]

clone this event and all its parameters. This method must be implemented so that scheduled events may be copied.

Returns:
a pointer to a copy of this event

Implemented in EvGetUpd, EvValUpd, and EvExpr.

virtual void dispatch ( ) [pure virtual]

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.

Implemented in EvGetUpd, EvValUpd, and EvExpr.

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

Returns:
the event 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"

Returns:
string representation of the prefix

Definition at line 49 of file EvEvent.cpp.

Repeat getRepeat ( )

get the repetition information for this event

Returns:
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

Returns:
a pointer to the event object

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.

Returns:
string representation of the time interval

Definition at line 79 of file EvEvent.cpp.

mrs_natural getTime ( ) const

get the time that this event is to be dispatched

Returns:
the dispatch time count for this event

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

Returns:
the type name

Definition at line 37 of file EvEvent.cpp.

bool repeat ( ) [virtual]

report if the event is to be repeated

Returns:
true if event should repeat

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.

Parameters:
intervalan interval of time
Returns:
the same as what was supplied

Definition at line 103 of file EvEvent.cpp.

void setName ( std::string  n)

set the name of the event, should be a unique identifier

Parameters:
na unique identifier

Definition at line 55 of file EvEvent.cpp.

void setRepeat ( Repeat  r) [virtual]

set the repeat state of this event

Parameters:
rnew 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

Parameters:
tthe dispatch time for this event

Definition at line 67 of file EvEvent.cpp.

void setTimer ( TmTimer t) [virtual]

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.

Parameters:
tthe 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.

Parameters:
cnamethe path name of the parameter to be modified.
valuethe value to be assigned

Reimplemented in EvValUpd, and EvExpr.

Definition at line 138 of file EvEvent.cpp.


Friends And Related Function Documentation

friend class EvEventDispatchComparator [friend]

Definition at line 176 of file EvEvent.h.

std::ostream& operator<< ( std::ostream &  ,
EvEvent  
) [friend]

Reimplemented in EvGetUpd, EvValUpd, and EvExpr.

std::istream& operator>> ( std::istream &  ,
EvEvent  
) [friend]

Reimplemented in EvGetUpd, EvValUpd, and EvExpr.


The documentation for this class was generated from the following files: