UA Server SDK C++ Bundle  1.4.1.271
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
OpcServer Class Reference

Main OPC Server object. More...

#include <opcserver.h>

Inherits UaServerApplication.

Public Member Functions

 OpcServer ()
 Construction. More...
 
virtual ~OpcServer ()
 Destruction. More...
 
virtual OpcUa_DateTime getBuildDate () const
 Get the build date from the static compiled in string. More...
 
- Public Member Functions inherited from UaServerApplication
 UaServerApplication ()
 Creates an instance of UaServerApplication with default settings. More...
 
virtual ~UaServerApplication ()
 Destroys the UaServerApplication object. More...
 
int setServerConfig (const UaString &configurationFile, const UaString &sApplicationPath)
 Sets the server configuration by passing the path of the configuration file. More...
 
int setServerConfig (const UaString &configurationFile, const UaString &sApplicationPath, const UaString &sConfigPath, const UaString &sTracePath)
 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 addModule (UaServerApplicationModule *pModule)
 Adds a Module to the SDK. More...
 
int setCallback (UaServerApplicationCallback *pUaServerApplicationCallback)
 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...
 
NodeManagerConfiggetDefaultNodeManager ()
 Returns the default node manager for server specific nodes in namespace one. More...
 
ServerManagergetServerManager ()
 Returns the ServerManager object.
 
ServerConfiggetServerConfig ()
 Returns the ServerConfig object.
 
CoreModulegetCoreModule ()
 Returns the CoreModule object.
 
OpcUa_Boolean isStarted ()
 Returns the isStarted flag.
 

Protected Member Functions

virtual SessioncreateDefaultSession (OpcUa_Int32 sessionID, const UaNodeId &authenticationToken)
 Creates a session object for the OPC server. More...
 
virtual UaStatus afterInitialize ()
 This method needs to be implemented by the derived class and is called to finish the initialization of the UaServerApplication. More...
 
virtual UaStatus afterStartUp ()
 This method needs to be implemented by the derived class and is called to finish the start-up of the UaServerApplication. More...
 
virtual UaStatus beforeShutdown ()
 This method needs to be implemented by the derived class and is called to start the shutdown of the UaServerApplication. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from UaServerApplication
static int initEnvironment ()
 Initialize the environment like UA stack platform layer or XML parser.
 
static void cleanupEnvironment ()
 Clean up the environment like UA stack platform layer or XML parser.
 

Detailed Description

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.

Constructor & Destructor Documentation

OpcServer::OpcServer ( )

Construction.

OpcServer::~OpcServer ( )
virtual

Destruction.

Member Function Documentation

UaStatus OpcServer::afterInitialize ( )
protectedvirtual

This method needs to be implemented by the derived class and is called to finish the initialization of the UaServerApplication.

This method is typically used to initialize the communication modules like the UaModule.

Returns
Result code

Implements UaServerApplication.

UaStatus OpcServer::afterStartUp ( )
protectedvirtual

This method needs to be implemented by the derived class and is called to finish the start-up of the UaServerApplication.

This method is typically used to start up the communication modules like the UaModule.

Returns
Result code

Implements UaServerApplication.

UaStatus OpcServer::beforeShutdown ( )
protectedvirtual

This method needs to be implemented by the derived class and is called to start the shutdown of the UaServerApplication.

This method is typically used to stop the communication modules like the UaModule.

Returns
Result code

Reimplemented from UaServerApplication.

Session * OpcServer::createDefaultSession ( OpcUa_Int32  sessionID,
const UaNodeId authenticationToken 
)
protectedvirtual

Creates a session object for the OPC server.

This is the default implementation. It can be overwritten by implementing the UaServerApplicationCallback.

Parameters
sessionIDSession Id created by the server application.
authenticationTokenSecret session Id created by the server application.
Returns
A pointer to the created session.

Implements UaServerApplication.

OpcUa_DateTime OpcServer::getBuildDate ( ) const
virtual

Get the build date from the static compiled in string.

Returns
the build date from the static compiled in string.

Reimplemented from UaServerApplication.


The documentation for this class was generated from the following files: