ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::utils::bat::TaskOldb Class Reference

#include <taskOldb.hpp>

Public Member Functions

 TaskOldb (rad::DoubleMap< rad::cii::OldbType > &oldb_map, rad::cii::OldbAdapter &oldb_adapter, std::chrono::milliseconds period)
 Class constructor.
 
virtual ~TaskOldb ()
 Default destructor.
 
void Run ()
 Thread run method.
 
void StartThread ()
 
void StopThread ()
 
 TaskOldb (const TaskOldb &)=delete
 Disable copy constructor.
 
TaskOldboperator= (const TaskOldb &)=delete
 Disable assignment operator.
 

Detailed Description

This class implements a worker thread to manage OLDB writes separately from the main thread and thus reducing the CPU usage for applications writing many attributes into the OLDB in a short time.

See also
std::thread
rad::DoubleMap

Constructor & Destructor Documentation

◆ TaskOldb() [1/2]

ifw::core::utils::bat::TaskOldb::TaskOldb ( rad::DoubleMap< rad::cii::OldbType > & oldb_map,
rad::cii::OldbAdapter & oldb_adapter,
std::chrono::milliseconds period )

Class constructor.

Parameters
[in]oldb_mapReference to double map object
[in]db_timeoutOLDB connection timeout.
[in]periodWorker thread periodicity.

◆ ~TaskOldb()

ifw::core::utils::bat::TaskOldb::~TaskOldb ( )
virtual

Default destructor.

◆ TaskOldb() [2/2]

ifw::core::utils::bat::TaskOldb::TaskOldb ( const TaskOldb & )
delete

Disable copy constructor.

Member Function Documentation

◆ operator=()

TaskOldb & ifw::core::utils::bat::TaskOldb::operator= ( const TaskOldb & )
delete

Disable assignment operator.

◆ Run()

void ifw::core::utils::bat::TaskOldb::Run ( )

Thread run method.

This method runs an infinite loop with a wait time defined by the period. In each loop, it writes all the attributes found in the internal double map.

◆ StartThread()

void ifw::core::utils::bat::TaskOldb::StartThread ( )

◆ StopThread()

void ifw::core::utils::bat::TaskOldb::StopThread ( )

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