C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
QueryContext Class Reference

This class provides all query settings and the continuation point handling. More...

#include <continuationpoint.h>

Public Member Functions

 QueryContext (OpcUa_ViewDescription *pView, OpcUa_Int32 noOfNodeTypes, OpcUa_NodeTypeDescription *pNodeTypes, OpcUa_ContentFilter *pFilter, OpcUa_UInt32 uMaxDataSetsToReturn, OpcUa_UInt32 uMaxReferencesToReturn)
 Creates a QueryContext object initialized with the passed in query parameters. More...
 
virtual ~QueryContext ()
 Destroys the QueryContext object.
 
OpcUa_ViewDescriptionpView () const
 Returns the OPC UA View context for the query. More...
 
OpcUa_Int32 noOfNodeTypes () const
 Returns the number of NodeType entries. More...
 
OpcUa_NodeTypeDescriptionpNodeTypes () const
 Returns the list of NodeTypes.
 
OpcUa_ContentFilterpFilter () const
 Returns the filter for the query results.
 
OpcUa_UInt32 uMaxDataSetsToReturn () const
 Returns the maximum number of data sets to return. More...
 
OpcUa_UInt32 uMaxReferencesToReturn () const
 Returns the maximum number of references to return. More...
 
OpcUa_Boolean isFirstQuery () const
 Can be used to check whether it is the first query with this context. More...
 
void setUserData (ContinuationPointUserDataBase *pContinuationPointUserDataBase)
 Set user data to prepare a Continuation Point for the next query if not all nodes can be returned. More...
 
ContinuationPointUserDataBasedetachUserData ()
 Detach user data to continue query. More...
 
OpcUa_Boolean isLastQuery () const
 Flag telling the SDK whether it was the last query call and all references are returned. More...
 

Detailed Description

This class provides all query settings and the continuation point handling.

The class provides all settings for a query call, like node types and filter settings. It also keeps the settings and the continuation point if not all results can be returned in a single query result. The same object is provided in a second query call triggered through a QueryNext service call. In this case, the continuation point is provided in addition to the query settings.

If the number of query results exeeds the uMaxDataSetsToReturn, uMaxReferencesToReturn or a server internal limit, a continuation point is necessary and setUserData is used to store the implementation specific continuation point user data. You must derive your data handling class from ContinuationPointUserDataBase.

isFirstQuery is used to check if it is a first query or a query next.

detachUserData is used to get the stored continuation point data.

The SDK handles the release of continuation point data if QueryNext is not called or just called to release the continuation point.

Constructor & Destructor Documentation

QueryContext::QueryContext ( OpcUa_ViewDescription pView,
OpcUa_Int32  noOfNodeTypes,
OpcUa_NodeTypeDescription pNodeTypes,
OpcUa_ContentFilter pFilter,
OpcUa_UInt32  uMaxDataSetsToReturn,
OpcUa_UInt32  uMaxReferencesToReturn 
)

Creates a QueryContext object initialized with the passed in query parameters.

Parameters
pViewThe View context used for the browse.
noOfNodeTypesThe number of NodeType entries.
pNodeTypesThe list of NodeTypes.
pFilterThe filter for the query results.
uMaxDataSetsToReturnThe maximum number of data sets to return.
uMaxReferencesToReturnThe maximum number of references to return.

Member Function Documentation

ContinuationPointUserDataBase * QueryContext::detachUserData ( )

Detach user data to continue query.

The user of the SDK is responsible to delete the user data after detach is called.

Returns
a pointer to the continuation point user data base.
OpcUa_Boolean QueryContext::isFirstQuery ( ) const
inline

Can be used to check whether it is the first query with this context.

In the case of OpcUa_True, it is the first query call with this query context. In the case of OpcUa_False, it is a query next call with a continuation point.

Returns
a Boolean value to check whether this was the first query with the current context.
OpcUa_Boolean QueryContext::isLastQuery ( ) const
inline

Flag telling the SDK whether it was the last query call and all references are returned.

The flag is set by the method 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 query. The default value is OpcUa_True.

Returns
a value used to recognize whether this was the last query call or not.
OpcUa_Int32 QueryContext::noOfNodeTypes ( ) const
inline

Returns the number of NodeType entries.

See also
setUserData
OpcUa_ViewDescription* QueryContext::pView ( ) const
inline

Returns the OPC UA View context for the query.

If the view is not set, the whole address space is queried.

void QueryContext::setUserData ( ContinuationPointUserDataBase pContinuationPointUserDataBase)

Set user data to prepare a Continuation Point for the next query 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 QueryNext is not called or just called to release the continuation point.

See also
detachUserData to get the continuation point user data in a later query call with continuation point.
Parameters
pContinuationPointUserDataBaseused to check whether not all nodes can be returned to prepare a Continuation Point for the next query.
OpcUa_UInt32 QueryContext::uMaxDataSetsToReturn ( ) const
inline

Returns the maximum number of data sets to return.

If the maximum is exceeded, a continuation point needs to be created.

See also
setUserData
OpcUa_UInt32 QueryContext::uMaxReferencesToReturn ( ) const
inline

Returns the maximum number of references to return.

If the maximum is exceeded, a continuation point needs to be created.

See also
setUserData

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