ChimeraTK-DeviceAccess 03.20.00
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChimeraTK::async::VariableDistributor< SourceType > Class Template Reference

#include <VariableDistributor.h>

+ Inheritance diagram for ChimeraTK::async::VariableDistributor< SourceType >:
+ Collaboration diagram for ChimeraTK::async::VariableDistributor< SourceType >:

Public Member Functions

 VariableDistributor (boost::shared_ptr< DeviceBackend > backend, boost::shared_ptr< SubDomain< SourceType > > parent, boost::shared_ptr< Domain > asyncDomain)
 
template<typename UserType >
std::unique_ptr< AsyncVariablecreateAsyncVariable (AccessorInstanceDescriptor const &descriptor)
 
std::unique_ptr< AsyncVariablecreateAsyncVariable (AccessorInstanceDescriptor const &)
 
- Public Member Functions inherited from ChimeraTK::async::SourceTypedAsyncAccessorManager< SourceType >
VersionNumber distribute (SourceType, VersionNumber version)
 Distribute the given data to the subsribers.
 
virtual bool prepareIntermediateBuffers ()
 Implement this function in case there is a step between setting the source buffer and filling the user buffers.
 
 AsyncAccessorManager (boost::shared_ptr< DeviceBackend > backend, boost::shared_ptr< Domain > asyncDomain)
 
- Public Member Functions inherited from ChimeraTK::async::AsyncAccessorManager
 AsyncAccessorManager (boost::shared_ptr< DeviceBackend > backend, boost::shared_ptr< Domain > asyncDomain)
 
virtual ~AsyncAccessorManager ()=default
 
template<typename UserType >
boost::shared_ptr< AsyncNDRegisterAccessor< UserType > > subscribe (RegisterPath name, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
 Request a new subscription.
 
void unsubscribe (TransferElementID id)
 This function must only be called from the destructor of the AsyncNDRegisterAccessor which is created in the subscribe function!
 
void sendException (const std::exception_ptr &e)
 Send an exception to all accessors.
 

Public Attributes

boost::shared_ptr< SubDomain< SourceType > > _parent
 

Additional Inherited Members

- Protected Member Functions inherited from ChimeraTK::async::AsyncAccessorManager
 DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE (createAsyncVariable, std::unique_ptr< AsyncVariable >(AccessorInstanceDescriptor const &))
 
virtual void asyncVariableMapChanged (TransferElementID)
 This virtual function lets derived classes react on subscribe / unsubscribe.
 
void unsubscribeImpl (TransferElementID id)
 Internal helper function to avoid code duplication.
 
- Protected Attributes inherited from ChimeraTK::async::SourceTypedAsyncAccessorManager< SourceType >
SourceType _sourceBuffer
 
VersionNumber _version {nullptr}
 
- Protected Attributes inherited from ChimeraTK::async::AsyncAccessorManager
std::map< TransferElementID, std::unique_ptr< AsyncVariable > > _asyncVariables
 
boost::shared_ptr< DeviceBackend_backend
 
boost::shared_ptr< Domain_asyncDomain
 
std::list< TransferElementID_delayedUnsubscriptions
 If an unsubscription request is coming in while iterating the _asyncVariables container, we have to remember it and do it afterwards.
 
- Static Protected Attributes inherited from ChimeraTK::async::AsyncAccessorManager
static thread_local AsyncAccessorManager_isHoldingDomainLock {nullptr}
 We have to remember that we are holding the domain lock before we lock a weak pointer to an AsyncNDRegisterAccessor inside the AsyncVariable to resolve a race conditon: If all other owners go out of scope while we are distributing data or exceptions, releasing the weak pointer will call unsubscribe().
 

Detailed Description

template<typename SourceType>
class ChimeraTK::async::VariableDistributor< SourceType >

Definition at line 13 of file VariableDistributor.h.

Constructor & Destructor Documentation

◆ VariableDistributor()

template<typename SourceType >
ChimeraTK::async::VariableDistributor< SourceType >::VariableDistributor ( boost::shared_ptr< DeviceBackend backend,
boost::shared_ptr< SubDomain< SourceType > >  parent,
boost::shared_ptr< Domain asyncDomain 
)

Definition at line 61 of file VariableDistributor.h.

Member Function Documentation

◆ createAsyncVariable() [1/2]

std::unique_ptr< AsyncVariable > ChimeraTK::async::VariableDistributor< std::nullptr_t >::createAsyncVariable ( AccessorInstanceDescriptor const &  )

Definition at line 72 of file VariableDistributor.h.

◆ createAsyncVariable() [2/2]

template<typename SourceType >
template<typename UserType >
std::unique_ptr< AsyncVariable > ChimeraTK::async::VariableDistributor< SourceType >::createAsyncVariable ( AccessorInstanceDescriptor const &  descriptor)

Member Data Documentation

◆ _parent

template<typename SourceType >
boost::shared_ptr<SubDomain<SourceType> > ChimeraTK::async::VariableDistributor< SourceType >::_parent

Definition at line 21 of file VariableDistributor.h.


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