Class managing PubSub resources like stack and configurations.
More...
#include <pubsubresources.h>
Inherits ReferenceCounter, and UaThread.
|
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 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...
|
|
Class managing PubSub resources like stack and configurations.
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] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | initializeStack | Flag 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] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | initializeStack | Flag indicating if the PubSub stack should be initialized with the configuration for communication |
[in] | targetNamepsaces | Target namespaces for the application. If the array is provided, a namespace index in the configuration is mapped to the target index. |
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] | bsConfiguration | Content of the PubSub configuration file |
[in] | initializeStack | Flag indicating if the PubSub stack should be initialized with the configuration for communication |
[in] | targetNamepsaces | Target namespaces for the application. If the array is provided, a namespace index in the configuration is mapped to the target index. |
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] | namespaceTable | Namespace table for the PubSub configuration structure |
[in] | pubSubConfiguration | PubSub configuration as structure |
[in] | initializeStack | Flag indicating if the PubSub stack should be initialized with the configuration for communication |
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] | newNamespaceTable | New 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] | sConfigurationFile | Path and name of PubSub configuration file |
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
-
Saves the PubSub configuration to a PubSubConfigurationDataType.
- Parameters
-
[out] | namespaceTable | Namespace table for the PubSub configuration structure |
[out] | pubSubConfiguration | PubSub 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] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
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] | sConfigurationFile | Path and name of PubSub configuration file |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
[in] | structureDataTypes | The description of structure DataTypes used by the configuration |
[in] | enumDataTypes | The description of enumeration DataTypes used by the configuration |
[in] | simpleDataTypes | The description of simple DataTypes used by the configuration |
[in] | schemaLocation | Location of the schema file with the data types used for the configuration |
[in] | fileHeader | Additional 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] | bsConfiguration | The UaByteString to store the config to |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
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] | bsConfiguration | The UaByteString to store the config to |
[in] | pConfiguration | Configuration structure to save |
[in] | namespaces | Namespaces for the configuration structure to save |
[in] | structureDataTypes | The description of structure DataTypes used by the configuration |
[in] | enumDataTypes | The description of enumeration DataTypes used by the configuration |
[in] | simpleDataTypes | The description of simple DataTypes used by the configuration |
[in] | schemaLocation | Location of the schema file with the data types used for the configuration |
[in] | fileHeader | Additional 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] | namespaces | New namespace array for the namespace table |
The documentation for this class was generated from the following files:
- C:/work/uasdkcpp/src/uabase/pubsubbasecpp/pubsubresources.h
- C:/work/uasdkcpp/src/uabase/pubsubbasecpp/pubsubresources.cpp