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

All the classes and methods defined by the NDS3 framework are in the namespace nds. More...

Classes

class  Base
 This is the base class for all the NDS3 public classes that declare a device part (node, port, PV, etc). More...
 
class  DataAcquisition
 
class  NdsError
 The base class for all the exceptions thrown by the library. More...
 
class  StateMachineError
 Base class for all the exceptions thrown by the StateMachine. More...
 
class  StateMachineRollBack
 The user implemented code should throw this exception from a state transition function to cause the state machine to roll back to the previous state. More...
 
class  StateMachineNoSuchTransition
 This exception is thrown by the StateMachine when a transition between 2 states cannot be executed because the transition does not exist. More...
 
class  StateMachineTransitionDenied
 This transition is thrown by the state machine when a delegated function reject the transition. More...
 
class  TimeConversionError
 This exception is thrown when there is an error in the conversion between the UNIX epoch and the EPICS epoch. More...
 
class  NoPortDefinedError
 This exception is thrown when there isn't any Port defined in the device structure. Without a Port there cannot be any communication with the control system. More...
 
class  FactoryError
 This is the base class for exceptions thrown by the NDS Factory. Usually it is thrown while allocating new control system structures. More...
 
class  DirectoryNotFoundError
 This exception is thrown when the folder being scanned for control system modules does not exist. More...
 
class  DriverNotFound
 This exception is thrown while creating a device when the requested device driver cannot be located. More...
 
class  DriverAlreadyRegistered
 This exception is thrown when a driver with the same name has already been registered. More...
 
class  DriverDoesNotExportRegistrationFunctions
 This exception is thrown when a loaded shared module containing a NDS device does not contain the export functions (see NDS_DEFINE_DRIVER) More...
 
class  Factory
 Communicates with a static instance of the control system. More...
 
class  PVVariableInImpl
 Implementation of an input PV object that also stores the value so it does not need to delegate the read function. More...
 
class  PVVariableOutImpl
 Implementation of an output PV object that also stores the value so it does not need to delegate the read and write functions. More...
 
class  FactoryBaseImpl
 This is the base class for objects that interact with specific control systems and has to be allocated only once (singletons). More...
 
class  InterfaceBaseImpl
 Represents the interface between NDS and the control system API. More...
 
class  NodeImpl
 Represents a node (channel or channelGroup in the old NDS) which can contain other nodes. More...
 
class  PortImpl
 Node that holds an ASYN port. More...
 
class  PVActionImpl
 Action PV. Delegates the read/write user defined functions and set the value back to the control system. More...
 
class  PVBaseImpl
 Base class for all the PVs. More...
 
class  PVBaseInImpl
 Base class for all the PVs. More...
 
class  PVBaseOutImpl
 Base class for all the output PVs. More...
 
class  PVDelegateInImpl
 Delegating Input PV. Delegates the read operation to an user defined function. More...
 
class  PVDelegateOutImpl
 Delegating Output PV. Delegates the read/write user defined functions. More...
 
class  StateMachineImpl
 Implements the state machine. More...
 
class  IniFileParser
 Parses an INI file and stores all the found sections and keys for future retrieval via getString(). More...
 
class  Node
 A node object that can contain other nodes or PVs as children. More...
 
class  Port
 Represents a node with direct connection with the controlled device. More...
 
class  PVAction
 An output PV that delegates the read and write operations to two external functions. More...
 
class  PVBase
 Base class for objects that process a single PV (or attribute in Tango parlance). More...
 
class  PVBaseIn
 Represents an input PV. More...
 
class  PVBaseOut
 Represents an output PV. More...
 
class  PVDelegateIn
 An input PV that delegates the read operation to an external function. More...
 
class  PVDelegateOut
 An output PV that delegates the read and write operations to two external functions. More...
 
class  PVVariableIn
 An input PV object that also stores the value so it does not need to delegate the read function. More...
 
class  PVVariableOut
 An output PV object that also stores the value so it does not need to delegate the read and write functions. More...
 
class  RegisterDevice
 This is a class intended to be used as a static class for automatic registering of device supports. More...
 
class  StateMachine
 Represents a state machine to be attached to a node. More...
 
class  Thread
 Represents a thread. More...
 

Typedefs

typedef std::vector< std::string > parameters_t
 List of strings passed as parameters to nodes' commands.
 
typedef std::function
< parameters_t(const
parameters_t &parameters)> 
command_t
 Definition of a function called to execute a node's command. More...
 
typedef std::map< std::string,
std::string > 
namedParameters_t
 Map containing named parameters passed to the device during the initialization.
 
typedef std::function< void
*(Factory &factory, const
std::string &deviceName, const
namedParameters_t &parameters)> 
allocateDriver_t
 Definition for the function executed to allocate a driver. More...
 
typedef std::function< void(void *)> deallocateDriver_t
 Definition for the function executed to deallocate a driver. More...
 
typedef std::function< void()> stateChange_t
 Definition for the function executed during the state transition. More...
 
typedef std::function< bool(const
state_t, const state_t, const
state_t)> 
allowChange_t
 Definition for a function called to allow or deny a state transition. More...
 
typedef std::function< timespec()> getTimestampPlugin_t
 Definition for a function called to retrieve a time. More...
 
