openfluid::core::Event Class Reference
Class defining a discrete event, including attached information.
More...
List of all members.
Public Types |
typedef std::map< std::string,
std::string > | EventInfosMap_t |
Public Member Functions |
| | Event () |
| | Event (DateTime Date) |
| | ~Event () |
| bool | isInfoExist (std::string Key) |
| bool | isInfoEqual (std::string Key, std::string Value) |
| bool | isInfoEqual (std::string Key, long Value) |
| bool | isInfoEqual (std::string Key, double Value) |
| bool | isInfoEqual (std::string Key, ScalarValue *Info) |
| int | getInfosCount () |
| EventInfosMap_t | getInfos () |
| DateTime | getDateTime () |
| bool | getInfoAsString (std::string Key, std::string *Info) |
| bool | getInfoAsLong (std::string Key, long *Info) |
| bool | getInfoAsDouble (std::string Key, double *Info) |
| bool | getInfoAsScalarValue (std::string Key, ScalarValue *Info) |
| bool | addInfo (std::string Key, std::string Info) |
| void | println () |
Detailed Description
Class defining a discrete event, including attached information.
Each event attached information is represented by a Key-Value couple :
- Key is the name given to the information
- Value is the value of the information and can be numeric or text information
Member Typedef Documentation
Constructor & Destructor Documentation
| openfluid::core::Event::Event |
( |
|
) |
|
| openfluid::core::Event::Event |
( |
DateTime |
Date |
) |
|
Constructor
- Parameters:
-
| [in] | Date | the date and time of the event |
| openfluid::core::Event::~Event |
( |
|
) |
|
Member Function Documentation
| bool openfluid::core::Event::addInfo |
( |
std::string |
Key, |
|
|
std::string |
Info | |
|
) |
| | |
Adds an information to the event
- Parameters:
-
| [in] | Key | the key of the added information |
| [in] | Info | the value of the added information |
- Returns:
- true if the adding is correct (key does not already exists)
| DateTime openfluid::core::Event::getDateTime |
( |
|
) |
[inline] |
Returns the date and time of the event
| bool openfluid::core::Event::getInfoAsDouble |
( |
std::string |
Key, |
|
|
double * |
Info | |
|
) |
| | |
Gets an information as a double
- Parameters:
-
| [in] | Key | the requested information key |
| [out] | Info | the value corresponding to the requested key |
- Returns:
- true if the key exists and the conversion to the requested type is correct
| bool openfluid::core::Event::getInfoAsLong |
( |
std::string |
Key, |
|
|
long * |
Info | |
|
) |
| | |
Gets an information as a long integer
- Parameters:
-
| [in] | Key | the requested information key |
| [out] | Info | the value corresponding to the requested key |
- Returns:
- true if the key exists and the conversion to the requested type is correct
| bool openfluid::core::Event::getInfoAsScalarValue |
( |
std::string |
Key, |
|
|
ScalarValue * |
Info | |
|
) |
| | |
Gets an information as a ScalarValue
- Parameters:
-
| [in] | Key | the requested information key |
| [out] | Info | the value corresponding to the requested key |
- Returns:
- true if the key exists and the conversion to the requested type is correct
| bool openfluid::core::Event::getInfoAsString |
( |
std::string |
Key, |
|
|
std::string * |
Info | |
|
) |
| | |
Gets an information as a string
- Parameters:
-
| [in] | Key | the requested information key |
| [out] | Info | the value corresponding to the requested key |
- Returns:
- true if the key exists and the conversion to the requested type is correct
Returns all the informations as an EventInfosMap
| int openfluid::core::Event::getInfosCount |
( |
|
) |
[inline] |
Returns the number of information
| bool openfluid::core::Event::isInfoEqual |
( |
std::string |
Key, |
|
|
ScalarValue * |
Info | |
|
) |
| | |
Returns true if the information exists and equals the given ScalarValue value
- Parameters:
-
| [in] | Key | the requested information key |
| [in] | Info | the requested value |
| bool openfluid::core::Event::isInfoEqual |
( |
std::string |
Key, |
|
|
double |
Value | |
|
) |
| | |
Returns true if the information exists and equals the given double value
- Parameters:
-
| [in] | Key | the requested information key |
| [in] | Value | the requested value |
| bool openfluid::core::Event::isInfoEqual |
( |
std::string |
Key, |
|
|
long |
Value | |
|
) |
| | |
Returns true if the information exists and equals the given long value
- Parameters:
-
| [in] | Key | the requested information key |
| [in] | Value | the requested value |
| bool openfluid::core::Event::isInfoEqual |
( |
std::string |
Key, |
|
|
std::string |
Value | |
|
) |
| | |
Returns true if the information exists and equals the given string value
- Parameters:
-
| [in] | Key | the requested information key |
| [in] | Value | the requested value |
| bool openfluid::core::Event::isInfoExist |
( |
std::string |
Key |
) |
|
Returns true if the information exists
- Parameters:
-
| [in] | Key | the requested information key |
| void openfluid::core::Event::println |
( |
|
) |
|
Prints the content of the event to stdout