company logo

Property :: select - Create a subset from a collection

The result collection contains the instances from the collection passed in rProperty , which fulfill the selection condition, i.e. for which the evaluation of the select expression passed in vExpression returns true .

The function explicitly creates a result collection. In order to perform inline selection one may set a filter condition ( filter() ). When the calling property handle refers to a non empty collection all instances are removed before performing the operation. When the calling property handle is not opened (invalid) the function creates a temporary extend for storing the result.

Notes:

The function has been called select , even though this conflicts with the use of select in OSI, since it is closer to the algebraic set terminology.

Return value:  Result property handle ( odaba::Property & )

Reference to the property handle that contains the result of an operation. Note that invalid properties may cause exceptions.

Implementation details

odaba::Property & Property  :: select ( odaba::Property &cProperty, odaba::String &vExpression )
  • cProperty - Property reference

    A property handle refers to a (usually) opened property. Invalid properties may cause an exception.

  • vExpression - OSI inline expression

    An inline expression can be passed as operation path, as operand (something like a + b) or as complete expression. As operand, an expression may contain any expression, which is allowed in a statement, but no semicolon must be appended at the end.

    Complete expressions include expression header (optional) and may include different sections in the expression body which is enclosed in { ... }.

    In contrast to class expressions, inline expressions are not defined explicitly as class expressions but passed as strings to the application at run-time.

    In order to pass no expression, an empty string ( String() ) has to be passed.