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

Meta instrument template for transforming meta instruments into network instruments, which connect to TCP sockets of gRPC servers. Derive from this class to build a network instrument based on a meta instrument. The network instrument connects to a corresponding server implemented with the DynExpModule::gRPCModule gRPC server module. The server controls the physical instrument itself. The respective meta instrument is selected as a template parameter. This class derives from the instrument. It is possible to use DynExp::InstrumentBase as the meta instrument to design network instruments, which allow accessing gRPC services directly. More...

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

Public Types

using ParamsType = gRPCInstrumentParams< BaseInstr, 0, gRPCStubs... >
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = gRPCInstrumentConfigurator< BaseInstr, 0, gRPCStubs... >
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = gRPCInstrumentData< BaseInstr, 0, gRPCStubs... >
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 

Public Member Functions

virtual ~gRPCInstrument ()
 
virtual std::string GetName () const override
 Returns the name of this Object type. More...
 
virtual std::string GetCategory () const override
 Returns the category of this Object type. More...
 

Static Public Member Functions

constexpr static auto Name () noexcept
 Every derived class has to redefine this function. More...
 
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 

Protected Member Functions

 gRPCInstrument (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 

Private Member Functions

void ResetImpl (DynExp::Object::dispatch_tag< BaseInstr >) override final
 Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from DynExp::Object, descending the inheritance hierarchy. More...
 
virtual void ResetImpl (DynExp::Object::dispatch_tag< gRPCInstrument >)
 Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from DynExp::Object, descending the inheritance hierarchy. More...
 
virtual std::unique_ptr< DynExp::InitTaskBaseMakeInitTask () const override
 Factory function for an init task (InitTaskBase). Override to define the desired initialization task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 
virtual std::unique_ptr< DynExp::ExitTaskBaseMakeExitTask () const override
 Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 
virtual std::unique_ptr< DynExp::UpdateTaskBaseMakeUpdateTask () const override
 Factory function for an update task (UpdateTaskBase). Override to define the desired update task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 

Detailed Description

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

Meta instrument template for transforming meta instruments into network instruments, which connect to TCP sockets of gRPC servers. Derive from this class to build a network instrument based on a meta instrument. The network instrument connects to a corresponding server implemented with the DynExpModule::gRPCModule gRPC server module. The server controls the physical instrument itself. The respective meta instrument is selected as a template parameter. This class derives from the instrument. It is possible to use DynExp::InstrumentBase as the meta instrument to design network instruments, which allow accessing gRPC services directly.

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 292 of file gRPCInstrument.h.

Member Typedef Documentation

◆ ConfigType

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
using DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::ConfigType = gRPCInstrumentConfigurator<BaseInstr, 0, gRPCStubs...>

Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object.

Definition at line 296 of file gRPCInstrument.h.

◆ InstrumentDataType

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
using DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::InstrumentDataType = gRPCInstrumentData<BaseInstr, 0, gRPCStubs...>

Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase.

Definition at line 297 of file gRPCInstrument.h.

◆ ParamsType

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
using DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::ParamsType = gRPCInstrumentParams<BaseInstr, 0, gRPCStubs...>

Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object.

Definition at line 295 of file gRPCInstrument.h.

Constructor & Destructor Documentation

◆ gRPCInstrument()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::gRPCInstrument ( const std::thread::id  OwnerThreadID,
DynExp::ParamsBasePtrType &&  Params 
)
inlineprotected

Constructs an instrument instance.

Parameters
OwnerThreadIDThread id of the thread owning the Object instance to be constructed.
ParamsParameter class instance to be assigned to the Object instance to be constructed.
Exceptions
Util::InvalidArgExceptionis thrown if OwnerThreadID is an invalid thread id or if Params is nullptr.
Util::InvalidArgExceptionis thrown if InstrumentParamsBase::InstrumentData of Params is nullptr.

Definition at line 306 of file gRPCInstrument.h.

◆ ~gRPCInstrument()

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

Definition at line 310 of file gRPCInstrument.h.

Member Function Documentation

◆ Category()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
constexpr static auto DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::Category ( )
inlinestaticconstexprnoexcept

Every derived class has to redefine this function.

Returns
Returns the category of this instrument type.

Definition at line 300 of file gRPCInstrument.h.

◆ GetCategory()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual std::string DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::GetCategory ( ) const
inlineoverridevirtual

Returns the category of this Object type.

Definition at line 313 of file gRPCInstrument.h.

◆ GetName()

◆ MakeExitTask()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual std::unique_ptr<DynExp::ExitTaskBase> DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::MakeExitTask ( ) const
inlineoverrideprivatevirtual

◆ MakeInitTask()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual std::unique_ptr<DynExp::InitTaskBase> DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::MakeInitTask ( ) const
inlineoverrideprivatevirtual

◆ MakeUpdateTask()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
virtual std::unique_ptr<DynExp::UpdateTaskBase> DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::MakeUpdateTask ( ) const
inlineoverrideprivatevirtual

◆ Name()

template<typename BaseInstr , typename std::enable_if_t< std::is_base_of_v< DynExp::InstrumentBase, BaseInstr >, int > , typename... gRPCStubs>
constexpr static auto DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::Name ( )
inlinestaticconstexprnoexcept

Every derived class has to redefine this function.

Returns
Returns the name of this DynExp object type.

Definition at line 299 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>
void DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::ResetImpl ( DynExp::Object::dispatch_tag< BaseInstr >  )
inlinefinaloverrideprivate

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

Definition at line 319 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>
virtual void DynExpInstr::gRPCInstrument< BaseInstr,, gRPCStubs >::ResetImpl ( DynExp::Object::dispatch_tag< gRPCInstrument< BaseInstr,, gRPCStubs > >  )
inlineprivatevirtual

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

Reimplemented in DynExpInstr::WidefieldLocalization.

Definition at line 324 of file gRPCInstrument.h.


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