3 #ifndef NDSTANGOINTERFACEIMPL_H
4 #define NDSTANGOINTERFACEIMPL_H
10 #include "nds3/impl/interfaceBaseImpl.h"
24 class TangoInterfaceImpl:
public InterfaceBaseImpl
27 TangoInterfaceImpl(
const std::string& portName, NdsDevice* pDevice);
29 virtual void registerPV(std::shared_ptr<PVBaseImpl> pv);
30 virtual void deregisterPV(std::shared_ptr<PVBaseImpl> pv);
32 virtual void registrationTerminated();
34 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::int8_t& value);
35 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::uint8_t& value);
36 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::int32_t& value);
37 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::uint32_t& value);
38 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const double& value);
39 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::vector<std::int8_t> & value);
40 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::vector<std::uint8_t> & value);
41 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::vector<std::int32_t> & value);
42 virtual void push(std::shared_ptr<PVBaseImpl> pv,
const timespec& timestamp,
const std::vector<double> & value);
54 class NdsDeviceClass:
public Tango::DeviceClass
60 virtual void command_factory();
61 virtual void attribute_factory(vector<Tango::Attr*>& attributes);
62 virtual void device_factory(
const Tango::DevVarStringArray* dev_list);
78 class NdsDevice:
public TANGO_BASE_CLASS
81 NdsDevice(Tango::DeviceClass* pClass,
string &name);
84 virtual void init_device();
86 virtual void delete_device();
88 void setRootNode(std::shared_ptr<NodeImpl> pRootNode);
90 virtual Tango::DevState get_state();
93 Tango::DeviceClass* m_pClass;
94 std::string m_parameter;
95 std::shared_ptr<NodeImpl> m_pRootNode;
106 class NdsAttributeBase
115 static timeval NDSTimeToTangoTime(
const timespec& time);
122 static timespec TangoTimeToNDSTime(
const timeval& time);
125 NdsAttributeBase(std::shared_ptr<PVBaseImpl> pv);
127 void setAttributeProperties(Tango::Attr& attr);
129 std::shared_ptr<PVBaseImpl> m_pPV;
138 template <
typename ndsType_t,
typename tangoType_t>
139 class NdsAttributeScalar:
public NdsAttributeBase,
public Tango::Attr
142 NdsAttributeScalar(
const std::string& name, std::shared_ptr<PVBaseImpl> pPV, Tango::CmdArgType dataType, Tango::AttrWriteType writeType);
144 virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att);
145 virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att);
146 virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty);
157 template <
typename ndsType_t,
typename tangoType_t>
158 class NdsAttributeSpectrum:
public NdsAttributeBase,
public Tango::SpectrumAttr
161 NdsAttributeSpectrum(
const std::string& name, std::shared_ptr<PVBaseImpl> pPV, Tango::CmdArgType dataType, Tango::AttrWriteType writeType,
size_t maxLength);
163 virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att);
164 virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att);
165 virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty);
168 std::vector<tangoType_t> m_value;
227 #endif // NDSTANGOINTERFACEIMPL_H
std::function< void(void *)> deallocateDriver_t
Definition for the function executed to deallocate a driver.
Definition: definitions.h:244
std::function< void *(Factory &factory, const std::string &deviceName, const namedParameters_t ¶meters)> allocateDriver_t
Definition for the function executed to allocate a driver.
Definition: definitions.h:224