C++ Based OPC UA Client/Server SDK  1.5.5.355
UaContentFilterElement Class Reference

OPC UA ContentFilterElement used in ContentFilter. More...

#include <uacontentfilter.h>

Public Member Functions

 UaContentFilterElement ()
 Constructs an empty content filter element object.
 
 UaContentFilterElement (const UaContentFilterElement &other)
 Constructs a content filter element object from another content filter element object.
 
 UaContentFilterElement (const OpcUa_ContentFilterElement &other)
 Constructs a content filter element object from a content filter element structure.
 
virtual ~UaContentFilterElement ()
 Destroys the content filter element object.
 
UaContentFilterElementoperator= (const UaContentFilterElement &other)
 Assigns another content filter element object to this content filter element object and returns a reference to this object.
 
void setElementIndex (OpcUa_Int32 elementIndex)
 Sets the index of the filter element in the content filter element array. More...
 
OpcUa_Int32 elementIndex () const
 Returns the index of the filter element in the content filter element array.
 
void setFilterOperator (OpcUa_FilterOperator filterOperator)
 Sets the filter operator for the filter element. More...
 
OpcUa_FilterOperator filterOperator () const
 Returns the filter operator of the filter element. More...
 
void setFilterOperand (OpcUa_UInt32 index, UaFilterOperand *pOperand, OpcUa_UInt32 arraySize)
 Sets one operand of the filter operand list. More...
 
OpcUa_UInt32 getFilterOperandArraySize () const
 Returns the array size of the filter operand list.
 
const UaFilterOperandgetFilterOperand (OpcUa_UInt32 index) const
 Returns the entry from the filter operand list on the requested index. More...
 
UaString toString () const
 Returns the content filter element as string.
 

Detailed Description

OPC UA ContentFilterElement used in ContentFilter.

This class is used to build and hold an OPC UA ContentFilterElement used in the UaContentFilter. The content filter elements and the element filter operands (UaElementOperand derived from UaFilterOperand) can be used to build a filter hierarchy.

Member Function Documentation

OpcUa_FilterOperator UaContentFilterElement::filterOperator ( ) const

Returns the filter operator of the filter element.

See also
setFilterOperator
const UaFilterOperand * UaContentFilterElement::getFilterOperand ( OpcUa_UInt32  index) const

Returns the entry from the filter operand list on the requested index.

Returns
Pointer to the UaFilterOperand.
Parameters
[in]indexIndex of the operand in the array
void UaContentFilterElement::setElementIndex ( OpcUa_Int32  elementIndex)

Sets the index of the filter element in the content filter element array.

Parameters
[in]elementIndexThe index of the current element.
void UaContentFilterElement::setFilterOperand ( OpcUa_UInt32  index,
UaFilterOperand pOperand,
OpcUa_UInt32  arraySize 
)

Sets one operand of the filter operand list.

The class takes the ownership of the passed object pOperand. There are three different filter operands defined:

Element
  • Implemented by UaElementOperand derived from UaFilterOperand
  • Specifies an index of the array of elements. This type is used to build a logic tree of subelements by linking the operand of one element to a subelement.
Literal
SimpleAttribute
  • Implemented by UaSimpleAttributeOperand derived from UaFilterOperand
  • Specifies any Attribute of an Object or Variable Node using a TypeDefinition and a relative path constructed from BrowseNames
Parameters
[in]indexIndex of the operand in the array
[in]pOperandUaFilterOperand to set at the index in the array
[in]arraySizeSize of the operand array filled with this method
void UaContentFilterElement::setFilterOperator ( OpcUa_FilterOperator  filterOperator)

Sets the filter operator for the filter element.

