NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pvDelegateInImpl.h
1 /*
2  * Nominal Device Support v3 (NDS3)
3  *
4  * Copyright (c) 2015 Cosylab d.d.
5  *
6  * For more information about the license please refer to the license.txt
7  * file included in the distribution.
8  */
9 
10 #ifndef NDSDELEGATEPVINIMPL_H
11 #define NDSDELEGATEPVINIMPL_H
12 
13 #include "nds3/definitions.h"
14 #include "nds3/impl/pvBaseInImpl.h"
15 
16 namespace nds
17 {
18 
32 template <typename T>
34 {
35 public:
43  typedef std::function<void (timespec*, T*)> read_t;
44 
51  PVDelegateInImpl(const std::string& name, read_t readFunction, const inputPvType_t pvType = inputPvType_t::generic);
52 
61  virtual void read(timespec* pTimestamp, T* pValue) const;
62 
68  virtual dataType_t getDataType() const;
69 
70 
71 private:
72  read_t m_reader;
73 
74 };
75 
76 }
77 #endif // NDSDELEGATEPVINIMPL_H
78 
virtual void read(timespec *pTimestamp, T *pValue) const
Called when the control system wants to read a value.
virtual dataType_t getDataType() const
Return the PV's data type.
std::function< void(timespec *, T *)> read_t
Definition of the method used to read the value.
Definition: pvDelegateInImpl.h:43
The node's role is not specified.
Defines all the enumeration and common types used across the NDS library.
PVDelegateInImpl(const std::string &name, read_t readFunction, const inputPvType_t pvType=inputPvType_t::generic)
Constructor for read-only PVs. Specifies the method used for reading the value.
Base class for all the PVs.
Definition: pvBaseInImpl.h:29
Delegating Input PV. Delegates the read operation to an user defined function.
Definition: pvDelegateInImpl.h:33
dataType_t
PV data types.
Definition: definitions.h:53
inputPvType_t
Defines an input PV's role: this information is used to build the PV's external name when using the N...
Definition: definitions.h:118