TmControlValue Class Reference
[Scheduler]

TmControlValue is a simple parameter passing mechanism for updtimer. More...

#include <TmControlValue.h>


Public Member Functions

std::string getSType ()
 get the name of this value type.
int getType ()
 get the type enumeration for this value type. The value is one of the tmcv values defined in TmControlValue.h
 TmControlValue (MarSystem *m)
 MarSystem value type (tmcv_marsystem).
 TmControlValue (bool be)
 bool value type (tmcv_bool)
 TmControlValue (const char *cc)
 string value type (tmcv_string)
 TmControlValue (std::string st)
 string value type (tmcv_string)
 TmControlValue (long int ne)
 natural value type (tmcv_natural)
 TmControlValue (int ne)
 natural value type (tmcv_natural)
 TmControlValue (double re)
 real value type (tmcv_real)
 TmControlValue (float re)
 real value type (tmcv_real)
 TmControlValue (const TmControlValue &v)
 copy constructor
 TmControlValue ()
 null value type (tmcv_null)
bool toBool ()
 get value as bool. If not a bool value then a warning is reported and false returned.
MarSystemtoMarSystem ()
 get value as MarSystem. If not a MarSystem value then a warning is reported and NULL returned.
mrs_natural toNatural ()
 get value as natural. If not a natural value then a warning is reported and 0 returned.
mrs_real toReal ()
 get value as real. If not a real value then a warning is reported and 0.0 returned.
std::string toString ()
 get value as string. If not a string value then a warning is reported and "" returned.

Protected Attributes

mrs_real r_
 supported value type
int type_
 value type identifier

Friends

std::ostream & operator<< (std::ostream &, const TmControlValue &)
 send this object out the outstream.


Detailed Description

TmControlValue is a simple parameter passing mechanism for updtimer.

Author:
Neil Burroughs inb@cs.uvic.ca

Definition at line 55 of file TmControlValue.h.


Constructor & Destructor Documentation

TmControlValue ( const TmControlValue v  ) 

copy constructor

Parameters:
v TmControlValue to copy

Definition at line 30 of file TmControlValue.cpp.

References TmControlValue::b_, TmControlValue::ms_, TmControlValue::n_, TmControlValue::r_, TmControlValue::s_, and TmControlValue::type_.

TmControlValue ( float  re  ) 

real value type (tmcv_real)

Parameters:
re float value to assign as real

Definition at line 46 of file TmControlValue.cpp.

References TmControlValue::r_, Marsyas::tmcv_real, and TmControlValue::type_.

TmControlValue ( double  re  ) 

real value type (tmcv_real)

Parameters:
re double value to assign as real

Definition at line 40 of file TmControlValue.cpp.

References TmControlValue::r_, Marsyas::tmcv_real, and TmControlValue::type_.

TmControlValue ( int  ne  ) 

natural value type (tmcv_natural)

Parameters:
ne int value to assign as natural

Definition at line 52 of file TmControlValue.cpp.

References Marsyas::tmcv_natural, and TmControlValue::type_.

TmControlValue ( long int  ne  ) 

natural value type (tmcv_natural)

Parameters:
ne long int value to assign as natural

Definition at line 58 of file TmControlValue.cpp.

References Marsyas::tmcv_natural, and TmControlValue::type_.

TmControlValue ( std::string  st  ) 

string value type (tmcv_string)

Parameters:
st string value to assign

Definition at line 64 of file TmControlValue.cpp.

References Marsyas::tmcv_string, and TmControlValue::type_.

TmControlValue ( const char *  cc  ) 

string value type (tmcv_string)

Parameters:
cc const char* value to assign as string

Definition at line 70 of file TmControlValue.cpp.

References Marsyas::tmcv_string, and TmControlValue::type_.

TmControlValue ( bool  be  ) 

bool value type (tmcv_bool)

Parameters:
be bool value to assign

Definition at line 76 of file TmControlValue.cpp.

References Marsyas::tmcv_bool, and TmControlValue::type_.

TmControlValue ( MarSystem m  ) 

MarSystem value type (tmcv_marsystem).

Parameters:
m MarSystem pointer value to assign

Definition at line 82 of file TmControlValue.cpp.

References Marsyas::tmcv_marsystem, and TmControlValue::type_.


Member Function Documentation

mrs_string getSType (  ) 

get the name of this value type.

Returns:
the name of the type

Definition at line 150 of file TmControlValue.cpp.

References TmControlValue::getType(), Marsyas::tmcv_bool, Marsyas::tmcv_marsystem, Marsyas::tmcv_natural, Marsyas::tmcv_real, Marsyas::tmcv_string, and Marsyas::tmcv_vec.

Referenced by TmTimer::updtimer().

int getType ( void   ) 

get the type enumeration for this value type. The value is one of the tmcv values defined in TmControlValue.h

Returns:
the timer control value type enumeration.

Definition at line 144 of file TmControlValue.cpp.

References TmControlValue::type_.

Referenced by EvEvent::checkupd(), TmControlValue::getSType(), TmVirtualTime::updtimer(), and TmSampleCount::updtimer().

bool toBool (  ) 

get value as bool. If not a bool value then a warning is reported and false returned.

Returns:
the bool value or false if this is not a bool.

Definition at line 100 of file TmControlValue.cpp.

References Marsyas::tmcv_bool, and TmControlValue::type_.

MarSystem * toMarSystem (  ) 

get value as MarSystem. If not a MarSystem value then a warning is reported and NULL returned.

Returns:
the MarSystem value or NULL if this is not a MarSystem.

Definition at line 133 of file TmControlValue.cpp.

References Marsyas::tmcv_marsystem, and TmControlValue::type_.

Referenced by EvValUpd::updctrl(), TmVirtualTime::updtimer(), and TmSampleCount::updtimer().

mrs_natural toNatural (  ) 

get value as natural. If not a natural value then a warning is reported and 0 returned.

Returns:
the natural value or 0 if this is not a natural.

Definition at line 111 of file TmControlValue.cpp.

References Marsyas::tmcv_natural, and TmControlValue::type_.

mrs_real toReal (  ) 

get value as real. If not a real value then a warning is reported and 0.0 returned.

Returns:
the real value or 0.0 if this is not a real.

Definition at line 89 of file TmControlValue.cpp.

References TmControlValue::r_, Marsyas::tmcv_real, and TmControlValue::type_.

std::string toString (  ) 

get value as string. If not a string value then a warning is reported and "" returned.

Returns:
the string value or "" if this is not a string.

Definition at line 122 of file TmControlValue.cpp.

References Marsyas::tmcv_string, and TmControlValue::type_.

Referenced by EvValUpd::updctrl(), and TmSampleCount::updtimer().


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

Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6