C++ Based OPC UA Client/Server SDK  1.5.5.355

Wrapper class for the UA stack structure OpcUa_RegisteredServer. More...

#include <uaregisteredserver.h>

Public Member Functions

 UaRegisteredServer ()
 Constructs an instance of the class UaRegisteredServer with empty default values.
 
 UaRegisteredServer (const UaRegisteredServer &other)
 Constructs an instance of the class UaRegisteredServer with values from another UaRegisteredServer object. More...
 
 UaRegisteredServer (const OpcUa_RegisteredServer &other)
 Constructs an instance of the class UaRegisteredServer with values from another OpcUa_RegisteredServer structure. More...
 
 UaRegisteredServer (const UaString &serverUri, const UaString &productUri, const UaLocalizedTextArray &serverNames, OpcUa_ApplicationType serverType, const UaString &gatewayServerUri, const UaStringArray &discoveryUrls, const UaString &semaphoreFilePath, OpcUa_Boolean isOnline)
 Constructs an instance of the class UaRegisteredServer with values provided in the constructor.
 
 UaRegisteredServer (const UaExtensionObject &extensionObject)
 Constructs an instance of the class UaRegisteredServer initialized with value from a UaExtensionObject. More...
 
 UaRegisteredServer (const OpcUa_ExtensionObject &extensionObject)
 Constructs an instance of the class UaRegisteredServer initialized with value from an OpcUa_ExtensionObject structure. More...
 
 ~UaRegisteredServer ()
 Destroys the UaRegisteredServer object.
 
void clear ()
 Clear the data of the UaRegisteredServer. More...
 
bool operator== (const UaRegisteredServer &other) const
 Compare two UaRegisteredServer for equality. More...
 
bool operator!= (const UaRegisteredServer &other) const
 Compare two UaRegisteredServer for inequality. More...
 
UaRegisteredServeroperator= (const UaRegisteredServer &other)
 Assignment operator. More...
 
OpcUa_RegisteredServercopy () const
 Copy UaRegisteredServer data to a newly allocated OpcUa_RegisteredServer. More...
 
void copyTo (OpcUa_RegisteredServer *pDst) const
 Copy UaRegisteredServer data to an existing OpcUa_RegisteredServer structure. More...
 
void attach (OpcUa_RegisteredServer *pValue)
 Attaches to an existing OpcUa_RegisteredServer structure. More...
 
OpcUa_RegisteredServerdetach (OpcUa_RegisteredServer *pDst)
 Detaches the internal RegisteredServer structure from this class. More...
 
UaString getServerUri () const
 The globally unique identifier for the Server instance. More...
 
UaString getProductUri () const
 The globally unique identifier for the Server product.
 
void getServerNames (UaLocalizedTextArray &serverNames) const
 A list of localized descriptive names for the Server. More...
 
OpcUa_ApplicationType getServerType () const
 The type of application. More...
 
UaString getGatewayServerUri () const
 The URI of the Gateway Server associated with the DiscoveryUrls. More...
 
void getDiscoveryUrls (UaStringArray &discoveryUrls) const
 A list of Discovery Endpoints for the Server. More...
 
UaString getSemaphoreFilePath () const
 The path to the semaphore file used to identify an automatically-launched server instance. More...
 
OpcUa_Boolean getIsOnline () const
 True if the Server is currently able to accept connections from Clients. More...
 
void setServerUri (const UaString &serverUri)
 The globally unique identifier for the Server instance. More...
 
void setProductUri (const UaString &productUri)
 The globally unique identifier for the Server product.
 
void setServerNames (const UaLocalizedTextArray &serverNames)
 A list of localized descriptive names for the Server. More...
 
void setServerType (OpcUa_ApplicationType serverType)
 The type of application. More...
 
void setGatewayServerUri (const UaString &gatewayServerUri)
 The URI of the Gateway Server associated with the DiscoveryUrls. More...
 
void setDiscoveryUrls (const UaStringArray &discoveryUrls)
 A list of Discovery Endpoints for the Server. More...
 
void setSemaphoreFilePath (const UaString &semaphoreFilePath)
 The path to the semaphore file used to identify an automatically-launched server instance. More...
 
void setIsOnline (OpcUa_Boolean isOnline)
 True if the Server is currently able to accept connections from Clients. More...
 

Static Public Member Functions

static OpcUa_RegisteredServerclone (const OpcUa_RegisteredServer &source)
 Copy OpcUa_RegisteredServer data to a newly allocated OpcUa_RegisteredServer. More...
 
