NDS3  1.0.0
API reference manual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
definitions.h File Reference

Defines all the enumeration and common types used across the NDS library. More...

#include <cstdint>
#include <functional>
#include <time.h>
#include <string>
#include <list>
#include <vector>
#include <map>

Go to the source code of this file.

Namespaces

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

Macros

#define ndsLogStream(node, logLevel)   if(!(node).isLogLevelEnabled(logLevel)) {} else (node).getLogger(logLevel)
 If the logging is enabled for the specified severity level then the macro returns the proper logging stream, otherwise it skips the logging operation.
 
#define ndsDebugStream(node)   ndsLogStream(node, nds::logLevel_t::debug)
 Log to the debug stream if the debug log level is enabled on the selected node. More...
 
#define ndsInfoStream(node)   ndsLogStream(node, nds::logLevel_t::info)
 Log to the info stream if the info log level is enabled on the selected node. More...
 
#define ndsWarningStream(node)   ndsLogStream(node, nds::logLevel_t::warning)
 Log to the warning stream if the warning log level is enabled on the selected node. More...
 
#define ndsErrorStream(node)   ndsLogStream(node, nds::logLevel_t::error)
 Log to the error stream if the error log level is enabled on the selected node. More...
 
#define NDS_DEFINE_DRIVER(driverName, className)
 Defines the global functions that are called by NDS when the device class needs to be allocated. More...
 

Typedefs

typedef std::vector< std::string > nds::parameters_t
 List of strings passed as parameters to nodes' commands.
 
typedef std::function
< parameters_t(const
parameters_t &parameters)> 
nds::command_t
 Definition of a function called to execute a node's command. More...
 
typedef std::map< std::string,
std::string > 
nds::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)> 
nds::allocateDriver_t
 Definition for the function executed to allocate a driver. More...
 
typedef std::function< void(void *)> nds::deallocateDriver_t
 Definition for the function executed to deallocate a driver. More...
 
typedef std::function< void()> nds::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)> 
nds::allowChange_t
 Definition for a function called to allow or deny a state transition. More...
 
typedef std::function< timespec()> nds::getTimestampPlugin_t
 Definition for a function called to retrieve a time. More...
 
typedef std::list< std::string > nds::enumerationStrings_t
 List of strings used for enumeration in PVs that support the enumeration field.
 

Enumerations

enum  nds::state_t {
  nds::state_t::unknown, nds::state_t::off, nds::state_t::switchingOff, nds::state_t::initializing,
  nds::state_t::on, nds::state_t::stopping, nds::state_t::starting, nds::state_t::running,
  nds::state_t::fault, nds::state_t::MAX_STATE_NUM
}
 Available states, ordered by priority (lowest to higher). More...
 
enum  nds::dataType_t {
  nds::dataType_t::dataInt32 = 1, nds::dataType_t::dataFloat64, nds::dataType_t::dataInt8Array, nds::dataType_t::dataUint8Array,
  nds::dataType_t::dataInt32Array, nds::dataType_t::dataFloat64Array, nds::dataType_t::dataString
}
 PV data types. More...
 
enum  nds::scanType_t { nds::scanType_t::periodic, nds::scanType_t::passive, nds::scanType_t::interrupt }
 Specify how to get the PV value. More...
 
enum  nds::logLevel_t : std::uint8_t {
  nds::logLevel_t::debug, nds::logLevel_t::info, nds::logLevel_t::warning, nds::logLevel_t::error,
  nds::logLevel_t::none
}
 Defines the severities of the log information. More...
 
enum  nds::dataDirection_t { nds::dataDirection_t::input, nds::dataDirection_t::output }
 Defines in which direction the data is being transferred. More...
 
enum  nds::nodeType_t {
  nds::nodeType_t::generic, nds::nodeType_t::inputChannel, nds::nodeType_t::outputChannel, nds::nodeType_t::dataSourceChannel,
  nds::nodeType_t::dataSinkChannel, nds::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  nds::inputPvType_t { nds::inputPvType_t::generic, nds::inputPvType_t::getLocalState, nds::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  nds::outputPvType_t { nds::outputPvType_t::generic, nds::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

Defines all the enumeration and common types used across the NDS library.

Include nds.h instead of this one, since nds3.h takes care of including all the necessary header files (including this one).

Macro Definition Documentation

#define NDS_DEFINE_DRIVER (   driverName,
  className 
)
Value:
extern "C" \
{ \
void* allocateDevice(nds::Factory& factory, const std::string& device, const nds::namedParameters_t& parameters) \
{ \
return new className(factory, device, parameters); \
} \
void deallocateDevice(void* device) \
{ \
delete (className*)device; \
} \
const char* getDeviceName() \
{ \
return #driverName; \
} \
nds::RegisterDevice<className> registerDevice##driverName(#driverName); \
}
std::map< std::string, std::string > namedParameters_t
Map containing named parameters passed to the device during the initialization.
Definition: definitions.h:222
Communicates with a static instance of the control system.
Definition: factory.h:43

Defines the global functions that are called by NDS when the device class needs to be allocated.

Parameters
driverNamea token that specifies the driver name (input has to be valid c symbol name)
classNamethe name of the class that implements the driver
Examples:
oscilloscope/oscilloscope.cpp, oscilloscopeMultiChannel/oscilloscopeMultiChannel.cpp, rpcSquare/rpcSquare.cpp, and thermometer/thermometer.cpp.