Public Types | Public Member Functions | List of all members
openfluid::core::Event Class Reference

#include <core/Event.hpp>

Public Types

typedef std::map< std::string, openfluid::core::StringValueEventInfosMap_t
 

Public Member Functions

 Event ()
 
 Event (const 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 OPENFLUID_DEPRECATED
 
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 OPENFLUID_DEPRECATED
 
bool getInfoAsString (const std::string &Key, std::string &Info) const
 
bool getInfoAsLong (const std::string &Key, long *Info) const OPENFLUID_DEPRECATED
 
bool getInfoAsLong (const std::string &Key, long &Info) const
 
bool getInfoAsDouble (const std::string &Key, double *Info) const OPENFLUID_DEPRECATED
 
bool getInfoAsDouble (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 ( const 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:
Since version 1.7.1. Use openfluid::core::Event::getInfoAsDouble(const std::string&,double&) const instead
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
Deprecated:
Since version 1.7.1. Use openfluid::core::Event::getInfoAsLong(const std::string&,long&) const instead
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::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:
Since version 1.7.1. Use openfluid::core::Event::getInfoAsString(const std::string&,std::string&) const instead
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:
Since version 1.7.1. Use openfluid::core::Event::isInfoEqual(const std::string&,const double) const
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


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