fesa-core  7.0.0
fesa::CycleDescriptor Class Reference

This class provides an interface to retrieve the cycles ids and names depending on the timing domain. Since the timing Domain is lab specific, a child class inside the lab package implements most of the methods. More...

#include <CycleDescriptor.h>

Inherited by fesa::NoneContextCycleDescriptor.

Public Member Functions

virtual ~CycleDescriptor ()
 Destructor.
 
virtual const std::vector
< int32_t > & 
getCycleIdsCol () const
 Returns the ID-Collection of this cycle descriptor. Implementation can be done per lab, if default method is not sufficient. More...
 
virtual const std::map
< std::string, int32_t > & 
getCycleSelectorCol () const
 Returns the collection of cycle selectors Implementation can be done per lab, if default method is not sufficient. More...
 
virtual const std::map
< std::string, Selector > & 
getCycleSelectors () const
 
virtual int32_t getCycleSelectorId (const std::string &cycleSelectorName) const
 returns the SelectorID of the corresponding cycleSelector. Implementation can be done per lab, if default method is not sufficient. More...
 
virtual const std::string getCycleSelectorName (int32_t cycleSelectorID)
 returns the SelectorName of the corresponding cycleSelectorID. Implementation can be done per lab, if default method is not sufficient. More...
 
virtual const Selector & getCycleSelector (const std::string &selectorName) const
 
virtual bool isValidCycleSelector (const std::string &cycleSelectorName) const
 Checks, if the passed timing selector is valid. Implementation can be done per lab, if the default is not sufficient. More...
 
virtual bool isRealCycleSelector (const std::string &cycleSelectorName) const
 Checks if the given cycle selector represents a real cycle selector A real cycle selector represents a real cycle (e.g. "PSB.USER.TOF"), as opposed to a cycle selector which represents something else (e.g. an empty name meaning any cycle). This method must be called with a cycle selector name known to this CycleDescriptor, that is, returned by getCycleSelectorName() or one of the keys of the map returned by getCycleSelectorCol(). The default implementation returns false for an empty cycleSelectorName, true otherwise. More...
 
virtual bool isSingleSlot () const
 
const std::string & getTimingDomain () const
 
const std::string & getTimingCriterion () const
 
const std::string & getName () const
 

Static Public Member Functions

static const std::string buildCycleDescriptorName (const std::string &timingDomain, const std::string &timingCriterion)
 

Protected Member Functions

 CycleDescriptor (const std::string &timingDomain, const std::string &multiplexingCriterion)
 Constructor. More...
 
virtual int32_t addSelector (const std::string &value, int32_t timingId)
 method to safely add Selectors (only possible at startup!!!) The selector that will be added is DOMAIN.CRITERION.VALUE, with DOMAIN and CRITERION fixed by this object's values of timingDomain_ and timingCriterion_. More...
 

Protected Attributes

std::string timingDomain_
 timing domain
 
std::string timingCriterion_
 multiplexing criterion
 
std::string name_
 internal name of the timing descriptor
 
std::vector< int32_t > cycleIdsCol_
 collection of generated cycle-ids.
 
std::map< std::string, int32_t > cycleSelectorCol_
 
std::map< std::string, Selector > cycleSelectors_
 
Mutex cycleSelectorColMutex_
 mutex to protect the cycle ids and names
 

Detailed Description

This class provides an interface to retrieve the cycles ids and names depending on the timing domain. Since the timing Domain is lab specific, a child class inside the lab package implements most of the methods.

Constructor & Destructor Documentation

fesa::CycleDescriptor::CycleDescriptor ( const std::string &  timingDomain,
const std::string &  multiplexingCriterion 
)
protected

Constructor.

Parameters
timingDomaintiming domain of the timing descriptor
multiplexingCriterionof the timing descriptor

Member Function Documentation

int32_t fesa::CycleDescriptor::addSelector ( const std::string &  value,
int32_t  timingId 
)
protectedvirtual

method to safely add Selectors (only possible at startup!!!) The selector that will be added is DOMAIN.CRITERION.VALUE, with DOMAIN and CRITERION fixed by this object's values of timingDomain_ and timingCriterion_.

