UA Server SDK C++ Bundle  1.4.0.258
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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)
 construction More...
 
virtual ~QueryContext ()
 destruction
 
OpcUa_ViewDescription * pView () const
 Returns the OPC UA View context for the query. More...
 
OpcUa_Int32 noOfNodeTypes () const
 Returns the number of NodeType entries. More...
 
OpcUa_NodeTypeDescription * pNodeTypes () const
 Returns the list of NodeTypes.
 
OpcUa_ContentFilter * pFilter () const
 Returns the filter for the query results. More...
 
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 if it is the first query with this context In the case of OpcUa_True, it is the first query call with this query context. More...
 
void setUserData (ContinuationPointUserDataBase *pContinuationPointUserDataBase)
 Set user data if not all nodes can be returned to prepare Continuation Point for next query. More...
 
ContinuationPointUserDataBasedetachUserData ()
 Detach user data to continue query. More...
 
OpcUa_Byte CPCounter () const
 This member is used for management of the continuation point in the SDK. More...
 
void setCPCounter (OpcUa_Byte CPCounter)
 This member is used for management of the continuation point in the SDK. More...
 
OpcUa_Boolean isLastQuery () const
 Flag that tells the SDK if 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 the filter settings. It keeps also the settings and the continuation point if not all results can be returned in one 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.
setUserData is used to store the implementation specific context. 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 
)

construction

Construction.

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

OpcUa_Byte QueryContext::CPCounter ( ) const
inline

This member is used for management of the continuation point in the SDK.

Returns
the counted continuation point in the SDK.
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 if 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 bool value to check whether this was the first query with the current context.
OpcUa_Boolean QueryContext::isLastQuery ( ) const
inline

Flag that tells the SDK if it was the last query call and all references are returned.

The flag is set by the methods 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_ContentFilter* QueryContext::pFilter ( ) const
inline

Returns the filter for the query results.

See Also
bIncludeSubtype
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::setCPCounter ( OpcUa_Byte  CPCounter)
inline

This member is used for management of the continuation point in the SDK.

Parameters
CPCounterThis Variable is set to the Value of the member variable.
void QueryContext::setUserData ( ContinuationPointUserDataBase pContinuationPointUserDataBase)

Set user data if not all nodes can be returned to prepare Continuation Point for next query.

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.

Parameters
pContinuationPointUserDataBaseused to check if not all nodes can be returned to prepare Continuation Point for 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: