C++ Based OPC UA Client/Server SDK
1.6.1.391
|
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... | |
UaRegisteredServer & | operator= (const UaRegisteredServer &other) |
Assignment operator. More... | |
OpcUa_RegisteredServer * | copy () 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_RegisteredServer * | detach (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_RegisteredServer * | clone (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 OpcUa_RegisteredServer data to an existing OpcUa_RegisteredServer structure. More... | |
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
UaRegisteredServer::UaRegisteredServer | ( | const UaRegisteredServer & | other | ) |
Constructs an instance of the class UaRegisteredServer with values from another UaRegisteredServer object.
other | the 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.
other | the 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.
extensionObject | the 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.
extensionObject | the extension object containing the RegisteredServer |
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.
pValue | [in] Parameter to attach to. |
void UaRegisteredServer::clear | ( | ) |
Clear the data of the UaRegisteredServer.
|
static |
Copy OpcUa_RegisteredServer data to a newly allocated OpcUa_RegisteredServer.
source | Source to clone. |
|
static |
Copy OpcUa_RegisteredServer data to an existing OpcUa_RegisteredServer structure.
source | the source of the clone operation. |
copy | the destination of the clone operation. |
OpcUa_RegisteredServer * UaRegisteredServer::copy | ( | ) | const |
Copy UaRegisteredServer data to a newly allocated OpcUa_RegisteredServer.
void UaRegisteredServer::copyTo | ( | OpcUa_RegisteredServer * | pDst | ) | const |
Copy UaRegisteredServer data to an existing OpcUa_RegisteredServer structure.
pDst | the 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.
pDst | [out] Pointer to an OpcUa_RegisteredServer structure that receives the RegisteredServer data. |
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.
other | the UaRegisteredServer to compare with. |
UaRegisteredServer & UaRegisteredServer::operator= | ( | const UaRegisteredServer & | other | ) |
bool UaRegisteredServer::operator== | ( | const UaRegisteredServer & | other | ) | const |
Compare two UaRegisteredServer for equality.
other | the UaRegisteredServer to compare with. |
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.