NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pvDelegateOut.h
Go to the documentation of this file.
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 NDSPVDELEGATEOUT_H
11 #define NDSPVDELEGATEOUT_H
12 
23 #include "nds3/definitions.h"
24 #include "nds3/pvBaseOut.h"
25 
26 #ifndef SWIG // PVDelegate will not be present in SWIG generated files
27 
28 namespace nds
29 {
30 
52 template <typename T>
53 class NDS3_API PVDelegateOut: public PVBaseOut
54 {
55 protected:
56  PVDelegateOut();
57 
58 public:
67  typedef std::function<void (timespec*, T*)> initValue_t;
68 
73  typedef std::function<void (const timespec&, const T&)> write_t;
74 
86  PVDelegateOut(const std::string& name, write_t writeFunction, initValue_t initValueFunction);
87 
95  PVDelegateOut(const std::string& name, write_t writeFunction);
96 
97 #ifndef SWIG
98 private:
99  initValue_t m_initializer;
100  write_t m_writer;
101 #endif
102 };
103 
104 }
105 
106 #endif // SWIG
107 #endif // NDSPVDELEGATEIN_H
std::function< void(timespec *, T *)> initValue_t
Definition of the method used to read the initial PV value.
Definition: pvDelegateOut.h:67
Represents an output PV.
Definition: pvBaseOut.h:35
Defines the base class for the output PVs.
An output PV that delegates the read and write operations to two external functions.
Definition: pvDelegateOut.h:53
Defines all the enumeration and common types used across the NDS library.
std::function< void(const timespec &, const T &)> write_t
Definition of the method used to write.
Definition: pvDelegateOut.h:73