#include <Event.h>
Collaboration diagram for ot::Event:

This class replaces the obsolete State class, which was used in OpenTracker 1.1.
Public Member Functions | |
| Event () | |
| Event (const Event &rv) | |
| ~Event () | |
| Event & | operator= (const Event &rv) |
| bool | hasAttribute (const std::string &name) const |
| bool | delAttribute (const std::string &name) |
| bool | renAttribute (const std::string &oldName, const std::string &newName) |
| void | copyAllButStdAttr (const Event &rv) |
| void | clearAttributes () |
| void | printout () const |
| const std::string | getPrintOut () const |
| void | getPrintOut (std::string &outstr) const |
| void | timeStamp () |
| void | serialize (std::ostream &out) const |
| const std::string | serialize () const |
| std::istream & | deserialize (std::istream &in) |
| void | deserialize (std::string &str) |
| int | getSize () const |
| const std::type_info & | getAttributeType (const std::string &name) const throw (std::invalid_argument) |
| const std::string & | getAttributeTypeName (const std::string &name) const throw (std::invalid_argument) |
| const std::string & | getAttributeName (const int index) const throw (std::invalid_argument) |
| int | getAttributeIndex (const std::string &name) const throw (std::invalid_argument) |
| template<typename T> | |
| T & | getAttribute (const T *dummy, const std::string &name) |
| template<typename T> | |
| const T & | getAttribute (const T *dummy, const std::string &name) const throw (std::invalid_argument) |
| template<typename T> | |
| T & | getAttribute (const std::string &name, const T &defValue) |
| template<typename T> | |
| bool | addAttribute (const std::string &name, const T &value) |
| template<typename T> | |
| bool | setAttribute (const std::string &name, const T &value) |
Convenience Functions to Access Former Standard Attributes | |
This set of methods does not add any functionality, it just provides an easy and convenience way to access former standard attributes (position, orientation, button, and confidence). These functions can also be used for easily porting applications using the fixed data structure of OpenTracker 1.1 states to new multi-modal events.
All get-methods may throw std::invalid_argument exceptions if attributes with the same name but of another type exist! | |
| std::vector< float > & | getPosition () |
| const std::vector< float > & | getPosition () const |
| std::vector< float > & | getOrientation () |
| const std::vector< float > & | getOrientation () const |
| float & | getConfidence () |
| const float & | getConfidence () const |
| unsigned short & | getButton () |
| const unsigned short & | getButton () const |
| void | setPosition (const std::vector< float > &value) |
| void | setPosition (const float *value) |
| void | setOrientation (const std::vector< float > &value) |
| void | setOrientation (const float *value) |
| void | setConfidence (const float &value) |
| void | setButton (const unsigned short &value) |
Non Template Interface | |
This set of methods allows access of attributes if the attribute's type is not known yet during compile time. Therefore, type and value of attributes are encoded in strings. | |
| bool | addAttribute (const std::string &type, const std::string &name, const std::string &value) |
| bool | setAttribute (const std::string &type, const std::string &name, const std::string &value) |
| const std::string | getAttributeValueString (const std::string &name) const throw (std::invalid_argument) |
Static Public Member Functions | |
| static void | registerAllKnownTypes () |
| static bool | knowsType (const std::string typeName) |
| template<typename T> | |
| static void | registerGenericTypeName (const T *dummy, const std::string &genericTypeName) |
Public Attributes | |
| double | time |
| timestamp of the state in milliseconds since 1/1/1970 | |
Static Public Attributes | |
| static Event | null |
| typesafe null reference, to be used instead of a NULL pointer | |
|
|
Standard constructor. The event gets a current timestamp. |
|
|
Copy constructor. Copies all attributes of another event into the new one.
|
|
|
Destructor, deleting all attributes held by the event. |
|
||||||||||||||||
|
Adds a new attribute. Throws an exception if type is not known.
|
|
||||||||||||||||
|
Adds a new attribute. The attribute's type and value are encoded in strings. Throws an exception if type is not known.
|
|
|
Deletes all attributes held by the event. |
|
|
Copies all but standard attributes, which were used in OT11. Standard attributes are position, orientation, button, and confidence.
|
|
|
Deletes an attribute.
|
|
|
Deserializes an event from a string. Naturally, the data in the string must be a correctly serialized event.
|
|
|
Deserializes an event from an input stream. Naturally, the data coming from the input stream must be a correctly serialized event.
|
|
||||||||||||||||
|
Returns a reference to the value of the attribute called
|
|
||||||||||||||||
|
Returns a reference to the value of the attribute called
|
|
||||||||||||||||
|
Returns a reference to the value of the attribute called
|
|
|
Returns the index of an attribute by name. An exception is thrown if the name is not valid.
|
|
|
Returns the name of an attribute by index. An exception is thrown if the index is not valid.
|
|
|
Returns the RTTI type information of an attribute's value. An exception is thrown if the name is not valid.
|
|
|
Return the generic type name of an attribute's value. An exception is thrown if the name is not valid.
|
|
|
Returns the value of an attribute encoded in a string.
|
|
|
Returns the value of the attribute 'button', which is a single unsigned short value.
|
|
|
Returns the value of the attribute 'button', which is a single unsigned short value.
|
|
|
Returns the value of the attribute 'confidence', which is a single float value.
|
|
|
Returns the value of the attribute 'confidence', which is a single float value.
|
|
|
Returns the value of the attribute 'orientation', which is a float vector of size 4.
|
|
|
Returns the value of the attribute 'orientation', which is a float vector of size 4.
|
|
|
Returns the value of the attribute 'position', which is a float vector of size 3.
|
|
|
Returns the value of the attribute 'position', which is a float vector of size 3.
|
|
|
Returns a string that can be used to print out all data held by the event. For a more compact layout of the same data use the serialize functions or streaming operators.
|
|
|
Returns a string that can be used to print out all data held by the event. For a more compact layout of the same data use the serialize functions or streaming operators.
|
|
|
Return the number of attributes held by the event.
|
|
|
Checks for the existence of an attribute by its name.
|
|
|
Checks whether a generic type name is known by the system.
|
|
|
Assignment operator. Copies all attributes of another event into this one.
|
|
|
Prints out all data held by the event. Uses the standard output device. This function should be used mainly for debugging purposes. |
|
|
Registers all types that can be used within the OpenTracker library. Every type is registered with a generic typename, which is arbitrary but must be unique. In this function, the generic type names are matched to the according creator functions, which are created automatically. If a new type needs to be added to the library permanently, a new line should be added to this function. Every registered type must provide a standard constructor and streaming operators, which can be defined in 'core/iostream_ext.h'. |
|
||||||||||||||||
|
Converts Event into a CORBA sequence of string-any structs, which is the CORBA definition of the OpenTracker event type
|
|
||||||||||||
|
Renames an attribute.
|
|
|
Serializes the event's data into a string.
|
|
|
Serializes the event's data into an output stream.
|
|
||||||||||||||||
|
Sets the value of an attribute. If currently no attribute called
|
|
||||||||||||||||
|
Sets the value of an attribute. The type and the value of the attribute are encoded in strings. If currently no attribute called
|
|
|
Sets the value of the attribute 'button'.
|
|
|
Sets the value of the attribute 'confidence'.
|
|
|
Sets the value of the attribute 'orientation'.
|
|
|
Sets the value of the attribute 'orientation'.
|
|
|
Sets the value of the attribute 'position'.
|
|
|
Sets the value of the attribute 'position'.
|
|
|
Updates the event's timestamp to the current time. |
|
|
typesafe null reference, to be used instead of a NULL pointer
|
|
|
timestamp of the state in milliseconds since 1/1/1970
|
1.4.6