fesa-core  4.2.0
fesa::AbstractMultiplexingManager Class Referenceabstract

This class is used to find the correct slot for a multiplexed field value using the virtual accelerator or the multiplexing context. More...

#include <AbstractMultiplexingManager.h>

Inheritance diagram for fesa::AbstractMultiplexingManager:
fesa::ExtendedMultiplexingManager fesa::MultiplexingManager fesa::RollingBufferMuxManager

Public Member Functions

virtual int32_t getDepth ()
 This method returns the depth of the multiplexing manager. More...
 
const std::string & getTimingDomain () const
 
virtual int32_t requireSlot (const MultiplexingContext &context)=0
 This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager. More...
 
virtual int32_t getSlot (const MultiplexingContext &context)
 This method returns the slot in which the required value is stored, according to the given multiplexing context.The method is implemented by the concrete multiplexing manager. More...
 
virtual int32_t getSlotByTimeStamp (timestamp_ns timeStamp)
 
virtual int32_t getClosestSlot (timestamp_ns timestamp)
 
virtual int32_t getClosestSlot (const std::string &cycleName, timestamp_ns timestamp)
 
virtual int32_t getSlotByCycleName (const std::string &cycleName)
 This method the last given cycleName set slot. More...
 
virtual ~AbstractMultiplexingManager ()
 Destructor.
 

Protected Member Functions

CycleDescriptorgetTimingDescriptor ()
 This method returns the timing descriptor of this multiplexing manager. More...
 
virtual
AbstractMultiplexingDataManager
getMultiplexingDataManager ()=0
 This method returns the MultiplexingDataManager of this multiplexing manager Is is implemented by each concrete MultiplexingManager. There is no attribute in the base class because each multiplexing manager requires a different type of services. In this way we avoid casting in the extended classes. More...
 
const std::string & getName ()
 This method returns the name of the multiplexing manager. More...
 
 AbstractMultiplexingManager (const std::string &name, CycleDescriptor *timingDescriptor)
 Constructor. More...
 
virtual int32_t getLastSlot (const std::string &cycleName)=0
 This method returns the slot in which the last value for the virtual accelerator passed by argument was stored. The method is implemented by the concrete multiplexing manager. More...
 
virtual int32_t requireSlot (const std::string &cycleName)=0
 This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager. More...
 
virtual int32_t requireSlot (int32_t cycleId)=0
 This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager. More...
 
virtual int32_t getLastSlot (int32_t cycleId)=0
 This method returns the slot in which the last value for the virtual accelerator passed by argument was stored. The method is implemented by the concrete multiplexing manager. More...
 

Static Protected Member Functions

static std::size_t getMemorySizeToAllocate ()
 This method retrieves the size to be allocated in heap or shared memory, regarding the collection of multiplexing managers. More...
 
static void mapMemory (char *pAddr, bool first)
 
static
AbstractMultiplexingManager
getMultiplexingManager (const std::string &name)
 This method retrieves the desired multiplexing manager. More...
 

Protected Attributes

std::string name_
 mutex that protects conditional variable newMsgCondVar_
 
CycleDescriptortimingDescriptor_
 a reference to the timing descriptor
 

Static Protected Attributes

static std::map< std::string,
AbstractMultiplexingManager * > 
managersCol_
 a map which contains pointers to all the multiplexing managers on the system
 

Detailed Description

This class is used to find the correct slot for a multiplexed field value using the virtual accelerator or the multiplexing context.

Constructor & Destructor Documentation

fesa::AbstractMultiplexingManager::AbstractMultiplexingManager ( const std::string &  name,
CycleDescriptor timingDescriptor 
)
protected

Constructor.

Parameters
nameof the multiplexing manager
timingDescriptorreference to the TimingDescriptor that will be used in the multiplexing manager

Member Function Documentation

int32_t fesa::AbstractMultiplexingManager::getClosestSlot ( timestamp_ns  timestamp)
inlinevirtual

Returns the slot closest to the given timestamp.

Parameters
timestampthe timestamp to look for

Reimplemented in fesa::RollingBufferMuxManager.

int32_t fesa::AbstractMultiplexingManager::getClosestSlot ( const std::string &  cycleName,
timestamp_ns  timestamp 
)
inlinevirtual

Returns the slot closest to the given timestamp whose cycle matches cycleName.

Parameters
cycleNamethe name of the cycle to look for
timestampthe timestamp to look for

Reimplemented in fesa::RollingBufferMuxManager.

int32_t fesa::AbstractMultiplexingManager::getDepth ( )
virtual

This method returns the depth of the multiplexing manager.

Returns
the depth of the multiplexing manager

Reimplemented in fesa::RollingBufferMuxManager, and fesa::ExtendedMultiplexingManager.

virtual int32_t fesa::AbstractMultiplexingManager::getLastSlot ( const std::string &  cycleName)
protectedpure virtual

This method returns the slot in which the last value for the virtual accelerator passed by argument was stored. The method is implemented by the concrete multiplexing manager.

