NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pvAction.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 NDSPVACTION_H
11 #define NDSPVACTION_H
12 
22 #include "nds3/definitions.h"
23 #include "nds3/pvBaseOut.h"
24 
25 #ifndef SWIG // PVAction will not be present in SWIG generated files
26 
27 namespace nds
28 {
29 
38 class NDS3_API PVAction: public PVBaseOut
39 {
40 public:
49  typedef std::function<void (timespec*, std::int32_t*)> initValue_t;
50 
55  typedef std::function<void (const timespec&, const std::int32_t&)> write_t;
56 
62  PVAction();
63 
75  PVAction(const std::string& name, write_t writeFunction, initValue_t initValueFunction);
76 
84  PVAction(const std::string& name, write_t writeFunction);
85 
92  void setValueBack(const timespec& timestamp, const std::int32_t& value);
93 
94 #ifndef SWIG
95 private:
96  initValue_t m_initializer;
97  write_t m_writer;
98 #endif
99 };
100 
101 }
102 
103 #endif // SWIG
104 #endif // NDSPVACTION_H
std::function< void(timespec *, std::int32_t *)> initValue_t
Definition of the method used to read the initial PV value.
Definition: pvAction.h:49
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: pvAction.h:38
Defines all the enumeration and common types used across the NDS library.
std::function< void(const timespec &, const std::int32_t &)> write_t
Definition of the method used to write.
Definition: pvAction.h:55