NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nds::PVActionImpl Class Reference

Detailed Description

Action PV. Delegates the read/write user defined functions and set the value back to the control system.

#include <pvActionImpl.h>

Inheritance diagram for nds::PVActionImpl:
nds::PVBaseOutImpl nds::PVBaseImpl

Public Types

typedef std::function< void(timespec
*, std::int32_t *)> 
initValue_t
 Definition of the method used to read the initial value.
 
typedef std::function< void(const
timespec &, const std::int32_t &)> 
write_t
 Definition of the method used to write.
 

Public Member Functions

 PVActionImpl (const std::string &name, write_t writeFunction, initValue_t initValueFunction, const outputPvType_t pvType=outputPvType_t::generic)
 Constructor. Specifies the methods used for read/write. More...
 
 PVActionImpl (const std::string &name, write_t writeFunction, const outputPvType_t pvType=outputPvType_t::generic)
 Constructor. Specifies the method used to write. More...
 
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 dataType_t getDataType () const
 Returns the PV's data type. More...
 
void setValueBack (const timespec &timestamp, const std::int32_t &value)
 Called when wants to set a value back to the control system. More...
 
void setAcknowledgePV (PVBaseInImpl *pv)
 Set the related acknowledge 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 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

nds::PVActionImpl::PVActionImpl ( const std::string &  name,
write_t  writeFunction,
initValue_t  initValueFunction,
const outputPvType_t  pvType = outputPvType_t::generic 
)

Constructor. Specifies the methods used for read/write.

Parameters
namePV's name
readFunctionread method
writeFunctionwrite method
nds::PVActionImpl::PVActionImpl ( const std::string &  name,
write_t  writeFunction,
const outputPvType_t  pvType = outputPvType_t::generic 
)

Constructor. Specifies the method used to write.

The read method is not specified and does nothing if the control system tries to call it.

Parameters
namethe PV's name
writeFunctionwrite method

Member Function Documentation

virtual dataType_t nds::PVActionImpl::getDataType ( ) const
virtual

Returns the PV's data type.

Returns
the PV's data type

Implements nds::PVBaseImpl.

virtual void nds::PVActionImpl::read ( timespec *  pTimestamp,
std::int32_t *  pValue 
) const
virtual

Called when the control system wants to read the value.

Internally it calls the delegate read method.

Parameters
pTimestampa variable that will be filled with the correct timestamp
pValuea variable that will be filled with the correct value

Reimplemented from nds::PVBaseOutImpl.

void nds::PVActionImpl::setAcknowledgePV ( PVBaseInImpl pv)

Set the related acknowledge pv.

Parameters
pvthe related acknowledge pv
void nds::PVActionImpl::setValueBack ( const timespec &  timestamp,
const std::int32_t &  value 
)

Called when wants to set a value back to the control system.

Parameters
timestamptimestamp related to the new value
valuevalue to set back to the control system
virtual void nds::PVActionImpl::write ( const timespec &  timestamp,
const std::int32_t &  value 
)
virtual

Called when the control system wants to write a value.

Internally it calls the delegate write method.

Parameters
timestamptimestamp related to the new value
valuenew value for the PV

Reimplemented from nds::PVBaseOutImpl.


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