NDS3
1.0.0
API reference manual
|
This is the base class for objects that interact with specific control systems and has to be allocated only once (singletons).
In order to create support for a control system you need to overwrite this class and InterfaceBaseImpl.
The FactoryBaseImpl derived object will be created when NDS starts and will stay alive until NDS is shutdown.
The overwritten classes must implement the following methods:
Optionally, the method createThread() can also be overwritten.
#include <factoryBaseImpl.h>
Inherits enable_shared_from_this< FactoryBaseImpl >.
Public Member Functions | |
virtual void | preDelete () |
This function is called before the destructor is invoked. More... | |
void * | createDevice (const std::string &driverName, const std::string &deviceName, const namedParameters_t ¶meters) |
Allocate a device. The device driver must have been registered via registerDriver() or must have been loaded from the folder defined in the enviroment variables LD_LIBRARY_PATH or NDS_DEVICES. More... | |
void | destroyDevice (void *pDevice) |
Deallocate an allocated device. More... | |
const std::string & | getSeparator (const std::uint32_t nodeLevel) const |
Returns the separator to use between the node names. More... | |
virtual InterfaceBaseImpl * | getNewInterface (const std::string &fullName)=0 |
This method is called by a PortNodeImpl object in order to create a named connection with the control system. More... | |
virtual void | registerCommand (const BaseImpl &node, const std::string &command, const std::string &usage, const size_t numParameters, command_t commandFunction)=0 |
Called to register a command tied to a specific node. More... | |
virtual void | deregisterCommand (const BaseImpl &node)=0 |
Called to deregister a node from all the NDS commands. More... | |
void* nds::FactoryBaseImpl::createDevice | ( | const std::string & | driverName, |
const std::string & | deviceName, | ||
const namedParameters_t & | parameters | ||
) |
Allocate a device. The device driver must have been registered via registerDriver() or must have been loaded from the folder defined in the enviroment variables LD_LIBRARY_PATH or NDS_DEVICES.
driverName | |
deviceName | |
parameters |
|
pure virtual |
Called to deregister a node from all the NDS commands.
The NDS framework guarantees that there are no multi-threading concurrency issues when calling this function.
node | to node from which the command has to be removed |
void nds::FactoryBaseImpl::destroyDevice | ( | void * | pDevice | ) |
Deallocate an allocated device.
pDevice |
|
pure virtual |
This method is called by a PortNodeImpl object in order to create a named connection with the control system.
fullName | the full name of the PortNodeImpl |
const std::string& nds::FactoryBaseImpl::getSeparator | ( | const std::uint32_t | nodeLevel | ) | const |
Returns the separator to use between the node names.
Considers the naming rules set via setNamingRules(). If the naming rules don't define a separator then passes the request to getDefaultSeparator().
nodeLevel | the node level for which the separator is required. The level 0 is the separator inserted righ before the root node name. |
|
virtual |
This function is called before the destructor is invoked.
It takes care of de-initializing all the PVs while the control system is still up and running.
|
pure virtual |
Called to register a command tied to a specific node.
The NDS framework guarantees that there are no multi-threading concurrency issues when calling this function.
node | the node to which the command has to be tied |
command | the command |
usage | command's description |
numParameters | the number of accepted parameters |
commandFunction | the delegate function to call to execute the command |