NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pvBaseOutImpl.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 NDSPVBASEOUTIMPL_H
11 #define NDSPVBASEOUTIMPL_H
12 
13 #include <string>
14 #include "nds3/definitions.h"
15 #include "nds3/impl/baseImpl.h"
16 #include "nds3/impl/pvBaseImpl.h"
17 
18 namespace nds
19 {
20 
21 class PVBase;
22 
27 {
28 public:
34  PVBaseOutImpl(const std::string& name, const outputPvType_t pvType);
35 
42  void subscribeTo(const std::string& inputPVName);
43 
44  virtual void initialize(FactoryBaseImpl& controlSystem);
45 
46  virtual void deinitialize();
47 
48  virtual void read(timespec* pTimestamp, std::int32_t* pValue) const;
49  virtual void read(timespec* pTimestamp, double* pValue) const;
50  virtual void read(timespec* pTimestamp, std::vector<std::int8_t>* pValue) const;
51  virtual void read(timespec* pTimestamp, std::vector<std::uint8_t>* pValue) const;
52  virtual void read(timespec* pTimestamp, std::vector<std::int32_t>* pValue) const;
53  virtual void read(timespec* pTimestamp, std::vector<double>* pValue) const;
54  virtual void read(timespec* pTimestamp, std::string* pValue) const;
55 
56  virtual void write(const timespec& timestamp, const std::int32_t& value);
57  virtual void write(const timespec& timestamp, const double& value);
58  virtual void write(const timespec& timestamp, const std::vector<std::int8_t>& value);
59  virtual void write(const timespec& timestamp, const std::vector<std::uint8_t>& value);
60  virtual void write(const timespec& timestamp, const std::vector<std::int32_t>& value);
61  virtual void write(const timespec& timestamp, const std::vector<double>& value);
62  virtual void write(const timespec& timestamp, const std::string& value);
63 
64  virtual dataDirection_t getDataDirection() const;
65 
66  virtual std::string buildFullExternalName(const FactoryBaseImpl& controlSystem) const;
67  virtual std::string buildFullExternalNameFromPort(const FactoryBaseImpl& controlSystem) const;
68 
69 protected:
70  std::string buildFullExternalName(const FactoryBaseImpl& controlSystem, const bool bStopAtPort) const;
71 
72  outputPvType_t m_pvType;
73 
74 private:
75 
76  parameters_t commandSubscribeTo(const parameters_t& parameters);
77 
78 };
79 
80 }
81 #endif // NDSPVBASEIMPL_H
virtual void write(const timespec &timestamp, const std::int32_t &value)
Called when the control system wants to write a value.
virtual void read(timespec *pTimestamp, std::int32_t *pValue) const
Called when the control system wants to read the value.
virtual void deinitialize()
Deregister the PV from the control system.
virtual void initialize(FactoryBaseImpl &controlSystem)
Register the PV with the control system.
This is the base class for objects that interact with specific control systems and has to be allocate...
Definition: factoryBaseImpl.h:51
Base class for all the PVs.
Definition: pvBaseImpl.h:25
outputPvType_t
Defines an output PV's role: this information is used to build the PV's external name when using the ...
Definition: definitions.h:130
virtual dataDirection_t getDataDirection() const
Retrieve the data direction.
Defines all the enumeration and common types used across the NDS library.
Base class for all the output PVs.
Definition: pvBaseOutImpl.h:26
void subscribeTo(const std::string &inputPVName)
Subscribe the PV to another input PV.
dataDirection_t
Defines in which direction the data is being transferred.
Definition: definitions.h:92
std::vector< std::string > parameters_t
List of strings passed as parameters to nodes' commands.
Definition: definitions.h:204
PVBaseOutImpl(const std::string &name, const outputPvType_t pvType)
Constructor.