libFAUDES

Sections

Index

faudes::AttributeDeviceEvent Class Reference

#include <iop_vdevice.h>

Inherits faudes::AttributeVoid.

Inherited by faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

List of all members.


Detailed Description

Attribute for the configuration of a sensor or actuator mapping.

The base class for all device event attributes only distinguishes between actuator and sensor events. The actual attribute is of type AttributeVoid. Derived classes are meant to override this type in order to provide the defining data for the actual mapping of physical and logical events.

Definition at line 62 of file iop_vdevice.h.


Public Member Functions

virtual AttributeDeviceEventNew (void) const
 Construct on heap.
virtual AttributeDeviceEventCopy (void) const
 Construct on heap.
virtual const
AttributeDeviceEvent
Cast (const Type *pOther) const
 Cast other object to this type.
virtual AttributeDeviceEventAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data.
virtual AttributeDeviceEventoperator= (const AttributeDeviceEvent &rSrc)
virtual bool operator== (const AttributeDeviceEvent &rOther) const
virtual bool operator!= (const AttributeDeviceEvent &rOther) const
 AttributeDeviceEvent (void)
 Default constructor (no attributes, aka undefined).
 AttributeDeviceEvent (const AttributeDeviceEvent &rOtherAttr)
 Copy constructor.
virtual ~AttributeDeviceEvent (void)
 Destructor.
virtual void Clear (void)
 Clear.
virtual bool IsDefault (void) const
 Test for default value (undefined).
bool IsActuator (void) const
 Does this attribute define an actuator mapping?
bool IsSensor (void) const
 Does this attribute define a sensor mapping?
void DefaultActuator (void)
 Set to default actuator attribute.
void DefaultSensor (void)
 Set to default sensor attribute.
virtual void Actuator (const AttributeVoid &rActuatorAttribute)
 Set actuator attribute.
virtual void Sensor (const AttributeVoid &rSensorAttribute)
 Set sensor attribute.
const AttributeVoidActuatorp (void) const
 Get actuator mapping (return 0 if its not an actuator).
const AttributeVoidSensorp (void) const
 Get sensor mapping (return 0 if its not a sensor).

Protected Member Functions

virtual AttributeDeviceEventDoAssign (const AttributeDeviceEvent &rSrcAttr)
 Copy method.
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Reads the attribute from TokenReader, see AttributeVoid for public wrappers.
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.

Protected Attributes

AttributeVoidmpActuatorAttribute
 Actuator Attribute (use cast in derived classes).
AttributeVoidmpSensorAttribute
 Sensor Attribute (use cast in derived classes).
AttributeVoidpActuatorPrototype
 Actuator Prototype (set to nontrivial attribute in derived classes).
AttributeVoidpSensorPrototype
 Sensor Prototype (set to nontrivial attribute in derived classes).

Static Protected Attributes

static AttributeVoid sFallbackAttribute = AttributeVoid()
 Fallback attribute type.

Constructor & Destructor Documentation

faudes::AttributeDeviceEvent::AttributeDeviceEvent ( void   ) 

Default constructor (no attributes, aka undefined).

Definition at line 50 of file iop_vdevice.cpp.

faudes::AttributeDeviceEvent::AttributeDeviceEvent ( const AttributeDeviceEvent rOtherAttr  ) 

Copy constructor.

Definition at line 61 of file iop_vdevice.cpp.

faudes::AttributeDeviceEvent::~AttributeDeviceEvent ( void   )  [virtual]

Destructor.

Definition at line 73 of file iop_vdevice.cpp.


Member Function Documentation

AttributeDeviceEvent * faudes::AttributeDeviceEvent::New ( void   )  const [virtual]

Construct on heap.

Technically not a constructor, this function creates an object with the same type Type. New() is defined as a virtual function and derived classes are meant to re-implement with the appropiate constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.

Returns:
Pointer to new Type object

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 47 of file iop_vdevice.cpp.

AttributeDeviceEvent * faudes::AttributeDeviceEvent::Copy ( void   )  const [virtual]

Construct on heap.

Technically not a constructor, this function creates an object with the same type Type and the same configuration. Copy() is defined as a virtual function and derived classes are meant to re-implement with the appropiate copy constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.

Returns:
Pointer to new Type object

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 47 of file iop_vdevice.cpp.

const AttributeDeviceEvent * faudes::AttributeDeviceEvent::Cast ( const Type pOther  )  const [virtual]

Cast other object to this type.

Enables the run-time interface to test whether pObject is derived from this object. This feature is used e.g. in the faudes container classes to test attributes. Derived classes must reimplement this function using the appropriate dynamic cast.

Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Returns:
Typed pointer object

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 47 of file iop_vdevice.cpp.

AttributeDeviceEvent & faudes::AttributeDeviceEvent::Assign ( const Type rSrc  )  [virtual]

Assign configuration data from other object.