Parameters
valueThe value part of the new selector, e.g. SFTPRO for PSB.USER.SFTPRO
timingIdThe timing ID of the selector (independent of FESA). If unavailable, use NOT_A_SELECTOR.
Returns
the ID of the selector
const std::string fesa::CycleDescriptor::buildCycleDescriptorName ( const std::string &  timingDomain,
const std::string &  timingCriterion 
)
static

Returns the name of the CycleDescriptor based on the given argument

Returns
name of the CycleDescriptor
const std::vector< int32_t > & fesa::CycleDescriptor::getCycleIdsCol ( ) const
virtual

Returns the ID-Collection of this cycle descriptor. Implementation can be done per lab, if default method is not sufficient.

Returns
map of IDs of this cycle descriptor
const Selector & fesa::CycleDescriptor::getCycleSelector ( const std::string &  selectorName) const
virtual

Returns the Selector object of this descriptor that corresponds to selectorName.

Exceptions
FesaExceptionif no such cycle selector exists within this descriptor.
const std::map< std::string, int32_t > & fesa::CycleDescriptor::getCycleSelectorCol ( ) const
virtual

Returns the collection of cycle selectors Implementation can be done per lab, if default method is not sufficient.

Deprecated:
Use getCycleSelectors() instead.
Returns
map of cycleSelectorName and slot numbers (artificial cycleID) of this cycle descriptor
int32_t fesa::CycleDescriptor::getCycleSelectorId ( const std::string &  cycleSelectorName) const
virtual

returns the SelectorID of the corresponding cycleSelector. Implementation can be done per lab, if default method is not sufficient.

Parameters
cycleSelectorNamethe name of the requested cycleSelector
Returns
cycleSelector ID
Exceptions
FesaExceptionis thrown when no cycleSelector Name was found for this cycleSelector
const std::string fesa::CycleDescriptor::getCycleSelectorName ( int32_t  cycleSelectorID)
virtual

returns the SelectorName of the corresponding cycleSelectorID. Implementation can be done per lab, if default method is not sufficient.

Parameters
cycleSelectorIDthe ID of the requested cycleSelector
Returns
cycleSelectorName
Exceptions
FesaExceptionis thrown when no cycleSelector ID was found for this cycleSelector
const std::map< std::string, Selector > & fesa::CycleDescriptor::getCycleSelectors ( ) const
virtual

Returns the collection of cycle selectors of this descriptor. The returned object is a const reference to a map of selector names (string) to Selector objects. May be overridden for lab-specific implementations.

const std::string & fesa::CycleDescriptor::getName ( ) const
Returns
name of the timing descriptor
const std::string & fesa::CycleDescriptor::getTimingCriterion ( ) const
Returns
multiplexing criterion of the timing descriptor
const std::string & fesa::CycleDescriptor::getTimingDomain ( ) const
Returns
timing domain of the timing descriptor
bool fesa::CycleDescriptor::isRealCycleSelector ( const std::string &  cycleSelectorName) const
virtual

Checks if the given cycle selector represents a real cycle selector A real cycle selector represents a real cycle (e.g. "PSB.USER.TOF"), as opposed to a cycle selector which represents something else (e.g. an empty name meaning any cycle). This method must be called with a cycle selector name known to this CycleDescriptor, that is, returned by getCycleSelectorName() or one of the keys of the map returned by getCycleSelectorCol(). The default implementation returns false for an empty cycleSelectorName, true otherwise.

Parameters
cycleSelectorNamethe name of the cycle selector to check
Returns
true if the cycle selector represents a real cycle, false otherwise
bool fesa::CycleDescriptor::isSingleSlot ( ) const
virtual

Returns true if this CycleDescriptor contains only one user which is not a real cycle selector. If it is the case, it means that there is no real user in this CycleDescriptor, and it cannot be used for multiplexing.

bool fesa::CycleDescriptor::isValidCycleSelector ( const std::string &  cycleSelectorName) const
virtual

Checks, if the passed timing selector is valid. Implementation can be done per lab, if the default is not sufficient.

Parameters
cycleSelectorNameThe name of the selector to check
Returns
true, if valid

Member Data Documentation

std::map<std::string, int32_t> fesa::CycleDescriptor::cycleSelectorCol_
protected

Map of cycle-selector-names to their generated cycle ids.

std::map<std::string, Selector> fesa::CycleDescriptor::cycleSelectors_
protected

Map of cycle selector names to Selector objects.


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