Parameters
cycleNamethe name of teh cycle
Returns
the last slot used by the requested cycle

Implemented in fesa::ExtendedMultiplexingManager, fesa::RollingBufferMuxManager, and fesa::MultiplexingManager.

virtual int32_t fesa::AbstractMultiplexingManager::getLastSlot ( int32_t  cycleId)
protectedpure virtual

This method returns the slot in which the last value for the virtual accelerator passed by argument was stored. The method is implemented by the concrete multiplexing manager.

Parameters
cycleIdthe ID of the cycle for the requested slot
Returns
the last slot used by the requested cycle

Implemented in fesa::RollingBufferMuxManager, fesa::ExtendedMultiplexingManager, and fesa::MultiplexingManager.

std::size_t fesa::AbstractMultiplexingManager::getMemorySizeToAllocate ( )
staticprotected

This method retrieves the size to be allocated in heap or shared memory, regarding the collection of multiplexing managers.

Returns
the size to allocate
virtual AbstractMultiplexingDataManager* fesa::AbstractMultiplexingManager::getMultiplexingDataManager ( )
protectedpure virtual

This method returns the MultiplexingDataManager of this multiplexing manager Is is implemented by each concrete MultiplexingManager. There is no attribute in the base class because each multiplexing manager requires a different type of services. In this way we avoid casting in the extended classes.

Returns
the reference to the MultiplexingDataManager. Might be NULL

Implemented in fesa::ExtendedMultiplexingManager, fesa::RollingBufferMuxManager, and fesa::MultiplexingManager.

AbstractMultiplexingManager * fesa::AbstractMultiplexingManager::getMultiplexingManager ( const std::string &  name)
staticprotected

This method retrieves the desired multiplexing manager.

Parameters
nameThe name of the multiplexing manager
Returns
a pointer to the desired multiplexing manager, or NULL if not found
const std::string & fesa::AbstractMultiplexingManager::getName ( )
inlineprotected

This method returns the name of the multiplexing manager.

Returns
the name of the multiplexing manager
int32_t fesa::AbstractMultiplexingManager::getSlot ( const MultiplexingContext context)
inlinevirtual

This method returns the slot in which the required value is stored, according to the given multiplexing context.The method is implemented by the concrete multiplexing manager.

Parameters
contextthe multiplexing context for which a slot is requested
Returns
the slot where the data corresponding to the context is stored

Reimplemented in fesa::ExtendedMultiplexingManager, and fesa::MultiplexingManager.

int32_t fesa::AbstractMultiplexingManager::getSlotByCycleName ( const std::string &  cycleName)
inlinevirtual

This method the last given cycleName set slot.

Returns
The last cyclename slot.

Reimplemented in fesa::RollingBufferMuxManager.

int32_t fesa::AbstractMultiplexingManager::getSlotByTimeStamp ( timestamp_ns  timeStamp)
inlinevirtual

Returns the slot corresponding to timeStamp, or INVALID_SLOT if this feature is not supported by the concrete MultiplexingManager.

Exceptions
FesaExceptionif no slot is assigned timeStamp.

Reimplemented in fesa::RollingBufferMuxManager.

CycleDescriptor * fesa::AbstractMultiplexingManager::getTimingDescriptor ( )
inlineprotected

This method returns the timing descriptor of this multiplexing manager.

Returns
the reference to the timing descriptor
const std::string & fesa::AbstractMultiplexingManager::getTimingDomain ( ) const

Returns the timing domain associated to this multiplexing manager.

void fesa::AbstractMultiplexingManager::mapMemory ( char *  pAddr,
bool  first 
)
staticprotected

Maps shared fields to the memory pointed to by pAddr.

Parameters
pAddraddress where to map shared fields
firsttrue if this is the first process to map the shared fields
virtual int32_t fesa::AbstractMultiplexingManager::requireSlot ( const MultiplexingContext context)
pure virtual

This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager.

Parameters
contextthe multiplexing context for which a slot is requested
Returns
the slot where the data can be stored

Implemented in fesa::ExtendedMultiplexingManager, fesa::MultiplexingManager, and fesa::RollingBufferMuxManager.

virtual int32_t fesa::AbstractMultiplexingManager::requireSlot ( const std::string &  cycleName)
protectedpure virtual

This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager.

Parameters
cycleNamethe name of the cycle
Returns
the slot where data can be stored

Implemented in fesa::ExtendedMultiplexingManager, fesa::RollingBufferMuxManager, and fesa::MultiplexingManager.

virtual int32_t fesa::AbstractMultiplexingManager::requireSlot ( int32_t  cycleId)
protectedpure virtual

This method returns the next slot in which the value of a field will be stored. The method is implemented by the concrete multiplexing manager.

Parameters
cycleIdthe ID of the cycle for the requested slot
Returns
the slot where data can be stored

Implemented in fesa::ExtendedMultiplexingManager, fesa::RollingBufferMuxManager, and fesa::MultiplexingManager.


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