static void cloneTo (const OpcUa_RegisteredServer &source, OpcUa_RegisteredServer &copy)
 Copy OpcUa_RegisteredServer data to an existing OpcUa_RegisteredServer structure. More...
 

Detailed Description

Wrapper class for the UA stack structure OpcUa_RegisteredServer.

This class encapsulates the native OpcUa_RegisteredServer structure and handles memory allocation and cleanup for you. UaRegisteredServer uses implicit sharing to avoid needless copying and to boost the performance. Only if you modify a shared RegisteredServer it creates a copy for that (copy-on-write). So assigning another UaRegisteredServer or passing it as parameter needs constant time and is nearly as fast as assigning a pointer.

The server to register

Constructor & Destructor Documentation

UaRegisteredServer::UaRegisteredServer ( const UaRegisteredServer other)

Constructs an instance of the class UaRegisteredServer with values from another UaRegisteredServer object.

Parameters
otherthe other UaRegisteredServer used to initialize the object
UaRegisteredServer::UaRegisteredServer ( const OpcUa_RegisteredServer other)

Constructs an instance of the class UaRegisteredServer with values from another OpcUa_RegisteredServer structure.

Parameters
otherthe other OpcUa_RegisteredServer used to initialize the object
UaRegisteredServer::UaRegisteredServer ( const UaExtensionObject extensionObject)

Constructs an instance of the class UaRegisteredServer initialized with value from a UaExtensionObject.

Parameters
extensionObjectthe extension object containing the RegisteredServer
UaRegisteredServer::UaRegisteredServer ( const OpcUa_ExtensionObject extensionObject)

Constructs an instance of the class UaRegisteredServer initialized with value from an OpcUa_ExtensionObject structure.

Parameters
extensionObjectthe extension object containing the RegisteredServer

Member Function Documentation

void UaRegisteredServer::attach ( OpcUa_RegisteredServer pValue)

Attaches to an existing OpcUa_RegisteredServer structure.

Don't manually free the attached structure afterwards, because UaRegisteredServer is responsible for it now.

Parameters
pValue[in] Parameter to attach to.
void UaRegisteredServer::clear ( )

Clear the data of the UaRegisteredServer.

OpcUa_RegisteredServer * UaRegisteredServer::clone ( const OpcUa_RegisteredServer source)
static

Copy OpcUa_RegisteredServer data to a newly allocated OpcUa_RegisteredServer.

Parameters
sourceSource to clone.
Returns
pointer to a newly allocated OpcUa_RegisteredServer.
void UaRegisteredServer::cloneTo ( const OpcUa_RegisteredServer source,
OpcUa_RegisteredServer copy 
)
static

Copy OpcUa_RegisteredServer data to an existing OpcUa_RegisteredServer structure.

Parameters
sourcethe source of the clone operation.
copythe destination of the clone operation.
OpcUa_RegisteredServer * UaRegisteredServer::copy ( ) const

Copy UaRegisteredServer data to a newly allocated OpcUa_RegisteredServer.

Returns
pointer to a newly allocated OpcUa_RegisteredServer.
void UaRegisteredServer::copyTo ( OpcUa_RegisteredServer pDst) const

Copy UaRegisteredServer data to an existing OpcUa_RegisteredServer structure.

Parameters
pDstthe destination of this copy operation.
OpcUa_RegisteredServer * UaRegisteredServer::detach ( OpcUa_RegisteredServer pDst)

Detaches the internal RegisteredServer structure from this class.

This way you take over the control of freeing the RegisteredServer data. If more than one reference exists, the data is copied to pDst instead of being detached.

Parameters
pDst[out] Pointer to an OpcUa_RegisteredServer structure that receives the RegisteredServer data.
Returns
If the function succeeds, pDst is returned, otherwise 0 is returned.
void UaRegisteredServer::getDiscoveryUrls ( UaStringArray discoveryUrls) const

A list of Discovery Endpoints for the Server.

The list shall have at least one valid entry.

UaString UaRegisteredServer::getGatewayServerUri ( ) const

The URI of the Gateway Server associated with the DiscoveryUrls.

This value is only specified by Gateway Servers that wish to register the Servers that they provide access to.

For Servers that do not act as a Gateway Server this parameter shall be null.

OpcUa_Boolean UaRegisteredServer::getIsOnline ( ) const

True if the Server is currently able to accept connections from Clients.

The DiscoveryServer shall return ApplicationDescriptions to the Client.

The Server is expected to periodically re-register with the DiscoveryServer.

