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.
TQueryHandle ()
TQueryHandle (const TQueryHandle & copy)
Interface Category:
API.
Purpose:
- Default constructor. If evaluated, returns kUnknown.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and to create an instance to assign to.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TQueryHandle & copy -The object to copy.
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.
~ 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
- EQueryResult Evaluate (bool strictBinaryOps =false) const
- EQueryResult Evaluate (const MQueryTarget & target, bool strictBinaryOps =false) const
Interface Category:
API.
Purpose:
- Determines if this query can be entirely evaluated without a target (that is, all expressions are constants).
- Determines if the specified target meets the criteria expressed in the query.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- bool strictBinaryOps =false -If strictBinaryOps ==true, all binary operations (logical AND, OR, and so on) are performed from left to right; otherwise, cost is used to determine which branch is the cheapest to evaluate first.
- const MQueryTarget & target -The target to evaluate against.
- bool strictBinaryOps =false -If strictBinaryOps ==true, all binary operations (logical AND, OR, and so on) are performed from left to right; otherwise, cost is used to determine which branch is the cheapest to evaluate first.
Return Value:
For 99.9% of clients, it is safe to treat kUnknown ==false.
kUnknown is only returned under unusual circumstances:
- TQueryHandle::Evaluate(bool) is called and the query contains one or more non-constant expressions.
- TQueryHandle::Evaluate(bool) is called and the query contains one or more constant Unknown expressions.
- TQueryHandle::Evaluate(MQueryTarget) is called and the query contains one or more constant Unknown expressions.
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.
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.
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:
- TQueryEvaluationCost & addToMe -The initial cost. It should normally be initialized to zero.
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:
- TStandardText & appendTo -The initial text. It should normally be initialized to "".
- bool verbose -Set to true for verbose text.
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:
- QueryCount initialCount =0 -The initial count. Usually zero.
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:
- TStream & toWhere -The stream the object streams itself out to.
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:
- TStream & fromWhere -The stream the object streams itself in from.
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.