UA Server SDK C++ Bundle
1.3.3.206
|
Main OPC Server object. More...
#include <opcserver.h>
Public Member Functions | |
OpcServer () | |
Construction. More... | |
~OpcServer () | |
Destruction. More... | |
int | setServerConfig (const UaString &configurationFile, const UaString &applicationPath) |
Sets the server configuration by passing the path of the configuration file. More... | |
int | setServerConfig (ServerConfig *pServerConfig) |
Sets the server configuration by passing a server configuration object. More... | |
int | addNodeManager (NodeManager *pNodeManager) |
Adds a node manager to the SDK. More... | |
int | setCallback (OpcServerCallback *pOpcServerCallback) |
Sets the callback interface for the server object. More... | |
int | start () |
Starts the OPC server Initializes and starts up all NodeManagers and SDK modules. More... | |
int | stop (OpcUa_Int32 secondsTillShutdown, const UaLocalizedText &shutdownReason) |
Stopps the OPC server Shutdown and deletes all SDK modules and NodeManagers. More... | |
NodeManagerConfig * | getDefaultNodeManager () |
Returns the default node manager for server specific nodes in namespace one. More... | |
Main OPC Server object.
This class is a utility class managing all server SDK modules for common use cases in a simplified way. Enhanced users may replace this class with their own implementation to be able to use derived classes to overwrite SDK functionality.
OpcServer::OpcServer | ( | ) |
Construction.
OpcServer::~OpcServer | ( | ) |
Destruction.
int OpcServer::addNodeManager | ( | NodeManager * | pNodeManager | ) |
Adds a node manager to the SDK.
The node manager will be managed by this class including starting, stopping and deletion of the node manager. The method can be called several times for a list of node managers. If the method is called before start, all node managers will be started during the call of the start method. If this method is called if the server is already started the node manager will be started by this method.
NodeManagerConfig * OpcServer::getDefaultNodeManager | ( | ) |
Returns the default node manager for server specific nodes in namespace one.
This node manager can be used to create objects and variables for data access. It can not be used for enhanced OPC UA features. Usind features like events, methods and historical access requires the implementation of a specific node manager.
int OpcServer::setCallback | ( | OpcServerCallback * | pOpcServerCallback | ) |
Sets the callback interface for the server object.
This callback interface needs to be implemented if the application wants to implement user authentication.
pOpcServerCallback | Interface pointer of the callback interface. |
int OpcServer::setServerConfig | ( | const UaString & | configurationFile, |
const UaString & | applicationPath | ||
) |
Sets the server configuration by passing the path of the configuration file.
One of the overloaded methods needs to be called to give the server a valid configuration.
This version forces the server to use the default implementation for the ServerConfig object and allows to specify the configuraiton file and the path to the application or the directory containing the configuration and the PKI store..
configurationFile | Path and file name of the configuration file. The file can be one of the two file formats supported by the SDK, a XML file format and an INI file format. The XML file format requires linking of the XML parser module and needs to be activated by compiling this class with the compiler switch SUPPORT_XML_CONFIG |
applicationPath | The path of the configuration file and PKI store used to replace path placeholders in the configuration file |
int OpcServer::setServerConfig | ( | ServerConfig * | pServerConfig | ) |
Sets the server configuration by passing a server configuration object.
One of the overloaded methods needs to be called to give the server a valid configuration.
This version allows to pass in a ServerConfig object with a user specific implementation.
pServerConfig | Interface pointer of the object implementing the ServerConfig interface. |
int OpcServer::start | ( | ) |
Starts the OPC server Initializes and starts up all NodeManagers and SDK modules.
It is possible to add more NodeManagers after the server is started.
int OpcServer::stop | ( | OpcUa_Int32 | secondsTillShutdown, |
const UaLocalizedText & | shutdownReason | ||
) |
Stopps the OPC server Shutdown and deletes all SDK modules and NodeManagers.
secondsTillShutdown | Seconds till shutdown of the server if clients are connected. |
shutdownReason | Reason for the shutdown. |