DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs > Class Template Reference

Data class for gRPCInstrument. More...

+ Inheritance diagram for DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >:

Public Member Functions

template<typename... ArgTs>
 gRPCInstrumentData (ArgTs &&...Args)
 Constructs a gRPCInstrumentData instance and forwards all arguments passed to the constructor to the constructor of the instrument data type of BaseInstr. More...
 
virtual ~gRPCInstrumentData ()=default
 
template<size_t Index>
auto GetStub () const noexcept
 Returns a stub pointer this gRPCInstrument uses selected by the stub index in the gRPCStubs list of gRPCInstrument. More...
 
template<typename T >
auto GetStub () const noexcept
 Returns a stub pointer this gRPCInstrument uses selected by the stub type T. More...
 

Private Member Functions

void ResetStubPtrs ()
 Sets all pointers contained in StubPtrs to nullptr. More...
 
void ResetImpl (DynExp::InstrumentDataBase::dispatch_tag< typename BaseInstr::InstrumentDataType >) override final
 Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from InstrumentDataBase, descending the inheritance hierarchy. Override in order to reset derived classes. More...
 
virtual void ResetImpl (DynExp::InstrumentDataBase::dispatch_tag< gRPCInstrumentData >)
 Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from InstrumentDataBase, descending the inheritance hierarchy. Override in order to reset derived classes. More...
 

Private Attributes

std::tuple< StubPtrType< gRPCStubs >... > StubPtrs
 Tuple of pointers to all the stubs this gRPCInstrument uses. More...
 

Friends

class gRPCInstrumentTasks::InitTask< BaseInstr, 0, gRPCStubs... >
 
class gRPCInstrumentTasks::ExitTask< BaseInstr, 0, gRPCStubs... >
 

Detailed Description

template<typename BaseInstr, typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int >, typename... gRPCStubs>
class DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >

Data class for gRPCInstrument.

Template Parameters
BaseInstrMeta instrument this class derives from.
enable_if_tInternal check whether BaseInstr is derived from DynExp::InstrumentBase. Pass 0.
...gRPCStubsgRPC stub types which this gRPC client expects from the server to be provided. The order of stub types should match the order of service types in the gRPCServices list of the respective DynExpModule::gRPCModule gRPC server.

Definition at line 150 of file gRPCInstrument.h.

Constructor & Destructor Documentation

◆ gRPCInstrumentData()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
template<typename... ArgTs>
DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::gRPCInstrumentData ( ArgTs &&...  Args)
inline

Constructs a gRPCInstrumentData instance and forwards all arguments passed to the constructor to the constructor of the instrument data type of BaseInstr.

Template Parameters
...ArgTsTypes of the arguments passed to the constructor
Parameters
...ArgsArguments to forward

Definition at line 163 of file gRPCInstrument.h.

◆ ~gRPCInstrumentData()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::~gRPCInstrumentData ( )
virtualdefault

Member Function Documentation

◆ GetStub() [1/2]

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
template<size_t Index>
auto DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::GetStub ( ) const
inlinenoexcept

Returns a stub pointer this gRPCInstrument uses selected by the stub index in the gRPCStubs list of gRPCInstrument.

Template Parameters
IndexIndex of the stub pointer to return
Returns
Element at position Index from StubPtrs

Definition at line 174 of file gRPCInstrument.h.

◆ GetStub() [2/2]

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
template<typename T >
auto DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::GetStub ( ) const
inlinenoexcept

Returns a stub pointer this gRPCInstrument uses selected by the stub type T.

Template Parameters
TType of the stub to return
Returns
Stub pointer of type StubPtrType pointing to the stub type T (as contained in StubPtrs)

Definition at line 183 of file gRPCInstrument.h.

◆ ResetImpl() [1/2]

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual void DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::ResetImpl ( DynExp::InstrumentDataBase::dispatch_tag< gRPCInstrumentData< BaseInstr,, gRPCStubs > >  )
inlineprivatevirtual

Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from InstrumentDataBase, descending the inheritance hierarchy. Override in order to reset derived classes.

Definition at line 204 of file gRPCInstrument.h.

◆ ResetImpl() [2/2]

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
void DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::ResetImpl ( DynExp::InstrumentDataBase::dispatch_tag< typename BaseInstr::InstrumentDataType >  )
inlinefinaloverrideprivate

Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from InstrumentDataBase, descending the inheritance hierarchy. Override in order to reset derived classes.

Definition at line 194 of file gRPCInstrument.h.

◆ ResetStubPtrs()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
void DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::ResetStubPtrs ( )
inlineprivate

Sets all pointers contained in StubPtrs to nullptr.

Definition at line 189 of file gRPCInstrument.h.

Friends And Related Function Documentation

◆ gRPCInstrumentTasks::ExitTask< BaseInstr, 0, gRPCStubs... >

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
friend class gRPCInstrumentTasks::ExitTask< BaseInstr, 0, gRPCStubs... >
friend

Definition at line 134 of file gRPCInstrument.h.

◆ gRPCInstrumentTasks::InitTask< BaseInstr, 0, gRPCStubs... >

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
friend class gRPCInstrumentTasks::InitTask< BaseInstr, 0, gRPCStubs... >
friend

Definition at line 134 of file gRPCInstrument.h.

Member Data Documentation

◆ StubPtrs

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
std::tuple<StubPtrType<gRPCStubs>...> DynExpInstr::gRPCInstrumentData< BaseInstr,, gRPCStubs >::StubPtrs
private

Tuple of pointers to all the stubs this gRPCInstrument uses.

Definition at line 209 of file gRPCInstrument.h.


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