Public Types | Public Member Functions

openfluid::core::Event Class Reference

Class defining a discrete event, including attached information. More...

Inheritance diagram for openfluid::core::Event:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::map< std::string,
openfluid::core::StringValue
EventInfosMap_t

Public Member Functions

 Event ()
 Event (DateTime Date)
 ~Event ()
bool isInfoExist (const std::string Key) const
bool isInfoEqual (const std::string Key, const std::string Value) const
bool isInfoEqual (const std::string Key, long Value) const
bool isInfoEqual (const std::string Key, const double Value) const
bool isInfoEqual (const std::string Key, const double *Info) const
bool isInfoEqual (const std::string Key, const DoubleValue &Info) const
int getInfosCount () const
EventInfosMap_t getInfos () const
DateTime getDateTime () const
bool getInfoAsString (const std::string Key, std::string *Info) const
bool getInfoAsString (const std::string Key, std::string &Info) const
bool getInfoAsLong (const std::string Key, long *Info) const
bool getInfoAsLong (const std::string Key, long &Info) const
bool getInfoAsDouble (const std::string Key, double *Info) const
bool getInfoAsDouble (const std::string Key, double &Info) const
bool getInfoAsScalarValue (const std::string Key, double *Info) const
bool getInfoAsDoubleValue (const std::string Key, DoubleValue &Info) const
bool addInfo (const std::string Key, const std::string Info)
void println () const

Detailed Description

Class defining a discrete event, including attached information.

Each event attached information is represented by a Key-Value couple :


Member Typedef Documentation


Constructor & Destructor Documentation

openfluid::core::Event::Event ( )

Default constructor

openfluid::core::Event::Event ( DateTime  Date)

Constructor

Parameters:
[in]Datethe date and time of the event
openfluid::core::Event::~Event ( )

Destructor


Member Function Documentation

bool openfluid::core::Event::addInfo ( const std::string  Key,
const std::string  Info 
)

Adds an information to the event

Parameters:
[in]Keythe key of the added information
[in]Infothe value of the added information
Returns:
true if the adding is correct (key does not already exists)
DateTime openfluid::core::Event::getDateTime ( ) const [inline]

Returns the date and time of the event

bool openfluid::core::Event::getInfoAsDouble ( const std::string  Key,
double *  Info 
) const

Gets an information as a double

Parameters:
[in]Keythe requested information key
[out]Infothe value corresponding to the requested key
Returns:
true if the key exists and the conversion to the requested type is correct
Deprecated:
bool openfluid::core::Event::getInfoAsDouble ( const std::string  Key,
double &  Info 
) const

Gets an information as a double

Parameters:
[in]Keythe requested information key
[out]Infothe 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::getInfoAsDoubleValue ( const std::string  Key,
DoubleValue Info 
) const

Gets an information as a DoubleValue

Parameters:
[in]Keythe requested information key
[out]Infothe 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 ( const std::string  Key,
long &  Info 
) const

Gets an information as a long integer

Parameters:
[in]Keythe requested information key
[out]Infothe 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 ( const std::string  Key,
long *  Info 
) const

Gets an information as a long integer

Parameters:
[in]Keythe requested information key
[out]Infothe value corresponding to the requested key
Returns:
true if the key exists and the conversion to the requested type is correct
Deprecated:
bool openfluid::core::Event::getInfoAsScalarValue ( const std::string  Key,
double *  Info 
) const

Gets an information as a ScalarValue (double)

Parameters:
[in]Keythe requested information key
[out]Infothe value corresponding to the requested key
Returns:
true if the key exists and the conversion to the requested type is correct
Deprecated:
bool openfluid::core::Event::getInfoAsString ( const std::string  Key,
std::string *  Info 
) const

Gets an information as a string

Parameters:
[in]Keythe requested information key
[out]Infothe value corresponding to the requested key
Returns:
true if the key exists and the conversion to the requested type is correct
Deprecated:
bool openfluid::core::Event::getInfoAsString ( const std::string  Key,
std::string &  Info 
) const

Gets an information as a string

Parameters:
[in]Keythe requested information key
[out]Infothe value corresponding to the requested key
Returns:
true if the key exists and the conversion to the requested type is correct
EventInfosMap_t openfluid::core::Event::getInfos ( ) const [inline]

Returns all the informations as an EventInfosMap

int openfluid::core::Event::getInfosCount ( ) const [inline]

Returns the number of information

bool openfluid::core::Event::isInfoEqual ( const std::string  Key,
const std::string  Value 
) const

Returns true if the information exists and equals the given string value

Parameters:
[in]Keythe requested information key
[in]Valuethe requested value
bool openfluid::core::Event::isInfoEqual ( const std::string  Key,
long  Value 
) const

Returns true if the information exists and equals the given long value

Parameters:
[in]Keythe requested information key
[in]Valuethe requested value
bool openfluid::core::Event::isInfoEqual ( const std::string  Key,
const double  Value 
) const

Returns true if the information exists and equals the given double value

Parameters:
[in]Keythe requested information key
[in]Valuethe requested value
bool openfluid::core::Event::isInfoEqual ( const std::string  Key,
const double *  Info 
) const

Returns true if the information exists and equals the given double value

Parameters:
[in]Keythe requested information key
[in]Infothe requested value
Deprecated:
bool openfluid::core::Event::isInfoEqual ( const std::string  Key,
const DoubleValue Info 
) const

Returns true if the information exists and equals the given DoubleValue value

Parameters:
[in]Keythe requested information key
[in]Infothe requested value
bool openfluid::core::Event::isInfoExist ( const std::string  Key) const

Returns true if the information exists

Parameters:
[in]Keythe requested information key
void openfluid::core::Event::println ( ) const

Prints the content of the event to stdout


Generated using Doxygen 1.7.3
Creative Commons License Creative Commons By-NC-ND license