fesa-core  4.2.0
fesa::RollingBufferMuxDataManager Class Referenceabstract

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>

Inheritance diagram for fesa::RollingBufferMuxDataManager:
fesa::MultiplexingDataManager fesa::AbstractMultiplexingDataManager fesa::HeapRollingBufferMuxDataManager fesa::ShmRollingBufferMuxDataManager

Public Member Functions

 RollingBufferMuxDataManager (int32_t depth)
 Constructor. More...
 
virtual std::size_t computeMemorySize ()=0
 This method returns the number of bytes which are necessary to store the date of the class. It is implemented inside the children of this class. More...
 
virtual void mapMemory (char *address, bool first)=0
 
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 getCurrentCycleId ()
 This method returns the cycle ID of the current slot. More...
 
int32_t getNumberStoredValues ()
 This method returns the number of stored values in the rolling buffer. More...
 
- Public Member Functions inherited from fesa::MultiplexingDataManager
 MultiplexingDataManager ()
 Constructor.
 
virtual ~MultiplexingDataManager ()
 Destructor.
 
- Public Member Functions inherited from fesa::AbstractMultiplexingDataManager
virtual ~AbstractMultiplexingDataManager ()
 Destructor.
 

Protected Attributes

int32_t * currentIdsCol_
 this vector stores the used cycle IDs
 
int64_t * currentCycleStampsCol_
 this vector stores the used cycle stamps
 
int32_t depth_
 contains the number of slots to store the cycleIds
 
int32_t * currentId_
 the ID of the ongoing cycle
 
int32_t * currentPosition_
 this element points to the next slot available in the currentIdesCol_ vector
 
int32_t * numberStoredValues_
 Number of stored values in the rolling buffer.
 
- Protected Attributes inherited from fesa::MultiplexingDataManager
int32_t * currentCycleId_
 Current cycleID.
 
Mutexmutex_
 mutex for all class member variables
 
int32_t * currentSlot_
 The slot where the data of the current cycle is stored.
 

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)

Constructor.

Parameters
depthThe size of the Rolling Buffer

Member Function Documentation

virtual std::size_t fesa::RollingBufferMuxDataManager::computeMemorySize ( )
pure virtual

This method returns the number of bytes which are necessary to store the date of the class. It is implemented inside the children of this class.

Returns
the number of bytes computed

Implements fesa::MultiplexingDataManager.

Implemented in fesa::HeapRollingBufferMuxDataManager, and fesa::ShmRollingBufferMuxDataManager.

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::getCurrentCycleId ( )
inline

This method returns the cycle ID of the current slot.

Returns
the current cycle ID
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.
virtual void fesa::RollingBufferMuxDataManager::mapMemory ( char *  address,
bool  first 
)
pure virtual

Maps shared fields to the memory pointed to by pAddr.

Parameters
addressaddress where to map shared fields
firsttrue if this is the first process to map the shared fields

Implements fesa::MultiplexingDataManager.

Implemented in fesa::HeapRollingBufferMuxDataManager, and fesa::ShmRollingBufferMuxDataManager.


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