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

Management object for PubSubConfig. More...

#include <pubsubconfiguration.h>

Inherits PubSubBase::PubSubObject.

Public Member Functions

 PubSubConfiguration ()
 Creates an instance of the PubSubConfig.
 
UaStatus loadConfiguration (const UaString &sConfigurationFile, bool initializeStack)
 Loads the PubSub configuration from a OPC UA Binary encoded file. More...
 
UaStatus loadConfiguration (const UaByteString &bsConfiguration, bool initializeStack)
 Loads the PubSub configuration from a OPC UA Binary encoded ByteString.
 
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 applyChanges ()
 Apply all configuration changes to the current configuration.
 
void clear ()
 Clears the configuration.
 
UaStringArray namespaceTable () const
 Returns the namespace table currently used by the configuration. More...
 
void setNamespaceTable (const UaStringArray &namespaces)
 Sets the namespace table 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...
 
PubSubConnectionaddConnection (TransportFacet transportFacet)
 Adds a PubSub connection to the configuration.
 
PubSubConnectionaddConnection_Datagram (const UaString &name, bool enabled, const UaVariant &publisherId, const UaString &address, const UaString &networkInterface, const UaString &discoveryAddress, TransportFacet transportFacet=PubSubObject::TransportFacet_PubSub_UDP_UADP)
 Adds a PubSub connection for a Datagram related transport to the configuration. More...
 
PubSubConnectionaddConnection_Broker (const UaString &name, bool enabled, const UaVariant &publisherId, const UaString &address, TransportFacet transportFacet)
 Adds a PubSub connection for a Broker related transport to the configuration. More...
 
OpcUa_UInt32 connectionCount () const
 Returns the number of connection.
 
PubSubConnectiongetConnection (OpcUa_UInt32 index)
 Returns the connection at index or NULL if index is outside the valid range.
 
UaStatus removeConnection (PubSubConnection *pConnection)
 Removes the passed connection.
 
PublishedDataSetaddDataSet (const UaString &name, const UaStringArray &fieldNames, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaInt32Array &publishedVariableValueRanks)
 Adds a PublishedDataSet to the configuration. More...
 
PublishedDataSetaddDataSet (const UaString &name, const UaStringArray &fieldNames, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaNodeIdArray &publishedVariableDataTypes, const UaInt32Array &publishedVariableValueRanks)
 Adds a PublishedDataSet to the configuration. More...
 
PublishedDataSetaddDataSet (const UaString &name, const UaVersionTime &minorVersion, const UaVersionTime &majorVersion, const UaStringArray &fieldNames, const UaGuidArray &fieldIds, const UaNodeIdArray &publishedVariableNodeIds, const UaByteArray &publishedVariableBuiltInTypes, const UaNodeIdArray &publishedVariableDataTypes, const UaInt32Array &publishedVariableValueRanks)
 Adds a PublishedDataSet to the configuration. More...
 
OpcUa_UInt32 dataSetCount () const
 Returns the number of DataSets.
 
PublishedDataSetgetDataSet (OpcUa_UInt32 index)
 Returns the DataSet at index or NULL if index is outside the valid range.
 
UaStatus removeDataSet (PublishedDataSet *pDataSet)
 Removes the passed DataSet.
 
void setPubSubControlCallback (PubSubControlCallback *pPubSubControlCallback)
 Set PubSubControlCallback.
 
- Public Member Functions inherited from PubSubBase::PubSubObject
 PubSubObject (PubSubResources *pPubSubResources, TransportFacet transportFacet, ConfigurationState configurationState)
 Creates an instance of the PubSubObject.
 
UaMutexpConfigMutex () const
 Get the shared mutex for the complete configuration.
 
void incrementErrorCounter ()
 Increments the error counter for the PubSub object.
 
void decrementErrorCounter ()
 Decrements the error counter for the PubSub object.
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter ()
 construction
 
virtual ~ReferenceCounter ()
 destruction
 

Static Public Member Functions

static UaStatus saveConfiguration (const UaString &sConfigurationFile, OpcUa_PubSubConfigurationDataType *pConfiguration, const UaStringArray &namespaces)
 Saves the PubSub configuration to an 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...
 

Protected Member Functions

virtual ~PubSubConfiguration ()
 Destroys the PubSubConfig object.
 
- Protected Member Functions inherited from PubSubBase::PubSubObject
virtual ~PubSubObject ()
 Destroys the PubSubObject object.
 

Additional Inherited Members

- Public Types inherited from PubSubBase::PubSubObject
enum  PubSubObjectType
 PubSub transport facet reflecting the defined TransportProfileUris.
 
enum  TransportFacet {
  TransportFacet_None = 0x0, TransportFacet_PubSub_UDP_UADP = 0x11, TransportFacet_PubSub_ETH_UADP = 0x21, TransportFacet_PubSub_AMQP_UADP = 0x31,
  TransportFacet_PubSub_MQTT_UADP = 0x41
}
 PubSub transport facet reflecting the defined TransportProfileUris. More...
 
enum  ConfigurationState {
  ConfigurationState_None, ConfigurationState_Deleted, ConfigurationState_InSyncWithStruct, ConfigurationState_New,
  ConfigurationState_Modified
}
 PubSub configuration object state. More...
 
enum  PubSubHeaderLayout { PubSubHeaderLayout_Custom, PubSubHeaderLayout_UADP_PeriodicFixed, PubSubHeaderLayout_UADP_Dynamic }
 PubSub header configuration. More...
 

