12#include "../MetaInstruments/DigitalIn.h"
15#include "NetworkDigitalIn.grpc.pb.h"
19 template <
typename... gRPCServices>
20 class NetworkDigitalInT;
22 template <
typename... gRPCServices>
40 template <
typename... gRPCServices>
47 virtual const char*
GetParamClassTag() const noexcept
override {
return "NetworkDigitalInParams"; }
56 template <
typename... gRPCServices>
70 template <
typename... gRPCServices>
79 constexpr static auto Name() noexcept {
return "Network Digital In"; }
85 virtual std::string
GetName()
const override {
return Name(); }
89 :
public gRPCModule<gRPCServices...>::template TypedCallDataBase<CallDataGetAsync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage>
91 using Base =
gRPCModule<gRPCServices...>::template TypedCallDataBase<CallDataGetAsync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage>;
92 using Base::ResponseMessage;
96 : Base::TypedCallDataBase(OwningModule, &ThisServiceType::AsyncService::RequestGetAsync) {}
104 ResponseMessage.set_value(
static_cast<bool>(
ModuleData->GetDigitalIn()->Get()));
109 :
public gRPCModule<gRPCServices...>::template TypedCallDataBase<CallDataGetSync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage>
111 using Base =
gRPCModule<gRPCServices...>::template TypedCallDataBase<CallDataGetSync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage>;
112 using Base::ResponseMessage;
116 : Base::TypedCallDataBase(OwningModule, &DynExpProto::NetworkDigitalIn::NetworkDigitalIn::AsyncService::RequestGetSync) {}
124 ResponseMessage.set_value(
static_cast<bool>(
ModuleData->GetDigitalIn()->GetSync()));
138 CallDataGetAsync::MakeCall(
this, Instance);
139 CallDataGetSync::MakeCall(
this, Instance);
Implementation of a gRPC server module to provide remote access to a data stream instrument meta inst...
Implementation of the data stream meta instrument, which is a base class for all instruments reading/...
Meta instrument for a single digital input port based on the data stream and generic input port meta ...
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
virtual ~NetworkDigitalInConfigurator()=default
NetworkDigitalInConfigurator()=default
virtual void ResetImpl(DynExp::ModuleDataBase::dispatch_tag< NetworkDigitalInData >)
virtual ~NetworkDigitalInData()=default
void ResetImpl(DynExp::ModuleDataBase::dispatch_tag< NetworkDataStreamInstrumentData< gRPCServices... > >) override final
virtual ~NetworkDigitalInParams()=default
DynExp::ParamsBase::DummyParam Dummy
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
NetworkDigitalInParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(DynExp::ParamsBase::dispatch_tag< NetworkDataStreamInstrumentParams< gRPCServices... > >) override final
virtual void ConfigureParamsImpl(DynExp::ParamsBase::dispatch_tag< NetworkDigitalInParams >)
gRPCModule< gRPCServices... >::template TypedCallDataBase< CallDataGetAsync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage > Base
virtual ~CallDataGetAsync()=default
virtual void ProcessChildImpl(DynExp::ModuleInstance &Instance) override
CallDataGetAsync(const gRPCModule< gRPCServices... > *const OwningModule) noexcept
virtual ~CallDataGetSync()=default
gRPCModule< gRPCServices... >::template TypedCallDataBase< CallDataGetSync, ThisServiceType, DynExpProto::Common::VoidMessage, DynExpProto::NetworkDigitalIn::SampleMessage > Base
virtual void ProcessChildImpl(DynExp::ModuleInstance &Instance) override
CallDataGetSync(const gRPCModule< gRPCServices... > *const OwningModule) noexcept
DynExpProto::NetworkDigitalIn::NetworkDigitalIn ThisServiceType
virtual std::string GetName() const override
Returns the name of this Object type.
virtual void ValidateInstrType(const DynExpInstr::DataStreamInstrument *Instr) const override
virtual void ResetImpl(DynExp::Object::dispatch_tag< NetworkDigitalInT >)
NetworkDigitalInT(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
virtual void CreateInitialCallDataObjectsImpl(DynExp::Object::dispatch_tag< NetworkDigitalInT >, DynExp::ModuleInstance &Instance) const
static constexpr auto Name() noexcept
void CreateInitialCallDataObjectsImpl(DynExp::Object::dispatch_tag< NetworkDataStreamInstrumentT< gRPCServices... > >, DynExp::ModuleInstance &Instance) const override final
virtual ~NetworkDigitalInT()=default
void ResetImpl(DynExp::Object::dispatch_tag< NetworkDataStreamInstrumentT< gRPCServices... > >) override final
Module template for building gRPC servers listening on TCP sockets for network instruments to connect...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
const std::unique_ptr< ModuleDataType > ModuleData
Module data belonging to this ModuleBase instance.
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a ModuleBase instance. Refer to RunnableInstance.
const ModuleBase::ModuleDataGetterType ModuleDataGetter
Getter for module's data. Refer to ModuleBase::ModuleDataGetterType.
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
Refer to ParamsBase::dispatch_tag.
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
const DynExpCore & Core
Reference to DynExp's core.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
DynExp's module namespace contains the implementation of DynExp modules which extend DynExp's core fu...
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
size_t ItemIDType
ID type of objects/items managed by DynExp.
Accumulates include statements to provide a precompiled header.