C++ Based OPC UA Client/Server/PubSub SDK  1.7.2.493
PubSubBase::PubSubResources Class Reference

Class managing PubSub resources like stack and configurations. More...

#include <pubsubresources.h>

Inherits ReferenceCounter, and UaThread.

Public Member Functions

 PubSubResources ()
 Creates an instance of the PubSubResources.
 
UaStatus loadConfiguration (const UaString &sConfigurationFile, bool initializeStack)
 Loads the PubSub configuration from a OPC UA Binary encoded file. More...
 
UaStatus saveConfiguration (const UaString &sConfigurationFile)
 Saves the PubSub configuration to a OPC UA Binary encoded file. More...
 
UaStatus saveConfiguration (UaByteString &bsConfiguration)
 Saves the PubSub configuration to a binary blob. More...
 
void clear ()
 Clears the configuration.
 
void setNamespaces (const UaStringArray &namespaces)
 Sets the namespaces used by the configuration. More...
 
UaStatus mapNamespaceTable (const UaStringArray &newNamespaceTable)
 Map the namespace indices of the configuration from the existing namespace table to the passed namespace table. More...
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter ()
 construction
 
virtual ~ReferenceCounter ()
 destruction
 
- Public Member Functions inherited from UaThread
 UaThread ()
 Constructs a thread management object without starting the thread.
 
virtual ~UaThread ()
 Destroys the thread management object.
 
virtual void start ()
 Starts the thread managed by this object. More...
 
OpcUa_Boolean wait (OpcUa_UInt32 time=OpcUa_UInt32_Max)
 Waits for the termination of the thread. More...
 
OpcUa_Boolean running () const
 Returns the running state of the thread. More...
 
OpcUa_Boolean finished () const
 Returns the finished state of the thread. More...
 

Static Public Member Functions

static UaStatus saveConfiguration (const UaString &sConfigurationFile, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces)
 Saves the PubSub configuration to a OPC UA Binary encoded file. More...
 
static UaStatus saveConfiguration (UaByteString &bsConfiguration, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces)
 Saves the PubSub configuration to a binary blob. More...
 
- Static Public Member Functions inherited from UaThread
static OpcUa_UInt32 currentThread ()
 Get thread ID of current thread. More...
 
static void sleep (OpcUa_UInt32 secs)
 Sleep for n seconds. More...
 
static void msleep (OpcUa_UInt32 msecs)
 Sleep for n milliseconds. More...
 
static void usleep (OpcUa_UInt32 usecs)
 Sleep for n microseconds. More...
 

Protected Member Functions

virtual ~PubSubResources ()
 Destroys the PubSubResources object.
 
void run ()
 Main function of the thread. More...
 

Detailed Description

Class managing PubSub resources like stack and configurations.

Member Function Documentation

UaStatus PubSubBase::PubSubResources::loadConfiguration ( const UaString sConfigurationFile,
bool  initializeStack 
)

Loads the PubSub configuration from a OPC UA Binary encoded file.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
[in]initializeStackFlag indicating if the PubSub stack should be initialized with the configuration
UaStatus PubSubBase::PubSubResources::mapNamespaceTable ( const UaStringArray newNamespaceTable)

Map the namespace indices of the configuration from the existing namespace table to the passed namespace table.

The index into the array is referred to as NamespaceIndex. The NamespaceIndex is used in NodeIds and QualifiedNames, rather than the longer namespace URI. NamespaceIndex 0 is reserved for the OPC UA namespace and it is not included in this array.

Parameters
[in]newNamespaceTableNew namespace array for the namespace table
void PubSubBase::PubSubResources::run ( )
protectedvirtual

Main function of the thread.

Must be implemented by the derived class to execute the functionality

Implements UaThread.

UaStatus PubSubBase::PubSubResources::saveConfiguration ( const UaString sConfigurationFile)

Saves the PubSub configuration to a OPC UA Binary encoded file.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
UaStatus PubSubBase::PubSubResources::saveConfiguration ( UaByteString bsConfiguration)

Saves the PubSub configuration to a binary blob.

Parameters
[out]bsConfigurationThe UaByteString to store the config to
UaStatus PubSubBase::PubSubResources::saveConfiguration ( const UaString sConfigurationFile,
OpcUa_PubSubConfigurationDataType *  pConfiguration,
const UaStringArray namespaces 
)
static

Saves the PubSub configuration to a OPC UA Binary encoded file.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
[in]pConfigurationConfiguration structure to save
[in]namespacesNamespaces for the configuration structure to save
UaStatus PubSubBase::PubSubResources::saveConfiguration ( UaByteString bsConfiguration,
OpcUa_PubSubConfigurationDataType *  pConfiguration,
const UaStringArray namespaces 
)
static

Saves the PubSub configuration to a binary blob.

Parameters
[out]bsConfigurationThe UaByteString to store the config to
[in]pConfigurationConfiguration structure to save
[in]namespacesNamespaces for the configuration structure to save
void PubSubBase::PubSubResources::setNamespaces ( const UaStringArray namespaces)

Sets the namespaces used by the configuration.

The index into the array is referred to as NamespaceIndex. The NamespaceIndex is used in NodeIds and QualifiedNames, rather than the longer namespace URI. NamespaceIndex 0 is reserved for the OPC UA namespace and it is not included in this array.

Parameters
[in]namespacesNew namespace array for the namespace table

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