rad 6.2.0
|
#include <activityUpdateOldb.hpp>
Public Member Functions | |
ActivityUpdateOldb (const std::string &id, const std::string &logger_name, rad::DoubleMap< rad::cii::OldbType > &oldb_map, std::chrono::seconds conn_timeout, std::chrono::milliseconds period) | |
virtual | ~ActivityUpdateOldb () |
std::chrono::milliseconds | GetPeriod () |
rad::cii::OldbAdapter & | GetOldbAdapter () |
void | SetPeriod (const std::chrono::milliseconds period) |
void | SetOldbPrefix (const std::string &prefix) |
void | Run () override |
ActivityUpdateOldb (const ActivityUpdateOldb &)=delete | |
ActivityUpdateOldb & | operator= (const ActivityUpdateOldb &)=delete |
Disable copy constructor. | |
![]() | |
ThreadActivity (const ThreadActivity &)=delete | |
ThreadActivity & | operator= (const ThreadActivity &)=delete |
pthread_t | GetNativeHandle () const override |
bool | IsThreadJoined () const override |
ThreadBaseActivity (ThreadBaseActivity const &)=delete | |
![]() | |
ThreadBaseActivity (ThreadBaseActivity const &)=delete | |
void | start (scxml4cpp::Context *c) override |
void | stop (scxml4cpp::Context *c) override |
bool | IsStopRequested () const |
![]() | |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
Additional Inherited Members | |
![]() | |
void | StartThread () override |
void | JoinThread () override |
std::string | GetPthreadName () |
int | SetPthreadName (const std::string &name) |
This activity class implement a thread that can be used to write to the OLDB periodically attributes and associated values.
The attributes and values are taken from an object of type rad::DoubleMap<rad::cii::OldbType> which is shared between this class (the consumer) and the data producer(s).
The attributes and values are written to the OLDB via a rad::cii::OldbAdapter class.
The period of the activity and the connection timeout to write to the OLDB are configurable.
rad::ActivityUpdateOldb::ActivityUpdateOldb | ( | const std::string & | id, |
const std::string & | logger_name, | ||
rad::DoubleMap< rad::cii::OldbType > & | oldb_map, | ||
std::chrono::seconds | conn_timeout, | ||
std::chrono::milliseconds | period ) |
Constructor for the ActivityUpdateOldb class.
id | Activity identifier. |
logger_name | Name of the logger to be used by the class. |
sm | Reference to the SM adapter that can be used to inject events. |
oldb_map | Reference to the attributes/values to be written. |
conn_timeout | Timeout when connecting to the OLDB. |
period | Minimum period between two consecutive updates of the OLDB. |
|
virtual |
|
delete |
rad::cii::OldbAdapter & rad::ActivityUpdateOldb::GetOldbAdapter | ( | ) |
std::chrono::milliseconds rad::ActivityUpdateOldb::GetPeriod | ( | ) |
|
delete |
Disable copy constructor.
|
overridevirtual |
Method implementing the thread which writes periodically to the OLDB the attributes and values taken from the rad::DoubleMap<rad::cii::OldbType> shared object.
Implements rad::ThreadActivity.
void rad::ActivityUpdateOldb::SetOldbPrefix | ( | const std::string & | prefix | ) |
This method allows to set a prefix to be added to all the keys before writing to the OLDB.
prefix | Prefix to be added to the keys. |
void rad::ActivityUpdateOldb::SetPeriod | ( | const std::chrono::milliseconds | period | ) |
This method allows to set the min. duration of one update loop of the activity.