NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pvVariableInImpl.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 NDSPVVARIABLEINIMPL_H
11 #define NDSPVVARIABLEINIMPL_H
12 
13 #include <mutex>
14 #include "nds3/impl/pvBaseInImpl.h"
15 
16 namespace nds
17 {
18 
33 template <typename T>
34 class NDS3_API PVVariableInImpl: public PVBaseInImpl
35 {
36 public:
42  PVVariableInImpl(const std::string& name, const inputPvType_t pvType = inputPvType_t::generic);
43 
50  virtual void read(timespec* pTimestamp, T* pValue) const;
51 
57  virtual dataType_t getDataType() const;
58 
67  void setValue(const T& value);
68 
78  void setValue(const timespec& timestamp, const T& value);
79 
80 private:
81  T m_value;
82  timespec m_timestamp;
83 
84  mutable std::mutex m_pvMutex;
85 
86 };
87 
88 }
89 #endif // NDSPVVARIABLEINIMPL_H
The node's role is not specified.
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