Derived classes should reimplement this method to first try to cast the source to the respective class. If successful, the protected function DoAssign is invoked to perform the actual assignment. If the cast fails, the Assign method of the parent class is called. Thus, faudes objects are up- and downcatsted for assignment, maintaining as much of the source data as digestable by the destination object. On the downside, there is no sensible typechecking at compile-time.

Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters:
rSrc Source to copy from
Returns:
Reference to this object.

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 47 of file iop_vdevice.cpp.

bool faudes::AttributeDeviceEvent::Equal ( const Type rOther  )  const [virtual]

Test equality of configuration data.

Derived classes should reimplement this method to return true if both actual types and configuration data match. The object name is not consired in the test.

This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters:
rOther Other objevt to compare with.
Returns:
True on match.

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 47 of file iop_vdevice.cpp.

AttributeDeviceEvent & faudes::AttributeDeviceEvent::operator= ( const AttributeDeviceEvent rSrc  )  [virtual]

Definition at line 47 of file iop_vdevice.cpp.

bool faudes::AttributeDeviceEvent::operator== ( const AttributeDeviceEvent rOther  )  const [virtual]

Definition at line 47 of file iop_vdevice.cpp.

bool faudes::AttributeDeviceEvent::operator!= ( const AttributeDeviceEvent rOther  )  const [virtual]

Definition at line 47 of file iop_vdevice.cpp.

void faudes::AttributeDeviceEvent::Clear ( void   )  [virtual]

Clear.

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 79 of file iop_vdevice.cpp.

virtual bool faudes::AttributeDeviceEvent::IsDefault ( void   )  const [inline, virtual]

Test for default value (undefined).

Reimplemented from faudes::AttributeVoid.

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 80 of file iop_vdevice.h.

bool faudes::AttributeDeviceEvent::IsActuator ( void   )  const [inline]

Does this attribute define an actuator mapping?

Definition at line 83 of file iop_vdevice.h.

bool faudes::AttributeDeviceEvent::IsSensor ( void   )  const [inline]

Does this attribute define a sensor mapping?

Definition at line 86 of file iop_vdevice.h.

void faudes::AttributeDeviceEvent::DefaultActuator ( void   )  [inline]

Set to default actuator attribute.

Definition at line 89 of file iop_vdevice.h.

void faudes::AttributeDeviceEvent::DefaultSensor ( void   )  [inline]

Set to default sensor attribute.

Definition at line 95 of file iop_vdevice.h.

virtual void faudes::AttributeDeviceEvent::Actuator ( const AttributeVoid rActuatorAttribute  )  [inline, virtual]

Set actuator attribute.

Definition at line 101 of file iop_vdevice.h.

virtual void faudes::AttributeDeviceEvent::Sensor ( const AttributeVoid rSensorAttribute  )  [inline, virtual]

Set sensor attribute.

Definition at line 107 of file iop_vdevice.h.

const AttributeVoid* faudes::AttributeDeviceEvent::Actuatorp ( void   )  const [inline]

Get actuator mapping (return 0 if its not an actuator).

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 113 of file iop_vdevice.h.

const AttributeVoid* faudes::AttributeDeviceEvent::Sensorp ( void   )  const [inline]

Get sensor mapping (return 0 if its not a sensor).

Reimplemented in faudes::AttributeSignalEvent, and faudes::AttributeSimplenetEvent.

Definition at line 116 of file iop_vdevice.h.

AttributeDeviceEvent & faudes::AttributeDeviceEvent::DoAssign ( const AttributeDeviceEvent rSrcAttr  )  [protected, virtual]

Copy method.

Parameters:
rSrcAttr Source to copy from
Returns:
Ref to this attribute

Definition at line 87 of file iop_vdevice.cpp.

void faudes::AttributeDeviceEvent::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
) [protected, virtual]

Reads the attribute from TokenReader, see AttributeVoid for public wrappers.

If the current token indicates a "Sensor" or "Actuator" section, the method reads that section. Else it does nothing. Exceptions may only be thrown on invalid data within the section. The label argument is ignored. The context argument is ignored.

Parameters:
rTr TokenReader to read from
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 1)

Reimplemented from faudes::AttributeVoid.

Definition at line 106 of file iop_vdevice.cpp.

void faudes::AttributeDeviceEvent::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const [protected, virtual]

Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.

Writes all present device event attributes to include the defining data. The label argument is ignored, we use hardcoded lebels "Sensor" or "Actuator". The context argument is ignored.

Parameters:
rTw TokenWriter to write to
rLabel Section to write
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 2)

Reimplemented from faudes::AttributeVoid.

Definition at line 99 of file iop_vdevice.cpp.


Member Data Documentation

Actuator Attribute (use cast in derived classes).

Definition at line 116 of file iop_vdevice.h.

Sensor Attribute (use cast in derived classes).

Definition at line 125 of file iop_vdevice.h.

Actuator Prototype (set to nontrivial attribute in derived classes).

Definition at line 128 of file iop_vdevice.h.

Sensor Prototype (set to nontrivial attribute in derived classes).

Definition at line 131 of file iop_vdevice.h.

Fallback attribute type.

Definition at line 134 of file iop_vdevice.h.


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

libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6