Class: TQueryHandle

Declaration: QueryHandle.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

None.

Purpose:

A filter that can be applied to any derived class of MQueryTarget. An arbitrarily complex Boolean expression.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is not intended to be derived from.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TQueryHandle::TQueryHandle

  • TQueryHandle ()
  • TQueryHandle (const TQueryHandle & copy)
  • Interface Category:

    API.

    Purpose:

    1. Default constructor. If evaluated, returns kUnknown.
    2. Copy constructor.

    Calling Context:

    1. Called by the stream-in operators and to create an instance to assign to.
    2. Called to copy an object.

    Parameters:

    Return Value:

    None.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::operator=

    TQueryHandle & operator =(const TQueryHandle & copy)

    Interface Category:

    API.

    Purpose:

    Assignment operator.

    Calling Context:

    Called when an object is assigned to another compatible object.

    Parameters:

    Return Value:

    A non-const reference to the left-hand side object.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::~TQueryHandle

    ~ TQueryHandle ()

    Interface Category:

    API.

    Purpose:

    Destructor.

    Calling Context:

    Called to destroy an object.

    Parameters:

    Return Value:

    None.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::Evaluate

    1. EQueryResult Evaluate (bool strictBinaryOps =false) const
    2. EQueryResult Evaluate (const MQueryTarget & target, bool strictBinaryOps =false) const

    Interface Category:

    API.

    Purpose:

    1. Determines if this query can be entirely evaluated without a target (that is, all expressions are constants).
    2. Determines if the specified target meets the criteria expressed in the query.

    Calling Context:

    1. Call this function directly.
    2. Call this function directly.

    Parameters:

    Return Value:

    For 99.9% of clients, it is safe to treat kUnknown ==false. kUnknown is only returned under unusual circumstances:
    1. TQueryHandle::Evaluate(bool) is called and the query contains one or more non-constant expressions.
    2. TQueryHandle::Evaluate(bool) is called and the query contains one or more constant Unknown expressions.
    3. TQueryHandle::Evaluate(MQueryTarget) is called and the query contains one or more constant Unknown expressions.
    4. Cases 2 and 3 can occur because TQueryHandle objects initialized with the default constructor evaluate to kUnknown. In the future, partial evaluations might be supported, in which case kUnknown would signal that further evaluation is required.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::True

    static TQueryHandle True ()

    Interface Category:

    API.

    Purpose:

    Produces a query, which, when evaluated, returns a constant result (true).

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    The query.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::False

    static TQueryHandle False ()

    Interface Category:

    API.

    Purpose:

    Produces a query, which, when evaluated, returns a constant result (false).

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    The query.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::Unknown

    static TQueryHandle Unknown ()

    Interface Category:

    API.

    Purpose:

    Produces a query, which, when evaluated, returns a constant result (kUnknown).

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    The query.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::GetEvaluationCost

    TQueryEvaluationCost GetEvaluationCost () const

    Interface Category:

    API.

    Purpose:

    Returns an integer that represents the runtime cost to evaluate this query. The result is a relative value which is useful only when compared to the result from another instance.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    The relative cost.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::AddEvaluationCost

    void AddEvaluationCost (TQueryEvaluationCost & addToMe) const

    Interface Category:

    API.

    Purpose:

    Similar to the GetEvaluationCost, but rather than returning a cost, it adds it to the passed in value (note that costs can be negative, so addToMe might come back with a smaller value).

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    None.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::GetTextRepresentation

    void GetTextRepresentation (TStandardText & appendTo, bool verbose) const

    Interface Category:

    API.

    Purpose:

    Appends a textual representation of this query to appendTo.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    None.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::CountNodes

    QueryCount CountNodes (QueryCount initialCount =0) const

    Interface Category:

    API.

    Purpose:

    Returns the number of nodes in this query.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    The number of nodes.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::GetHash

    HashResult GetHash () const

    Interface Category:

    API.

    Purpose:

    Returns a hash key for this object.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    None.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::operator==

    bool operator ==(const TQueryHandle & right) const

    Interface Category:

    API.

    Purpose:

    Determines if this query is equal to its argument.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    Returns true if the argument is equal to the query.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::operator!=

    bool operator != (const TQueryHandle & right) const

    Interface Category:

    API.

    Purpose:

    Determines if this query is not equal to its argument.

    Calling Context:

    Call this function directly.

    Parameters:

    Return Value:

    Returns true if argument is not equal to the query.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::operator>>=

    TStream & operator >>=(TStream & toWhere) const

    Interface Category:

    API.

    Purpose:

    Stream-out operator.

    Calling Context:

    Called to stream out data.

    Parameters:

    Return Value:

    Returns a reference to the stream the object streams itself out to.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.

    Member Function: TQueryHandle::operator<<=

    TStream & operator <<= (TStream & fromWhere)

    Interface Category:

    API.

    Purpose:

    Stream-in operator.

    Calling Context:

    Called to stream in data.

    Parameters:

    Return Value:

    Returns a reference to the stream the object streams itself in from.

    Exceptions:

    Throws no exceptions, passes all exceptions through.

    Concurrency:

    Multithread safe.

    Other Considerations:

    None.
    Click the icon to mail questions or corrections about this material to Taligent personnel.
    Copyright©1995 Taligent,Inc. All rights reserved.