False if the Server is currently unable to accept connections from Clients. The DiscoveryServer shall NOT return ApplicationDescriptions to the Client.

This parameter is ignored if a semaphoreFilePath is provided.

UaString UaRegisteredServer::getSemaphoreFilePath ( ) const

The path to the semaphore file used to identify an automatically-launched server instance.

Manually-launched servers will not use this parameter.

If a Semaphore file is provided, the IsOnline flag is ignored.

If a Semaphore file is provided and exists, the LocalDiscoveryServer shall save the registration information in a persistent data store that it reads whenever the LocalDiscoveryServer starts.

If a Semaphore file is specified but does not exist, the Discovery Server shall remove the registration from any persistent data store.

If the Server has registered with a semaphoreFilePath, the DiscoveryServer shall check that this file exists before returning the ApplicationDescription to the client.

If the Server did not register with a semaphoreFilePath (it is null or empty), then the DiscoveryServer does not attempt to verify the existence of the file before returning the ApplicationDescription to the client.

void UaRegisteredServer::getServerNames ( UaLocalizedTextArray serverNames) const

A list of localized descriptive names for the Server.

The list shall have at least one valid entry.

OpcUa_ApplicationType UaRegisteredServer::getServerType ( ) const

The type of application.

The value “Client” (The application is a Client) is not allowed. The Service result shall be Bad_InvalidArgument in this case.

UaString UaRegisteredServer::getServerUri ( ) const

The globally unique identifier for the Server instance.

The serverUri matches the applicationUri from the ApplicationDescription.

bool UaRegisteredServer::operator!= ( const UaRegisteredServer other) const

Compare two UaRegisteredServer for inequality.

See also
operator==
Parameters
otherthe UaRegisteredServer to compare with.
Returns
true if not equal, false otherwise.
UaRegisteredServer & UaRegisteredServer::operator= ( const UaRegisteredServer other)

Assignment operator.

Parameters
otherthe UaRegisteredServer to assign.
Returns
reference to itself.
bool UaRegisteredServer::operator== ( const UaRegisteredServer other) const

Compare two UaRegisteredServer for equality.

Parameters
otherthe UaRegisteredServer to compare with.
Returns
true if equal, false if not.
void UaRegisteredServer::setDiscoveryUrls ( const UaStringArray discoveryUrls)

A list of Discovery Endpoints for the Server.

The list shall have at least one valid entry.

void UaRegisteredServer::setGatewayServerUri ( const UaString gatewayServerUri)

The URI of the Gateway Server associated with the DiscoveryUrls.

This value is only specified by Gateway Servers that wish to register the Servers that they provide access to.

For Servers that do not act as a Gateway Server this parameter shall be null.

void UaRegisteredServer::setIsOnline ( OpcUa_Boolean  isOnline)

True if the Server is currently able to accept connections from Clients.

The DiscoveryServer shall return ApplicationDescriptions to the Client.

The Server is expected to periodically re-register with the DiscoveryServer.

False if the Server is currently unable to accept connections from Clients. The DiscoveryServer shall NOT return ApplicationDescriptions to the Client.

This parameter is ignored if a semaphoreFilePath is provided.

void UaRegisteredServer::setSemaphoreFilePath ( const UaString semaphoreFilePath)

The path to the semaphore file used to identify an automatically-launched server instance.

Manually-launched servers will not use this parameter.

If a Semaphore file is provided, the IsOnline flag is ignored.

If a Semaphore file is provided and exists, the LocalDiscoveryServer shall save the registration information in a persistent data store that it reads whenever the LocalDiscoveryServer starts.

If a Semaphore file is specified but does not exist, the Discovery Server shall remove the registration from any persistent data store.

If the Server has registered with a semaphoreFilePath, the DiscoveryServer shall check that this file exists before returning the ApplicationDescription to the client.

If the Server did not register with a semaphoreFilePath (it is null or empty), then the DiscoveryServer does not attempt to verify the existence of the file before returning the ApplicationDescription to the client.

void UaRegisteredServer::setServerNames ( const UaLocalizedTextArray serverNames)

A list of localized descriptive names for the Server.

The list shall have at least one valid entry.

void UaRegisteredServer::setServerType ( OpcUa_ApplicationType  serverType)

The type of application.

The value “Client” (The application is a Client) is not allowed. The Service result shall be Bad_InvalidArgument in this case.

void UaRegisteredServer::setServerUri ( const UaString serverUri)

The globally unique identifier for the Server instance.

The serverUri matches the applicationUri from the ApplicationDescription.


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