fesa-core  7.0.0
fesa::RollingBufferMuxDataManager Class Reference

This class provides methods to retrieve information about the cycle IDs and names that a multiplexing manager uses regardless the implementation of the data. The prefix "rolling" means the following: 1.) The number of available slots can be defined per class-instance. 2.) Only acquisition data is handled by the rolling data manager. 3.) New values are written inside just one after another for all incoming cycles(cycleNames) 4.) If the last slot is reached, the rolling data manager will continue writing on the first slot. 5.) It is possible that for an "old" cycle no data is available, since it was already overridden. More...

#include <RollingBufferMuxDataManager.h>

Public Member Functions

 RollingBufferMuxDataManager (int32_t depth, bool multiProcess)
 
int32_t findCycleIdBackward (int32_t cycleId)
 This method finds the latest occurrence of the cycleId passed by parameter. The method looks up the ID going backwards from the currentPosition. More...
 
int32_t findCycleStampBackward (timestamp_ns cycleStamp)
 This method finds the latest occurrence of the cycleStamp passed by parameter. The method looks up the stamp going backwards from the currentPosition. More...
 
int32_t findClosestTimeStamp (timestamp_ns timestamp)
 
int32_t findClosestCycleId (int32_t cycleId, timestamp_ns timestamp)
 
int64_t getCycleStamp (int32_t position)
 
int32_t nextPosition (int64_t timeStamp, int32_t cycleId)
 this method moves the currentIndex to the next slot available in the currentCycleIds vector
 
int32_t getCurrentPosition ()
 
int32_t getDepth ()
 This method returns the depth of the data. More...
 
int32_t getNumberStoredValues ()
 This method returns the number of stored values in the rolling buffer. More...
 

Protected Attributes

int32_t depth_
 contains the number of slots to store the cycleIds
 

Detailed Description

This class provides methods to retrieve information about the cycle IDs and names that a multiplexing manager uses regardless the implementation of the data. The prefix "rolling" means the following: 1.) The number of available slots can be defined per class-instance. 2.) Only acquisition data is handled by the rolling data manager. 3.) New values are written inside just one after another for all incoming cycles(cycleNames) 4.) If the last slot is reached, the rolling data manager will continue writing on the first slot. 5.) It is possible that for an "old" cycle no data is available, since it was already overridden.

Constructor & Destructor Documentation

fesa::RollingBufferMuxDataManager::RollingBufferMuxDataManager ( int32_t  depth,
bool  multiProcess 
)
Parameters
depthThe size of the Rolling Buffer
multiProcesstrue if data must be shared between different processes.

Member Function Documentation

int32_t fesa::RollingBufferMuxDataManager::findClosestCycleId ( int32_t  cycleId,
timestamp_ns  timestamp 
)

Finds and returns the slot whose cycle corresponds to cycleId, and whose timestamp is the closest less than or equal to the timestamp parameter.

Parameters
cycleIdthe cycle ID to look for
timestampthe timestamp to look for
Returns
the matching slot, or INVALID_SLOT if not found.
int32_t fesa::RollingBufferMuxDataManager::findClosestTimeStamp ( timestamp_ns  timestamp)

Finds and returns the slot whose timestamp is the closest less than or equal to the timestamp parameter.

Parameters
timestampthe timestamp to look for
Returns
the matching slot, or INVALID_SLOT if not found.
int32_t fesa::RollingBufferMuxDataManager::findCycleIdBackward ( int32_t  cycleId)

This method finds the latest occurrence of the cycleId passed by parameter. The method looks up the ID going backwards from the currentPosition.

Parameters
cycleIdthe CycleID we are searching for
Returns
the corresponding slot, INVALID_SLOT if not found
int32_t fesa::RollingBufferMuxDataManager::findCycleStampBackward ( timestamp_ns  cycleStamp)

This method finds the latest occurrence of the cycleStamp passed by parameter. The method looks up the stamp going backwards from the currentPosition.

Parameters
cycleStampthe cycleStamp we are searching for
Returns
the corresponding slot, INVALID_SLOT if not found
int32_t fesa::RollingBufferMuxDataManager::getCurrentPosition ( )
inline
Returns
the current position of the rolling
int64_t fesa::RollingBufferMuxDataManager::getCycleStamp ( int32_t  position)
inline
Returns
the cycle stamp at the position passed by argument
int32_t fesa::RollingBufferMuxDataManager::getDepth ( )
inline

This method returns the depth of the data.

Returns
the depth of the data
int32_t fesa::RollingBufferMuxDataManager::getNumberStoredValues ( )
inline

This method returns the number of stored values in the rolling buffer.

Returns
The number of stored values.

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