10 #ifndef NDS3_DEFINITIONS_H
11 #define NDS3_DEFINITIONS_H
142 #define ndsLogStream(node, logLevel) \
143 if(!(node).isLogLevelEnabled(logLevel)) {} else (node).getLogger(logLevel)
157 #define ndsDebugStream(node) ndsLogStream(node, nds::logLevel_t::debug)
171 #define ndsInfoStream(node) ndsLogStream(node, nds::logLevel_t::info)
185 #define ndsWarningStream(node) ndsLogStream(node, nds::logLevel_t::warning)
199 #define ndsErrorStream(node) ndsLogStream(node, nds::logLevel_t::error)
216 typedef std::function<parameters_t (const parameters_t& parameters)>
command_t;
236 typedef std::function<void*(Factory& factory, const std::string& deviceName, const namedParameters_t& parameters)>
allocateDriver_t;
271 typedef std::function<bool (const state_t, const state_t, const state_t)>
allowChange_t;
281 typedef std::function<void ()> threadFunction_t;
300 #define NDS_DEFINE_DRIVER(driverName, className)\
303 void* allocateDevice(nds::Factory& factory, const std::string& device, const nds::namedParameters_t& parameters) \
305 return new className(factory, device, parameters); \
307 void deallocateDevice(void* device) \
309 delete (className*)device; \
311 const char* getDeviceName() \
313 return #driverName; \
315 nds::RegisterDevice<className> registerDevice##driverName(#driverName); \
319 #if defined _WIN32 || defined __CYGWIN__
320 #define NDS3_HELPER_DLL_IMPORT __declspec(dllimport)
321 #define NDS3_HELPER_DLL_EXPORT __declspec(dllexport)
324 #define NDS3_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
325 #define NDS3_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
327 #define NDS3_HELPER_DLL_IMPORT
328 #define NDS3_HELPER_DLL_EXPORT
335 #ifdef NDS3_DLL // defined if NDS3 is compiled as a DLL
336 #ifdef NDS3_DLL_EXPORTS // defined if we are building the NDS3 DLL (instead of using it)
337 #define NDS3_API NDS3_HELPER_DLL_EXPORT
339 #define NDS3_API NDS3_HELPER_DLL_IMPORT
340 #endif // NDS3_DLL_EXPORTS
341 #else // NDS3_DLL is not defined: this means NDS3 is a static lib.
345 #endif // NDS3_DEFINITIONS_H
scanType_t
Specify how to get the PV value.
Definition: definitions.h:68
The PV is used to change the local state of a state machine.
The device is switched on.
Array of signed 32 bit integers.
The device server pushes the value to the control system when it changes.
The PV is used to retrieve the local state of a state machine.
An error caused the device to go to FAULT mode.
Non critical information.
Array of unsigned 8 bit integers.
The data is being written by the control system and read by the device support.
std::function< void(void *)> deallocateDriver_t
Definition for the function executed to deallocate a driver.
Definition: definitions.h:244
The node contains a PV that receives pushed data.
std::function< timespec()> getTimestampPlugin_t
Definition for a function called to retrieve a time.
Definition: definitions.h:279
std::function< void *(Factory &factory, const std::string &deviceName, const namedParameters_t ¶meters)> allocateDriver_t
Definition for the function executed to allocate a driver.
Definition: definitions.h:224
The device is switched off.
nodeType_t
Defines the nodes' roles in the tree structure: it is used to build the node's external name when usi...
Definition: definitions.h:103
logLevel_t
Defines the severities of the log information.
Definition: definitions.h:80
std::function< parameters_t(const parameters_t ¶meters)> command_t
Definition of a function called to execute a node's command.
Definition: definitions.h:216
The device is switched on and is starting the operations.
outputPvType_t
Defines an output PV's role: this information is used to build the PV's external name when using the ...
Definition: definitions.h:130
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.
Definition: definitions.h:271
The node contains mainly input PVs.
std::function< void()> stateChange_t
Definition for the function executed during the state transition.
Definition: definitions.h:254
std::list< std::string > enumerationStrings_t
List of strings used for enumeration in PVs that support the enumeration field.
Definition: definitions.h:288
The device is switched off but is in the process of switching on.
The data is being written by the device support and read by the control system.
The PV is used to retrieve the global state.
dataDirection_t
Defines in which direction the data is being transferred.
Definition: definitions.h:92
The node implements a state machine.
std::map< std::string, std::string > namedParameters_t
Map containing named parameters passed to the device during the initialization.
Definition: definitions.h:222
The node contains mainly output PVs.
The node contains a PV that pushes acquired data.
The control system polls the value only when needed.
std::vector< std::string > parameters_t
List of strings passed as parameters to nodes' commands.
Definition: definitions.h:204
dataType_t
PV data types.
Definition: definitions.h:53
The control system polls the value with a specified frequency.
state_t
Available states, ordered by priority (lowest to higher).
Definition: definitions.h:36
The device is acquiring data but is in the process of stopping the operations.
Array of signed 8 bit integers.
Communicates with a static instance of the control system.
Definition: factory.h:43
The device is switched on but is in the process of switching off.
Indicate the number of states in the enumeration.
inputPvType_t
Defines an input PV's role: this information is used to build the PV's external name when using the N...
Definition: definitions.h:118