typedef std::list< std::string > enumerationStrings_t
 List of strings used for enumeration in PVs that support the enumeration field.
 

Enumerations

enum  state_t {
  state_t::unknown, state_t::off, state_t::switchingOff, state_t::initializing,
  state_t::on, state_t::stopping, state_t::starting, state_t::running,
  state_t::fault, state_t::MAX_STATE_NUM
}
 Available states, ordered by priority (lowest to higher). More...
 
enum  dataType_t {
  dataType_t::dataInt32 = 1, dataType_t::dataFloat64, dataType_t::dataInt8Array, dataType_t::dataUint8Array,
  dataType_t::dataInt32Array, dataType_t::dataFloat64Array, dataType_t::dataString
}
 PV data types. More...
 
enum  scanType_t { scanType_t::periodic, scanType_t::passive, scanType_t::interrupt }
 Specify how to get the PV value. More...
 
enum  logLevel_t : std::uint8_t {
  logLevel_t::debug, logLevel_t::info, logLevel_t::warning, logLevel_t::error,
  logLevel_t::none
}
 Defines the severities of the log information. More...
 
enum  dataDirection_t { dataDirection_t::input, dataDirection_t::output }
 Defines in which direction the data is being transferred. More...
 
enum  nodeType_t {
  nodeType_t::generic, nodeType_t::inputChannel, nodeType_t::outputChannel, nodeType_t::dataSourceChannel,
  nodeType_t::dataSinkChannel, nodeType_t::stateMachine
}
 Defines the nodes' roles in the tree structure: it is used to build the node's external name when using the Naming rules. More...
 
enum  inputPvType_t { inputPvType_t::generic, inputPvType_t::getLocalState, inputPvType_t::getGlobalState }
 Defines an input PV's role: this information is used to build the PV's external name when using the Naming rules. More...
 
enum  outputPvType_t { outputPvType_t::generic, outputPvType_t::setLocalState }
 Defines an output PV's role: this information is used to build the PV's external name when using the Naming rules. More...
 

Detailed Description

All the classes and methods defined by the NDS3 framework are in the namespace nds.

Typedef Documentation

typedef std::function<void*(Factory& factory, const std::string& deviceName, const namedParameters_t& parameters)> nds::allocateDriver_t

Definition for the function executed to allocate a driver.

Returns a pointer to the allocated driver: the pointer will be passed to the function defined by deallocateDriver_t.

The allocation delegate should create the device and call initialize() on its root nodes.

typedef std::function<bool (const state_t, const state_t, const state_t)> nds::allowChange_t

Definition for a function called to allow or deny a state transition.

The function receives 3 parameters:

  • the first one represents the current state
  • the secont one represents the current global state
  • the last one represents the desidered state

The function must return true if the transition from the current state to the desidered state is allowed, or false otherwise.

This function is called only after the state machine has verified that the requested transition is legal.

typedef std::function<parameters_t (const parameters_t& parameters)> nds::command_t

Definition of a function called to execute a node's command.

It receives a vector of string parameters. It is the responsability of the delegate function to convert the strings to the appropriate data types.

The number of parameters is verified by NDS before calling the delegate function.

typedef std::function<void (void*)> nds::deallocateDriver_t

Definition for the function executed to deallocate a driver.

Takes a pointer to the allocated driver.

typedef std::function<timespec ()> nds::getTimestampPlugin_t

Definition for a function called to retrieve a time.

The function should return the UNIX epoch (seconds and nanoseconds).

typedef std::function<void ()> nds::stateChange_t

Definition for the function executed during the state transition.

An exception thrown during a state transition will cause the StateMachine to switch to the state_t::fault state, unless the exception StateMachineRollBack is thrown which cause a rollback to the previous state.

Enumeration Type Documentation

enum nds::dataDirection_t
strong

Defines in which direction the data is being transferred.

Enumerator
input 

The data is being written by the control system and read by the device support.

output 

The data is being written by the device support and read by the control system.

enum nds::dataType_t
strong

PV data types.

Enumerator
dataInt32 

Signed integer, 32 bits.

dataFloat64 

Float, 64 bits.

dataInt8Array 

Array of signed 8 bit integers.

dataUint8Array 

Array of unsigned 8 bit integers.

dataInt32Array 

Array of signed 32 bit integers.

dataFloat64Array 

Array of 64 bit floats.

dataString 

String.

enum nds::scanType_t
strong

Specify how to get the PV value.

Enumerator
periodic 

The control system polls the value with a specified frequency.

passive 

The control system polls the value only when needed.

interrupt 

The device server pushes the value to the control system when it changes.

enum nds::state_t
strong

Available states, ordered by priority (lowest to higher).

Enumerator
unknown 

The state is Unknown.

off 

The device is switched off.

switchingOff 

The device is switched on but is in the process of switching off.

initializing 

The device is switched off but is in the process of switching on.

on 

The device is switched on.

stopping 

The device is acquiring data but is in the process of stopping the operations.

starting 

The device is switched on and is starting the operations.

running 

The device is operating.

fault 

An error caused the device to go to FAULT mode.

MAX_STATE_NUM 

Indicate the number of states in the enumeration.