DUECA/DUSIME
|
The accessToken objects are used in conjunction with the channel system. More...
#include <GenericToken.hxx>
Public Member Functions | |
const GlobalId & | getTokenHolder () const |
Return the ID of the owner. | |
const GlobalId & | getChannelId () const |
Return the ID of the channel. | |
const NameSet & | getName () const |
Return the local name specified for the token. | |
const std::string & | getDataClassName () const |
Return the data class name. | |
uint32_t | getDataClassMagic () const |
Access the data class magic. | |
virtual | ~GenericToken () |
Destructor. | |
GenericToken (const GlobalId &holder, const NameSet &name, const std::string &dataclassname) | |
Constructor. | |
virtual bool | isValid ()=0 |
Returns true if the token is valid (and can thus be used). | |
template<class MFT > | |
std::weak_ptr< MFT > | getMetaFunctor (const std::string &fname) const |
Obtain a specific metafunctor for interaction with channel data. | |
Public Member Functions inherited from dueca::TriggerPuller | |
const std::string & | getTriggerName () const |
Find a name. | |
Protected Member Functions | |
void | checkChannelEndPresent () const |
Check preconditions. | |
Protected Member Functions inherited from dueca::TriggerPuller | |
void | pull (const DataTimeSpec &ts) |
activate and notify the targets | |
TriggerPuller (const std::string &name=std::string()) | |
Constructor. | |
virtual | ~TriggerPuller () |
Destructor. | |
virtual void | addTarget (const boost::intrusive_ptr< TriggerTarget > &target, unsigned id) |
Add a target to this puller, only called by TriggerTarget's setTrigger. | |
virtual void | removeTarget (const TriggerTarget *target) |
Remove a target from the puller, only called by destructor. | |
virtual void | setTriggerName () |
Update the name, used by ConditionAnd and ConditionOr. | |
Protected Attributes | |
std::string | dataclassname |
name of the data type | |
const DataSetConverter * | converter |
Converter for the data. | |
uint32_t | magic_number |
magic number for the data class name claimed here | |
UnifiedChannel * | channel |
pointer to the channel | |
Protected Attributes inherited from dueca::TriggerPuller | |
targetlist_type | targets |
List of targets and indices. | |
std::bitset< MAX_MANAGERS > | activitylevels |
Index of activitymanager levels. | |
std::string | name |
Name, for debugging purposes. | |
Additional Inherited Members | |
Protected Types inherited from dueca::TriggerPuller | |
typedef list< TargetData > | targetlist_type |
Combination of a target, someone to pull if requested, and the index that target needs to identify this puller. | |
The accessToken objects are used in conjunction with the channel system.
When a component requests access to a channel, an accessToken is created and returned to the component.
For the component, the accessToken acts as a key. Using the accessToken on the channel, access to the data on the channel can be got.
For the channel, the accessToken acts as an identifier. It contains the sequence number of the component, as used in the channel object, and a GlobalId of the component. These are used for accounting purposes
dueca::GenericToken::GenericToken | ( | const GlobalId & | holder, |
const NameSet & | name, | ||
const std::string & | dataclassname ) |
Constructor.
Creates an access point to a channel.
holder | Identification of the creating client |
name | Name of the channel to connect to |
dataclassname | Type of data to be written/read. |
Returns true if the token is valid (and can thus be used).
Note that tokens have to be checked before use.
Implemented in dueca::ChannelReadToken, and dueca::ChannelWriteToken.
Obtain a specific metafunctor for interaction with channel data.
Interaction with channel data – e.g., reading – can be done in several ways. The "normal" mode is having access to the data class and using a DataReader. If you don't have, or don't want to, program code that uses a specific data class, typically for generic modules, you can use functors. The functionality for the functor must be coded for the DCO object, examples are stuff like "convert this DCO object into JSON". Look up the description in dueca::DCOMetaFunctor for more details. This call returns a weak reference to a meta-functor that can be used to create functors. A created functor can then be used wih the applyFunctor call. The "right" functor, for the specific data type accessed by this read token, is automatically selected.
fname | Functor type name |
UndefinedFunctor | If there is no metafunctor of the specified type |
FunctorTypeMismatch | If the metafunctor cannot be cast to the requested type |