UA Server SDK C++ Bundle
1.4.3.291
|
Class implementing the UaObject interface for the LockingServicesType. More...
#include <opcuadi_lockingservicestype.h>
Inherits OpcUaDi::LockingServicesTypeBase.
Public Member Functions | |
LockingServicesType (const UaNodeId &nodeId, UaObject *pInstanceDeclarationObject, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL) | |
Construction of the class LockingServicesType. More... | |
LockingServicesType (const UaNodeId &nodeId, const UaString &name, OpcUa_UInt16 browseNameNameSpaceIndex, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL) | |
Construction of the class LockingServicesType. More... | |
LockingServicesType (UaBase::Object *pBaseNode, XmlUaNodeFactoryManager *pFactory, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL) | |
Constructs an instance of the class LockingServicesType with all components. More... | |
virtual UaStatus | BreakLock (const ServiceContext &serviceContext, OpcUa_Int32 &BreakLockStatus) |
LockingServicesType method BreakLock. More... | |
virtual UaStatus | ExitLock (const ServiceContext &serviceContext, OpcUa_Int32 &ExitLockStatus) |
LockingServicesType method ExitLock. More... | |
virtual UaStatus | InitLock (const ServiceContext &serviceContext, const UaString &CurrentContext, OpcUa_Int32 &InitLockStatus) |
LockingServicesType method InitLock. More... | |
virtual UaStatus | RenewLock (const ServiceContext &serviceContext, OpcUa_Int32 &RenewLockStatus) |
LockingServicesType method RenewLock. More... | |
void | setLockingServices (LockingServicesCallback *pCallback) |
Sets the callback for the LockingServices interface implementation. | |
Static Public Member Functions | |
static void | createTypes () |
Create the type related static members of the class. | |
static void | clearStaticMembers () |
Clear the static members of the class. | |
Protected Member Functions | |
virtual | ~LockingServicesType () |
Destruction. | |
Class implementing the UaObject interface for the LockingServicesType.
OPC UA Objects are used to represent systems, system components, real-world objects and software objects. They have the NodeClass Object. The detailed description of Objects and their attributes can be found in the general description of the Object node class.
Locking is the means to avoid concurrent modifications to a Device or Network and their components. Clients shall use the locking services if they need to make a set of changes (for example, several write operations and Method invocations) and where a consistent state is available only after all of these changes have been performed. The main purpose of locking a Device is avoiding concurrent modifications. The main purpose of locking a Network is avoiding concurrent topology changes.
A Lock from one Client usually allows other Clients to view (navigate / read) the locked element. Servers may choose to implement an exclusive locking where other Clients have no access at all (e.g. in cases where even read operations require certain settings in a Device).
When locking a Device, the lock applies to the complete device (including all components like blocks or modules).
When locking a Modular Device, the lock applies to the complete Device (including all modules). Equally, when locking a block-oriented Device (see 9.2), the lock applies to the complete Device (including all Blocks). Servers may allow independent locking of Sub-Devices or Blocks, respectively, if no lock is applied to the top-level Device (for Modular Device or for Block Device).
If the Online / Offline model is supported, the lock always applies to both the online and the offline version.
When locking a Network, the lock applies to the Network and all connected Devices. If any of the connected Devices provides access to a sub-ordinate Network (like a gateway), the sub-ordinate Network and its connected Devices are locked as well.
OpcUaDi::LockingServicesType::LockingServicesType | ( | const UaNodeId & | nodeId, |
UaObject * | pInstanceDeclarationObject, | ||
NodeManagerConfig * | pNodeConfig, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class LockingServicesType.
This constructor is used if the object is created based on an instance declaration of an object type. Since the only difference between the instance declaration object and the instance object are the node id, the pointer to the instance declaration node is used to get the attribute values other than NodeId from the instance declaration node.
The object is reference counted and can not be deleted directly. The reference counter is set to one after the object is created. If the object was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the object was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availability of the object must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | nodeId | NodeId of the new object |
[in] | pInstanceDeclarationObject | UaObject interface of the instance declaration node used to provide attribute values other than NodeId |
[in] | pNodeConfig | Interface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space |
[in] | pSharedMutex | Shared mutex object used to synchronize access to the object. Can be NULL if no shared mutex is provided |
OpcUaDi::LockingServicesType::LockingServicesType | ( | const UaNodeId & | nodeId, |
const UaString & | name, | ||
OpcUa_UInt16 | browseNameNameSpaceIndex, | ||
NodeManagerConfig * | pNodeConfig, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class LockingServicesType.
This constructor is used if the object is not created based on an instance declaration. It defines the name and node id of the object. Additional language specific names and other attribute values can be set with set methods provided by the class. The object is reference counted and can not be deleted directly. The reference counter is set to one after the object is created. If the object was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the object was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availability of the object must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | nodeId | NodeId of the new object |
[in] | name | Name of the new object. Used as browse name and also as display name if no additional language specific names are set. |
[in] | browseNameNameSpaceIndex | Namespace index used for the browse name |
[in] | pNodeConfig | Interface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space |
[in] | pSharedMutex | Shared mutex object used to synchronize access to the object. Can be NULL if no shared mutex is provided |
OpcUaDi::LockingServicesType::LockingServicesType | ( | UaBase::Object * | pBaseNode, |
XmlUaNodeFactoryManager * | pFactory, | ||
NodeManagerConfig * | pNodeConfig, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Constructs an instance of the class LockingServicesType with all components.
[in] | pBaseNode | The "tree" of nodes that specifies the attributes of the instance and its children |
[in] | pFactory | The factory to create the children |
[in] | pNodeConfig | Interface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space |
[in] | pSharedMutex | Shared mutex object used to synchronize access to the variable. Can be NULL if no shared mutex is provided |
|
virtual |
LockingServicesType method BreakLock.
[in] | serviceContext | The session and client call context |
[out] | BreakLockStatus | 0 - OK, -1 - E_NotLocked |
|
virtual |
LockingServicesType method ExitLock.
[in] | serviceContext | The session and client call context |
[out] | ExitLockStatus | 0 - OK, -1 - E_NotLocked |
|
virtual |
LockingServicesType method InitLock.
[in] | serviceContext | The session and client call context |
[in] | CurrentContext | A string used to provide context information about the current activity going on in the Client. |
[out] | InitLockStatus | 0 - OK, -1 - E_AlreadyLocked, -2 - E_Invalid |
|
virtual |
LockingServicesType method RenewLock.
[in] | serviceContext | The session and client call context |
[out] | RenewLockStatus | 0 - OK, -1 - E_NotLocked |