C++ Based OPC UA Client/Server SDK
1.6.1.391
|
This class provides all browse settings and the continuation point handling. More...
#include <continuationpoint.h>
Public Member Functions | |
BrowseContext (OpcUa_ViewDescription *pView, OpcUa_NodeId *pNodeToBrowse, OpcUa_UInt32 uMaxResultsToReturn, OpcUa_BrowseDirection BrowseDirection, OpcUa_NodeId *pReferenceTypeId, OpcUa_Boolean bIncludeSubtype, OpcUa_UInt32 uNodeClassMask, OpcUa_UInt32 uResultMask) | |
Creates a BrowseContext object initialized with the browse parameters passed in. More... | |
virtual | ~BrowseContext () |
Destroys the BrowseContext object. | |
void | setUserData (ContinuationPointUserDataBase *pContinuationPointUserDataBase) |
Set user data to prepare a Continuation Point for the next browse if not all nodes can be returned. More... | |
ContinuationPointUserDataBase * | detachUserData () |
Detach user data to continue browse. More... | |
OpcUa_ViewDescription * | pView () const |
Returns the OPC UA View context for the browse. More... | |
OpcUa_NodeId * | pNodeToBrowse () const |
Returns the node id of the node to browse. | |
OpcUa_UInt32 | uMaxResultsToReturn () const |
Returns the maximum number of browse results to return. More... | |
void | setMaxResultsToReturn (OpcUa_UInt32 uMaxResultsToReturn) |
Allows setting of the maximum number of results to return. | |
OpcUa_BrowseDirection | BrowseDirection () const |
Returns the browse direction for the browse call. More... | |
OpcUa_NodeId * | pReferenceTypeId () const |
Returns the node id of the requested reference type or its subtypes if bIncludeSubtype is set. More... | |
OpcUa_Boolean | bIncludeSubtype () const |
Returns the flag indicating whether subtypes of the requested reference type should be included in the browse result. More... | |
OpcUa_UInt32 | uNodeClassMask () const |
Returns the node class filter mask identifying the node classes to include in the browse result. More... | |
OpcUa_UInt32 | uResultMask () const |
Returns the result filter mask identifing the information returned for each node in the browse result. More... | |
void | setResultMask (OpcUa_UInt32 uResultMask) |
Allows setting of the result mask. | |
OpcUa_Boolean | isFirstBrowse () const |
Can be used to check whether it is the first browse with this context. More... | |
OpcUa_Boolean | isLastBrowse () const |
Flag that tells the SDK whether it was the last browse call and all references are returned. More... | |
OpcUa_UInt32 | nodeToBrowseCount () const |
Returns the total number of nodes to browse in the Browse service. More... | |
OpcUa_UInt32 | nodeToBrowseIndex () const |
Returns the index of this node in the nodes to browse array in the Browse service call. More... | |
This class provides all browse settings and the continuation point handling.
The class provides all settings for a browse call, like node to browse and the browse filter settings. It also keeps the settings and the continuation point user data if not all results can be returned in a single browse result. The same object is provided in a second browse call triggered through a BrowseNext service call. In this case, the continuation point is provided in addition to the browse settings.
If the number of browse results exeeds the uMaxResultsToReturn or a server internal limit, a continuation point is necessary and setUserData is used to store the implementation specific continuation point user data.
The following code provides an example for the functions setUserData and uMaxResultsToReturn
The following code provides an example for a continuation point user data class
isFirstBrowse is used to check whether it is a first browse or a browse next.
detachUserData is used to get the stored continuation point data.
The following code provides an example for the functions isFirstBrowse and detachUserData
The SDK handles the release of continuation point data if BrowseNext is not called or just called to release the continuation point.
BrowseContext::BrowseContext | ( | OpcUa_ViewDescription * | pView, |
OpcUa_NodeId * | pNodeToBrowse, | ||
OpcUa_UInt32 | uMaxResultsToReturn, | ||
OpcUa_BrowseDirection | BrowseDirection, | ||
OpcUa_NodeId * | pReferenceTypeId, | ||
OpcUa_Boolean | bIncludeSubtype, | ||
OpcUa_UInt32 | uNodeClassMask, | ||
OpcUa_UInt32 | uResultMask | ||
) |
Creates a BrowseContext object initialized with the browse parameters passed in.
pView | The View context used for the browse. |
pNodeToBrowse | The actual Node to browse. |
uMaxResultsToReturn | The maximum number of results to return. |
BrowseDirection | Direction of the browse from the node to browse (Inverse/Forward/Both). |
pReferenceTypeId | NodeId of the reference type to follow. |
bIncludeSubtype | Flag indicating whether subtypes of the reference type should be returned. |
uNodeClassMask | The node class mask used as filter. |
uResultMask | The result mask used to filter the requested data returned for a result. |
|
inline |
Returns the flag indicating whether subtypes of the requested reference type should be included in the browse result.
|
inline |
Returns the browse direction for the browse call.
Options are:
ContinuationPointUserDataBase * BrowseContext::detachUserData | ( | ) |
Detach user data to continue browse.
The user of the SDK is responsible to delete the user data after detach is called.
|
inline |
Can be used to check whether it is the first browse with this context.
In the case of OpcUa_True, it is the first browse call with this browse context. In the case of OpcUa_False, it is a browse next call with a continuation point.
|
inline |
Flag that tells the SDK whether it was the last browse call and all references are returned.
The flag is set by setUserData (OpcUa_False) since this indicates that a continuation point is necessary, or by detachUserData (OpcUa_True) since the continuation point is handled in a next browse. The default value is OpcUa_True.
|
inline |
Returns the total number of nodes to browse in the Browse service.
This BrowseContext represents only one of the nodes to browse in the Browse request. This information can be used together with the nodeToBrowseIndex() and the receiveTime and timeoutHint in the ServiceContext to decide whether the current node can still be processed or the browse for the node should be skipped and BadNoContinuationPoints returned for the remaining nodes. It would also be possible to return continuation points and an empty result list for the remaining nodes if the number is below the number of continuation points supported per session.
|
inline |
Returns the index of this node in the nodes to browse array in the Browse service call.
This BrowseContext represents only one of the nodes to browse in the Browse request. This information can be used together with the nodeToBrowseCount() and the receiveTime and timeoutHint in the ServiceContext to decide whether the current node can still be processed or the browse for the node should be skipped and BadNoContinuationPoints returned for the remaining nodes. It would also be possible to return continuation points and an empty result list for the remaining nodes if the number is below the number of continuation points supported per session.
|
inline |
Returns the node id of the requested reference type or its subtypes if bIncludeSubtype is set.
|
inline |
Returns the OPC UA View context for the browse.
If the view is not set, the whole address space is browsed.
void BrowseContext::setUserData | ( | ContinuationPointUserDataBase * | pContinuationPointUserDataBase | ) |
Set user data to prepare a Continuation Point for the next browse if not all nodes can be returned.
The data handling class must be derived from ContinuationPointUserDataBase. The SDK handles the release of continuation point data if BrowseNext is not called or just called to release the continuation point.
pContinuationPointUserDataBase | User data for the continuation point. BrowseContext takes ownership of the passed object. |
|
inline |
Returns the maximum number of browse results to return.
If the maximum is exceeded, a continuation point needs to be created.
|
inline |
Returns the node class filter mask identifying the node classes to include in the browse result.
Bit mask containing the following options:
Define | Value |
---|---|
OpcUa_NodeClass_Object | 1 |
OpcUa_NodeClass_Variable | 2 |
OpcUa_NodeClass_Method | 4 |
OpcUa_NodeClass_ObjectType | 8 |
OpcUa_NodeClass_VariableType | 16 |
OpcUa_NodeClass_ReferenceType | 32 |
OpcUa_NodeClass_DataType | 64 |
OpcUa_NodeClass_View | 128 |
If set to zero, all node classes are returned.
|
inline |
Returns the result filter mask identifing the information returned for each node in the browse result.
Bit mask containing the following options:
Define | Value |
---|---|
OpcUa_BrowseResultMask_None | 0 |
OpcUa_BrowseResultMask_ReferenceTypeId | 1 |
OpcUa_BrowseResultMask_IsForward | 2 |
OpcUa_BrowseResultMask_NodeClass | 4 |
OpcUa_BrowseResultMask_BrowseName | 8 |
OpcUa_BrowseResultMask_DisplayName | 16 |
OpcUa_BrowseResultMask_TypeDefinition | 32 |