Possible filter operators are:

  • Equals (OpcUa_FilterOperator_OfType) – 2 operands
    • TRUE if operand[0] is equal to operand[1].
    • If the operands are of different types, the system shall perform any implicit conversion to a common type. This operator resolves to FALSE if no implicit conversion is available and the operands are of different types. This operator returns FALSE if the implicit conversion fails.
  • IsNull (OpcUa_FilterOperator_IsNull) – 1 operand
    • TRUE if operand[0] is a null value
  • GreaterThan (OpcUa_FilterOperator_GreaterThan) – 2 operands
    • TRUE if operand[0] is greater than operand[1].
    • Operands must resolve to an ordered value
    • The same conversion rules as defined for Equals apply.
  • LessThan (OpcUa_FilterOperator_LessThan) – 2 operands
    • TRUE if operand[0] is less than operand[1].
    • The same conversion rules and restrictions as defined for GreaterThan apply.
  • LessThanOrEqual (OpcUa_FilterOperator_LessThanOrEqual) – 2 operands
    • TRUE if operand[0] is less than or equal to operand[1].
    • The same conversion rules and restrictions as defined for GreaterThan apply.
  • Like (OpcUa_FilterOperator_Like) – 2 operands
    • TRUE if operand[0] matches a pattern defined by operand[1].
    • Operands must resolve to an string. This operator resolves to FALSE if any operand can not be resolved to a string.
    • The Like operator can be used to perform wild card comparisons. Several special characters can be included in the second operand of the Like operator. The valid characters are defined in Table 112. The wild card characters can be combined in a single string (i.e. 'Th[ia][ts]%' would match 'That is fine', 'This is fine', 'That as one', 'This it is', 'Then at any' etc.).
    • Wildcard characters
      Special Character Description
      % Match any string of zero or more characters (i.e. 'main%' would match any string that starts with 'main', '%en%' would match any string that contains the letters 'en' such as 'entail', 'green' and 'content'.) If a string includes the '%' sign, the list operand can be used (i.e. 5[%] would match '5%').
      _ Match any single character (i.e. '_ould' would match 'would', 'could'). If a string includes a '_', then the list operand can be used (i.e. 5[_] would match '5_').
      \ Escape character allows literal interpretation (i.e. \\ is \, \% is %, \_ is _)
      [] Match any single character in a list (i.e. 'abc[13-68]' would match 'abc1','abc3','abc4','abc5','abc6', and 'abc8'. 'xyz[c-f]' would match 'xyzc', 'xyzd', 'xyze', 'xyzf').
      [^] Not Matching any single character in a list. The ^ shall be the first character inside on the []. (i.e. 'ABC[^13-5]' would NOT match 'ABC1', 'ABC3', 'ABC4', and 'ABC5'. xyz[^dgh] would NOT match 'xyzd', 'xyzg', 'xyzh'. )
      - Not (OpcUa_FilterOperator_Not) – 1 operand
    • TRUE if operand[0] is FALSE.
    • Operand must resolve to a Boolean.
  • Between (OpcUa_FilterOperator_Between) – 3 operands
    • TRUE if operand[0] is greater or equal to operand[1] and less than or equal to operand[2].
    • Operands must resolve to an ordered value
    • If the operands are of different types, the system shall perform any implicit conversion to match all operands to a common type. If no implicit conversion is available and the operands are of different types, the particular result is FALSE.
  • InList (OpcUa_FilterOperator_OfType) – 2-n operands
    • TRUE if operand[0] is equal to one or more of the remaining operands.
  • And (OpcUa_FilterOperator_And) – 2 operands
    • TRUE if operand[0] and operand[1] are TRUE.
    • Operands must resolve to a Boolean.
  • Or (OpcUa_FilterOperator_Or) – 2 operands
    • TRUE if operand[0] or operand[1] are TRUE.
    • Operands must resolve to a Boolean.
  • Cast (OpcUa_FilterOperator_Cast) – 2 operands
    • Converts operand[0] to a value with a data type with a NodeId identified by operand[1].
  • BitwiseAnd (OpcUa_FilterOperator_BitwiseAnd) – 2 operands
    • The result is an integer which matches the size of the largest operand and contains a bitwise And operation of the two operands where both have been converted to the same size (largest of the two operands)
    • Operands must resolve to an Integer. If any operand cannot be resolved to an Integer, it is considered a NULL.
  • BitwiseOr (OpcUa_FilterOperator_BitwiseOr) – 2 operands
    • The result is an integer which matches the size of the largest operand and contains a bitwise Or operation of the two operands where both have been converted to the same size (largest of the two operands)
    • Operands must resolve to an Integer. If any operand cannot be resolved to an Integer, it is considered a NULL.
  • OfType (OpcUa_FilterOperator_OfType) – 1 operand
    • TRUE if the target Node is of type operand[0] or of a subtype of operand[0].
    • Operand must resolve to a NodeId that identifies an ObjectType or a VariableType Node.
    • If operand[0] does not resolve to a NodeId that identifies an ObjectType or a VariableType Node, this operation shall always be False.

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