C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
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 loadConfiguration (const UaString &sConfigurationFile, bool initializeStack, const UaStringArray &targetNamepsaces)
 Loads the PubSub configuration from a OPC UA Binary encoded file. More...
 
UaStatus loadConfiguration (const UaByteString &bsConfiguration, bool initializeStack, const UaStringArray &targetNamepsaces)
 Loads the PubSub configuration from a ByteString containing the UABinaryFileDataType as extension object. More...
 
UaStatus loadConfiguration (const UaStringArray &namespaceTable, const UaPubSubConfigurationDataType &pubSubConfiguration, bool initializeStack)
 Loads the PubSub configuration with a PubSubConfigurationDataType. 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...
 
UaStatus saveConfiguration (UaStringArray &namespaceTable, UaPubSubConfigurationDataType &pubSubConfiguration)
 Saves the PubSub configuration to a PubSubConfigurationDataType. 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 (const UaString &sConfigurationFile, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces, const UaStructureDescriptions &structureDataTypes, const UaEnumDescriptions &enumDataTypes, const UaSimpleTypeDescriptions &simpleDataTypes, const UaString &schemaLocation, const UaKeyValuePairs &fileHeader)
 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 UaStatus saveConfiguration (UaByteString &bsConfiguration, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces, const UaStructureDescriptions &structureDataTypes, const UaEnumDescriptions &enumDataTypes, const UaSimpleTypeDescriptions &simpleDataTypes, const UaString &schemaLocation, const UaKeyValuePairs &fileHeader)
 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.

The file must contain an extension object with a UABinaryFileDataType. The UABinaryFileDataType must contain a PubSubConfigurationDataType structure with the PubSub configuration. The header of the UABinaryFileDataType provides a namespace table and data type definitions for the configuration data in the PubSubConfigurationDataType.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
[in]initializeStackFlag indicating if the PubSub stack should be initialized with the configuration for communication
UaStatus PubSubBase::PubSubResources::loadConfiguration ( const UaString sConfigurationFile,
bool  initializeStack,
const UaStringArray targetNamepsaces 
)

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

The file must contain an extension object with a UABinaryFileDataType. The UABinaryFileDataType must contain a PubSubConfigurationDataType structure with the PubSub configuration. The header of the UABinaryFileDataType provides a namespace table and data type definitions for the configuration data in the PubSubConfigurationDataType.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
[in]initializeStackFlag indicating if the PubSub stack should be initialized with the configuration for communication
[in]targetNamepsacesTarget namespaces for the application. If the array is provided, a namespace index in the configuration is mapped to the target index.
UaStatus PubSubBase::PubSubResources::loadConfiguration ( const UaByteString bsConfiguration,
bool  initializeStack,
const UaStringArray targetNamepsaces 
)

Loads the PubSub configuration from a ByteString containing the UABinaryFileDataType as extension object.

The ByteString must contain an extension object with a UABinaryFileDataType. The UABinaryFileDataType must contain a PubSubConfigurationDataType structure with the PubSub configuration. The header of the UABinaryFileDataType provides a namespace table and data type definitions for the configuration data in the PubSubConfigurationDataType.

Parameters
[in]bsConfigurationContent of the PubSub configuration file
[in]initializeStackFlag indicating if the PubSub stack should be initialized with the configuration for communication
[in]targetNamepsacesTarget namespaces for the application. If the array is provided, a namespace index in the configuration is mapped to the target index.
UaStatus PubSubBase::PubSubResources::loadConfiguration ( const UaStringArray namespaceTable,
const UaPubSubConfigurationDataType pubSubConfiguration,
bool  initializeStack 
)

Loads the PubSub configuration with a PubSubConfigurationDataType.

The ByteString must contain an extension object with a UABinaryFileDataType. The UABinaryFileDataType must contain a PubSubConfigurationDataType structure with the PubSub configuration. The header of the UABinaryFileDataType provides a namespace table and data type definitions for the configuration data in the PubSubConfigurationDataType.

Parameters
[in]namespaceTableNamespace table for the PubSub configuration structure
[in]pubSubConfigurationPubSub configuration as structure
[in]initializeStackFlag indicating if the PubSub stack should be initialized with the configuration for communication
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.

The contend of the file is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

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

Saves the PubSub configuration to a binary blob.

The contend of the ByteString is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

Parameters
[out]bsConfigurationThe UaByteString to store the config to
UaStatus PubSubBase::PubSubResources::saveConfiguration ( UaStringArray namespaceTable,
UaPubSubConfigurationDataType pubSubConfiguration 
)

Saves the PubSub configuration to a PubSubConfigurationDataType.

Parameters
[out]namespaceTableNamespace table for the PubSub configuration structure
[out]pubSubConfigurationPubSub configuration as structure
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.

The contend of the file is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

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 ( const UaString sConfigurationFile,
OpcUa_PubSubConfigurationDataType *  pConfiguration,
const UaStringArray namespaces,
const UaStructureDescriptions structureDataTypes,
const UaEnumDescriptions enumDataTypes,
const UaSimpleTypeDescriptions simpleDataTypes,
const UaString schemaLocation,
const UaKeyValuePairs fileHeader 
)
static

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

The contend of the file is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

Parameters
[in]sConfigurationFilePath and name of PubSub configuration file
[in]pConfigurationConfiguration structure to save
[in]namespacesNamespaces for the configuration structure to save
[in]structureDataTypesThe description of structure DataTypes used by the configuration
[in]enumDataTypesThe description of enumeration DataTypes used by the configuration
[in]simpleDataTypesThe description of simple DataTypes used by the configuration
[in]schemaLocationLocation of the schema file with the data types used for the configuration
[in]fileHeaderAdditional header fields for the configuration
UaStatus PubSubBase::PubSubResources::saveConfiguration ( UaByteString bsConfiguration,
OpcUa_PubSubConfigurationDataType *  pConfiguration,
const UaStringArray namespaces 
)
static

Saves the PubSub configuration to a binary blob.

The contend of the ByteString is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

Parameters
[out]bsConfigurationThe UaByteString to store the config to
[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,
const UaStructureDescriptions structureDataTypes,
const UaEnumDescriptions enumDataTypes,
const UaSimpleTypeDescriptions simpleDataTypes,
const UaString schemaLocation,
const UaKeyValuePairs fileHeader 
)
static

Saves the PubSub configuration to a binary blob.

The contend of the ByteString is the UABinaryFileDataType UA binary encoded as ExtensionObject where the body of the UABinaryFileDataType is a UA binar encoded PubSubConfigurationDataType structure.

Parameters
[out]bsConfigurationThe UaByteString to store the config to
[in]pConfigurationConfiguration structure to save
[in]namespacesNamespaces for the configuration structure to save
[in]structureDataTypesThe description of structure DataTypes used by the configuration
[in]enumDataTypesThe description of enumeration DataTypes used by the configuration
[in]simpleDataTypesThe description of simple DataTypes used by the configuration
[in]schemaLocationLocation of the schema file with the data types used for the configuration
[in]fileHeaderAdditional header fields for the configuration
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: