NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nds::PVVariableOutImpl< T > Class Template Reference

Detailed Description

template<typename T>
class nds::PVVariableOutImpl< T >

Implementation of an output PV object that also stores the value so it does not need to delegate the read and write functions.

Template Parameters
Tthe PV data type. The following data types are supported:
  • std::int32_t
  • std::double
  • std::vector<std::int8_t>
  • std::vector<std::uint8_t>
  • std::vector<std::int32_t>
  • std::vector<double>
  • std::string

#include <pvVariableOutImpl.h>

Inheritance diagram for nds::PVVariableOutImpl< T >:
nds::PVBaseOutImpl nds::PVBaseImpl

Public Member Functions

 PVVariableOutImpl (const std::string &name, const outputPvType_t pvType=outputPvType_t::generic)
 Constructor. More...
 
virtual void read (timespec *pTimestamp, T *pValue) const
 Called when the control system wants to read a value from the PV. More...
 
virtual void write (const timespec &timestamp, const T &value)
 Called when the control system wants to write a value into the PV. More...
 
virtual dataType_t getDataType () const
 Return the data type of the PV. More...
 
getValue () const
 Call to retrieve the value stored in the PV. More...
 
void getValue (timespec *pTime, T *pValue) const
 Retrieve the value and the timestamp stored in the PV. More...
 
- Public Member Functions inherited from nds::PVBaseOutImpl
 PVBaseOutImpl (const std::string &name, const outputPvType_t pvType)
 Constructor. More...
 
void subscribeTo (const std::string &inputPVName)
 Subscribe the PV to another input PV. More...
 
virtual void initialize (FactoryBaseImpl &controlSystem)
 Register the PV with the control system. More...
 
virtual void deinitialize ()
 Deregister the PV from the control system.
 
virtual void read (timespec *pTimestamp, std::int32_t *pValue) const
 Called when the control system wants to read the value. More...
 
virtual void write (const timespec &timestamp, const std::int32_t &value)
 Called when the control system wants to write a value. More...
 
virtual dataDirection_t getDataDirection () const
 Retrieve the data direction. More...
 
- Public Member Functions inherited from nds::PVBaseImpl
void setDescription (const std::string &description)
 Set the PV description. More...
 
void setUnits (const std::string &units)
 Set the engineering units associated with the PV. More...
 
void setScanType (const scanType_t scanType, const double periodSeconds)
 Set the scan type. More...
 
void setMaxElements (const size_t maxElements)
 Set the maximum number of elements if the data type is an array. More...
 
void setEnumeration (const enumerationStrings_t &enumerations)
 Assign enumeration strings to the PV. More...
 
void processAtInit (const bool bProcessAtInit)
 Specifies if the PV has to be processed during the initialization. More...
 
const std::string & getDescription () const
 Return the PV's description. More...
 
const std::string & getUnits () const
 Return the PV's engineering units. More...
 
scanType_t getScanType () const
 Return the scan type. More...
 
double getScanPeriodSeconds () const
 Return the scan period in seconds. More...
 
size_t getMaxElements () const
 Return the maximum number of elements that can be stored in the array (if the PV data type is an array). More...
 
const enumerationStrings_tgetEnumerations () const
 Return the list of string used to enumerate the integer values. More...
 
bool getProcessAtInit () const
 Return true if the PV has to bve processed during the initialization of the device. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from nds::PVBaseImpl
template<typename T >
static dataType_t getDataTypeForCPPType ()
 Return the data type enumerator for the type in the template. More...
 
- Protected Attributes inherited from nds::PVBaseImpl
std::string m_description
 The PV's description.
 
std::string m_units
 Engineering units.
 
scanType_t m_scanType
 The PV's scan type.
 
double m_periodicScanSeconds
 The interval between data polling (in seconds).
 
size_t m_maxElements
 Maximum number of elements that can be stored in the PV.
 
enumerationStrings_t m_enumeration
 List of strings used for enumeration.
 
bool m_bProcessAtInit
 True if the PV has to be processed during the device initialization.
 

Constructor & Destructor Documentation

template<typename T >
nds::PVVariableOutImpl< T >::PVVariableOutImpl ( const std::string &  name,
const outputPvType_t  pvType = outputPvType_t::generic 
)

Constructor.

Parameters
namethe name of the PV

Member Function Documentation

template<typename T >
virtual dataType_t nds::PVVariableOutImpl< T >::getDataType ( ) const
virtual

Return the data type of the PV.

Returns
an enumeration representing the data type

Implements nds::PVBaseImpl.

template<typename T >
T nds::PVVariableOutImpl< T >::getValue ( ) const

Call to retrieve the value stored in the PV.

Returns
the value stored in the PV
template<typename T >
void nds::PVVariableOutImpl< T >::getValue ( timespec *  pTime,
T *  pValue 
) const

Retrieve the value and the timestamp stored in the PV.

Parameters
pTimethe timestamp stored in the PV
pValuethe value stored in the PV
template<typename T >
virtual void nds::PVVariableOutImpl< T >::read ( timespec *  pTimestamp,
T *  pValue 
) const
virtual

Called when the control system wants to read a value from the PV.

Parameters
pTimestamppointer to a variable that will be filled with the timestamp of the stored value
pValuepointer to a variable that will be filled with the stored value
template<typename T >
virtual void nds::PVVariableOutImpl< T >::write ( const timespec &  timestamp,
const T &  value 
)
virtual

Called when the control system wants to write a value into the PV.

Parameters
timestampthe timestamp to store in the PV
valuethe value to store in the PV

The documentation for this class was generated from the following files: