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

Detailed Description

A node object that can contain other nodes or PVs as children.

Examples:
oscilloscopeMultiChannel/oscilloscopeMultiChannel.cpp.

#include <node.h>

Inheritance diagram for nds::Node:
nds::Base nds::DataAcquisition< T > nds::Port nds::StateMachine

Public Member Functions

 Node (const std::string &name, const nodeType_t nodeType=nodeType_t::generic)
 Construct the node. More...
 
template<class T >
addChild (T child)
 Add a child node or record to this node. This node will take ownership of the added one and will take care of deleting it. More...
 
void initialize (void *pDeviceObject, Factory &factory)
 Registers all the records with the control system. Call this from the root node which will take care of traversing its children and initialize them. More...
 
- Public Member Functions inherited from nds::Base
 Base (const Base &right)
 Copy constructor. The copy will refer to the same implementation object referenced in the copied object. More...
 
Baseoperator= (const Base &right)
 Copy operator. The copy will refer to the same implementation object referenced in the copied object. More...
 
void setExternalName (const std::string &externalName)
 Set the string to pass to the naming rules in order to build the full node name as seen by the control system. More...
 
virtual Port getPort ()
 Get the Node that communicate with the device (ASYN port on EPICS, Device on Tango). Query the parent nodes if necessary. More...
 
const std::string & getComponentName () const
 Return the node's name. More...
 
const std::string & getFullName () const
 Return the full node's name, prepending the parents' names if necessary (e.g. "ROOT-CHANNEL1-THISNODE") More...
 
const std::string & getFullExternalName () const
 Return the full node's name as seen by the control system clients. More...
 
const std::string & getFullNameFromPort () const
 Return the node's name as seen by the parent Port node (the node that communicates with the device). More...
 
timespec getTimestamp () const
 Get the current time. More...
 
void setTimestampDelegate (getTimestampPlugin_t timestampDelegate)
 Specify the delegate function to call to get the timestamp. More...
 
std::ostream & getLogger (const logLevel_t logLevel)
 Retrieve a logging stream for the specified log level. More...
 
bool isLogLevelEnabled (const logLevel_t logLevel) const
 Returns true if the logging for a particular severity level has been enabled. More...
 
void setLogLevel (const logLevel_t logLevel)
 Enable the logging for a particular severity level. More...
 
void defineCommand (const std::string &command, const std::string &usage, const size_t numParameters, const command_t function)
 Define a command specific for the node. More...
 
Thread runInThread (const std::string &name, threadFunction_t function)
 Create and run a thread using the control system facilities. More...
 
Thread runInThread (threadFunction_t function)
 Create and run a thread using the control system facilities. The created thread will have the node's name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from nds::Base
 Base ()
 Initializes an empty base class.
 

Constructor & Destructor Documentation

nds::Node::Node ( const std::string &  name,
const nodeType_t  nodeType = nodeType_t::generic 
)

Construct the node.

Parameters
namenode's name (e.g. "CHANNEL0" or "CHANNELGROUP1")
nodeTypespecifies the node's role. This information is used to calculate the external node name when the Naming rules naming rules are used.

Member Function Documentation

template<class T >
T nds::Node::addChild ( child)
inline

Add a child node or record to this node. This node will take ownership of the added one and will take care of deleting it.

Parameters
childthe child node to add
Returns
a reference to the added node
Examples:
oscilloscopeMultiChannel/oscilloscopeMultiChannel.cpp, and thermometer/thermometer.cpp.
void nds::Node::initialize ( void *  pDeviceObject,
Factory factory 
)

Registers all the records with the control system. Call this from the root node which will take care of traversing its children and initialize them.

Parameters
pDeviceObjectpointer to the device object
factorycontrol system with which the node must be registered
Examples:
thermometer/thermometer.cpp.

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