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(virtual accelerators) 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 info data is available, since it was already overridden 6.) If the same cycle is played more than once, data will not be instantly overridden, like in the TimingDataManager. More...
#include <RollingMultiplexingDataManager.h>
Public Member Functions | |
RollingMultiplexingDataManager (int32_t depth) | |
Constructor. | |
virtual int32_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. | |
virtual void | mapMemory (char *address)=0 |
This method maps the data that the RollingMultiplexingDataManager uses from the address passed by argument. It is implemented inside the children of this class. | |
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. | |
int32_t | findCycleStampBackward (int64_t cycleStamp) |
This method finds the latest occurrence of the cycleStamp passed by parameter. The method looks up the stamp going backwards from the currentPosition. | |
int64_t | getCycleStamp (int32_t position) |
This method finds the cycleId, passed by argument, starting from the first position. | |
int32_t | nextPosition (int64_t cycleStamp, 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. | |
int32_t | getCurrentCycleId () |
This method returns the cycle ID of the current slot. | |
void | setCurrentCycleId (int32_t cycleId) |
This method returns the cycleID and of the last used slot. | |
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 | |
AbstractMutex * | mutex_ |
The mutex to protect all other members of that class. | |
int32_t * | currentPosition_ |
this element points to the next slot available in the currentIdesCol_ vector |
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(virtual accelerators) 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 info data is available, since it was already overridden 6.) If the same cycle is played more than once, data will not be instantly overridden, like in the TimingDataManager.
Definition at line 23 of file RollingMultiplexingDataManager.h.
fesa::RollingMultiplexingDataManager::RollingMultiplexingDataManager | ( | int32_t | depth | ) |
Constructor.
depth | The size of the Rolling Buffer |
Definition at line 12 of file RollingMultiplexingDataManager.cpp.
virtual int32_t fesa::RollingMultiplexingDataManager::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.
Implements fesa::MultiplexingDataManager.
Implemented in fesa::HeapRollingMultiplexingDataManager, and fesa::ShmRollingMultiplexingDataManager.
int32_t fesa::RollingMultiplexingDataManager::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.
cycleId | the CycleID we are searching for |
Definition at line 17 of file RollingMultiplexingDataManager.cpp.
References currentIdsCol_, currentPosition_, depth_, and mutex_.
Referenced by fesa::RollingMultiplexingManager::getLastSlot(), and fesa::RollingMultiplexingManager::getSlot().
int32_t fesa::RollingMultiplexingDataManager::findCycleStampBackward | ( | int64_t | cycleStamp | ) |
This method finds the latest occurrence of the cycleStamp passed by parameter. The method looks up the stamp going backwards from the currentPosition.
cycleStamp | the cycleStamp we are searching for |
Definition at line 46 of file RollingMultiplexingDataManager.cpp.
References currentCycleStampsCol_, currentPosition_, depth_, and mutex_.
Referenced by fesa::RollingMultiplexingManager::getSlot(), and fesa::RollingMultiplexingManager::requireSlot().
int32_t fesa::RollingMultiplexingDataManager::getCurrentCycleId | ( | ) | [inline] |
This method returns the cycle ID of the current slot.
Definition at line 168 of file RollingMultiplexingDataManager.h.
References currentId_.
int32_t fesa::RollingMultiplexingDataManager::getCurrentPosition | ( | ) | [inline] |
Definition at line 176 of file RollingMultiplexingDataManager.h.
References currentPosition_.
int64_t fesa::RollingMultiplexingDataManager::getCycleStamp | ( | int32_t | position | ) | [inline] |
This method finds the cycleId, passed by argument, starting from the first position.
cycleId | the CycleID we are searching for |
This method finds the cycleId, passed by argument, starting from the first position
cycleStamp | the cycleStamp we are searching for |
This method puts the cycleId passed by argument into the currentPosition
cycleId | the CycleID we want to put |
This method puts the cycleStamp passed by argument into the currentPosition
cycleStamp | the cycleStamp we want to put |
Definition at line 181 of file RollingMultiplexingDataManager.h.
References currentCycleStampsCol_.
Referenced by fesa::RollingMultiplexingManager::getSlot().
int32_t fesa::RollingMultiplexingDataManager::getDepth | ( | ) | [inline] |
This method returns the depth of the data.
Definition at line 163 of file RollingMultiplexingDataManager.h.
References depth_.
Referenced by fesa::RollingMultiplexingManager::getDepth().
virtual void fesa::RollingMultiplexingDataManager::mapMemory | ( | char * | address | ) | [pure virtual] |
This method maps the data that the RollingMultiplexingDataManager uses from the address passed by argument. It is implemented inside the children of this class.
address | the memory address where the data will begin |
Implements fesa::MultiplexingDataManager.
Implemented in fesa::HeapRollingMultiplexingDataManager, and fesa::ShmRollingMultiplexingDataManager.
int32_t fesa::RollingMultiplexingDataManager::nextPosition | ( | int64_t | cycleStamp, | |
int32_t | cycleId | |||
) |
this method moves the currentIndex to the next slot available in the currentCycleIds vector
Definition at line 154 of file RollingMultiplexingDataManager.cpp.
References currentCycleStampsCol_, currentIdsCol_, currentPosition_, depth_, and mutex_.
Referenced by fesa::RollingMultiplexingManager::requireSlot().
void fesa::RollingMultiplexingDataManager::setCurrentCycleId | ( | int32_t | cycleId | ) | [inline] |
This method returns the cycleID and of the last used slot.
Definition at line 172 of file RollingMultiplexingDataManager.h.
References currentId_.
int64_t* fesa::RollingMultiplexingDataManager::currentCycleStampsCol_ [protected] |
this vector stores the used cycle stamps
Definition at line 139 of file RollingMultiplexingDataManager.h.
Referenced by findCycleStampBackward(), getCycleStamp(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and nextPosition().
int32_t* fesa::RollingMultiplexingDataManager::currentId_ [protected] |
the ID of the ongoing cycle
Definition at line 149 of file RollingMultiplexingDataManager.h.
Referenced by getCurrentCycleId(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and setCurrentCycleId().
int32_t* fesa::RollingMultiplexingDataManager::currentIdsCol_ [protected] |
this vector stores the used cycle IDs
Definition at line 134 of file RollingMultiplexingDataManager.h.
Referenced by findCycleIdBackward(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and nextPosition().
int32_t* fesa::RollingMultiplexingDataManager::currentPosition_ [protected] |
this element points to the next slot available in the currentIdesCol_ vector
Definition at line 159 of file RollingMultiplexingDataManager.h.
Referenced by findCycleIdBackward(), findCycleStampBackward(), getCurrentPosition(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and nextPosition().
int32_t fesa::RollingMultiplexingDataManager::depth_ [protected] |
contains the number of slots to store the cycleIds
Definition at line 144 of file RollingMultiplexingDataManager.h.
Referenced by fesa::ShmRollingMultiplexingDataManager::computeMemorySize(), fesa::HeapRollingMultiplexingDataManager::computeMemorySize(), findCycleIdBackward(), findCycleStampBackward(), getDepth(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and nextPosition().
The mutex to protect all other members of that class.
Reimplemented from fesa::MultiplexingDataManager.
Definition at line 154 of file RollingMultiplexingDataManager.h.
Referenced by findCycleIdBackward(), findCycleStampBackward(), fesa::ShmRollingMultiplexingDataManager::mapMemory(), fesa::HeapRollingMultiplexingDataManager::mapMemory(), and nextPosition().