fesa::RollingMultiplexingDataManager 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(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>

Inheritance diagram for fesa::RollingMultiplexingDataManager:
fesa::MultiplexingDataManager fesa::AbstractMultiplexingDataManager fesa::HeapRollingMultiplexingDataManager fesa::ShmRollingMultiplexingDataManager

List of all members.

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
AbstractMutexmutex_
 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

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(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.


Constructor & Destructor Documentation

fesa::RollingMultiplexingDataManager::RollingMultiplexingDataManager ( int32_t  depth  ) 

Constructor.

Parameters:
depth The size of the Rolling Buffer

Definition at line 12 of file RollingMultiplexingDataManager.cpp.


Member Function Documentation

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.

Returns:
the number of bytes computed

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.

Parameters:
cycleId the CycleID we are searching for
Returns:
the corresponding slot, -1 if not found

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.

Parameters:
cycleStamp the cycleStamp we are searching for
Returns:
the corresponding slot, -1 if not found

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.

Returns:
the current cycle ID

Definition at line 168 of file RollingMultiplexingDataManager.h.

References currentId_.

int32_t fesa::RollingMultiplexingDataManager::getCurrentPosition (  )  [inline]
Returns:
the current position of the rolling

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.

Parameters:
cycleId the CycleID we are searching for
Returns:
the corresponding slot, -1 if not found

This method finds the cycleId, passed by argument, starting from the first position

Parameters:
cycleStamp the cycleStamp we are searching for
Returns:
the corresponding slot, -1 if not found

This method puts the cycleId passed by argument into the currentPosition

Parameters:
cycleId the CycleID we want to put
Returns:
the slot where the ID was put, -1 on error

This method puts the cycleStamp passed by argument into the currentPosition

Parameters:
cycleStamp the cycleStamp we want to put
Returns:
the slot where the stamp was put, -1 on error
the cycle stamp at the position passed by argument

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.

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.

Parameters:
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.

Returns:
the cycleID of the last used slot

Definition at line 172 of file RollingMultiplexingDataManager.h.

References currentId_.


Member Data Documentation


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1