Detailed Description

Management object for PubSubConfig.

Member Function Documentation

PubSubConnection * PubSubBase::PubSubConfiguration::addConnection_Broker ( const UaString name,
bool  enabled,
const UaVariant publisherId,
const UaString address,
TransportFacet  transportFacet 
)

Adds a PubSub connection for a Broker related transport to the configuration.

Fills a PubSubConnectionDataType with TransportSettings initialized to BrokerConnectionTransportDataType. The broker TransportSettings are initialized with empty strings.

The Address.NetworkInterface setting is initialized with an empty string.

Parameters
[in]nameName of the connection
[in]enabledEnable state of the connection
[in]publisherIdPublisherId for the connection
[in]addressAddress used for the connection
[in]transportFacetTransport facet for the connection. Valid options are AMQP-UADP and MQTT-UADP.
PubSubConnection * PubSubBase::PubSubConfiguration::addConnection_Datagram ( const UaString name,
bool  enabled,
const UaVariant publisherId,
const UaString address,
const UaString networkInterface,
const UaString discoveryAddress,
TransportFacet  transportFacet = PubSubObject::TransportFacet_PubSub_UDP_UADP 
)

Adds a PubSub connection for a Datagram related transport to the configuration.

Fills a PubSubConnectionDataType with TransportSettings initialized to DatagramConnectionTransportDataType. The Datagram TransportSetting DiscoveryAddress.NetworkInterface is configured with the networkInterface setting that is also used for the Connection Address.NetworkInterface.

Parameters
[in]nameName of the connection
[in]enabledEnable state of the connection
[in]publisherIdPublisherId for the connection
[in]addressAddress used for the connection
[in]networkInterfaceNetwork interface used for the Address and for Datagram transpor DiscoveryAddress
[in]discoveryAddressDiscovery address used for the Datagram transport settings
[in]transportFacetTransport facet for the connection. Valid options are UDP-UADP and ETH-UADP.
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet ( const UaString name,
const UaStringArray fieldNames,
const UaNodeIdArray publishedVariableNodeIds,
const UaByteArray publishedVariableBuiltInTypes,
const UaInt32Array publishedVariableValueRanks 
)

Adds a PublishedDataSet to the configuration.

Parameters
[in]nameName of the DataSet
[in]fieldNamesArray of field names
[in]publishedVariableNodeIdsArray of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames.
[in]publishedVariableBuiltInTypesArray of built-in types for the variables. The size of the array must match fieldNames.
[in]publishedVariableValueRanksArray of value ranks for the variables. The size of the array must match fieldNames.
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet ( const UaString name,
const UaStringArray fieldNames,
const UaNodeIdArray publishedVariableNodeIds,
const UaByteArray publishedVariableBuiltInTypes,
const UaNodeIdArray publishedVariableDataTypes,
const UaInt32Array publishedVariableValueRanks 
)

Adds a PublishedDataSet to the configuration.

Parameters
[in]nameName of the DataSet
[in]fieldNamesArray of field names
[in]publishedVariableNodeIdsArray of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames.
[in]publishedVariableBuiltInTypesArray of built-in types for the variables. The size of the array must match fieldNames.
[in]publishedVariableDataTypesArray of DataTypes. The size of the array must match fieldNames. If the array is empty, built-in types are used.
[in]publishedVariableValueRanksArray of value ranks for the variables. The size of the array must match fieldNames.
PublishedDataSet * PubSubBase::PubSubConfiguration::addDataSet ( const UaString name,
const UaVersionTime minorVersion,
const UaVersionTime majorVersion,
const UaStringArray fieldNames,
const UaGuidArray fieldIds,
const UaNodeIdArray publishedVariableNodeIds,
const UaByteArray publishedVariableBuiltInTypes,
const UaNodeIdArray publishedVariableDataTypes,
const UaInt32Array publishedVariableValueRanks 
)

Adds a PublishedDataSet to the configuration.

Parameters
[in]nameName of the DataSet
[in]minorVersionMinor version for the DataSet
[in]majorVersionMajor version for the DataSet
[in]fieldNamesArray of field names
[in]fieldIdsArray of field IDs. The size of the array must match fieldNames. If the array is empty, the field IDs are generated.
[in]publishedVariableNodeIdsArray of NodeIds representing the published Variables wich are the source for the DataSet. The size of the array must match fieldNames.
[in]publishedVariableBuiltInTypesArray of built-in types for the variables. The size of the array must match fieldNames.
[in]publishedVariableDataTypesArray of DataTypes. The size of the array must match fieldNames. If the array is empty, built-in types are used.
[in]publishedVariableValueRanksArray of value ranks for the variables. The size of the array must match fieldNames.
UaStatus PubSubBase::PubSubConfiguration::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::PubSubConfiguration::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
UaStringArray PubSubBase::PubSubConfiguration::namespaceTable ( ) const

Returns the namespace table currently 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.

UaStatus PubSubBase::PubSubConfiguration::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::PubSubConfiguration::saveConfiguration ( UaByteString bsConfiguration)

Saves the PubSub configuration to a binary blob.

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

Saves the PubSub configuration to an 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::PubSubConfiguration::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::PubSubConfiguration::setNamespaceTable ( const UaStringArray namespaces)

Sets the namespace table 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: