Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
HPS::Condition Class Reference

#include <hps.h>

Inheritance diagram for HPS::Condition:
HPS::Object

Public Types

enum  Intrinsic { Extent, DrawPass }
 

Public Member Functions

 Condition ()
 The default constructor creates an empty condition that is always satisfied.
 
 Condition (char const *in_utf8)
 
 Condition (float in_number)
 
 Condition (HPS::Condition::Intrinsic in_special)
 
 Condition (Condition const &in_that)
 
 Condition (Condition &&in_that)
 
Conditionoperator= (Condition &&in_that)
 
HPS::Type ObjectType () const
 
bool ShowCondition (UTF8 &out_condition) const
 
bool ShowNumber (float &out_number) const
 
bool ShowIntrinsic (Condition::Intrinsic &out_special) const
 
bool ShowOperands (ConditionArray &out_operands) const
 
Conditionoperator= (Condition const &in_that)
 
bool Equals (Condition const &in_that) const
 
bool operator== (Condition const &in_that) const
 
bool operator!= (Condition const &in_that) const
 
bool IsSatisfiedBy (UTF8Array const &in_conditions) const
 
bool IsSatisfiedBy (char const *in_condition) const
 
Condition OR (Condition const &in_operand2) const
 
Condition XOR (Condition const &in_operand2) const
 
Condition AND (Condition const &in_operand2) const
 
Condition EQ (Condition const &in_operand2) const
 
Condition NEQ (Condition const &in_operand2) const
 
Condition GT (Condition const &in_operand2) const
 
Condition LT (Condition const &in_operand2) const
 
Condition GTEQ (Condition const &in_operand2) const
 
Condition LTEQ (Condition const &in_operand2) const
 
Condition operator! () const
 
Condition operator|| (Condition const &in_operand2) const
 
Condition operator^ (Condition const &in_operand2) const
 
Condition operator&& (Condition const &in_operand2) const
 
- Public Member Functions inherited from HPS::Object
 Object (Object const &that)
 
Objectoperator= (Object const &other_object)
 
 Object (Object &&in_that)
 
Objectoperator= (Object &&in_that)
 
HPS::Type Type () const
 
virtual bool Empty () const
 
virtual void Reset ()
 
bool HasType (HPS::Type in_mask) const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 

Static Public Member Functions

static Condition NOT (Condition const &in_operand)
 
static Condition OR (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition XOR (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition AND (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition EQ (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition NEQ (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition GT (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition LT (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition GTEQ (Condition const &in_operand1, Condition const &in_operand2)
 
static Condition LTEQ (Condition const &in_operand1, Condition const &in_operand2)
 
- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Friends

HPS_API Condition NOT (Condition const &in_operand)
 
HPS_API Condition OR (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition XOR (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition AND (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition EQ (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition NEQ (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition GT (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition LT (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition GTEQ (Condition const &in_operand1, Condition const &in_operand2)
 
HPS_API Condition LTEQ (Condition const &in_operand1, Condition const &in_operand2)
 

Detailed Description

A Condition is a string or collection of strings separated by logical operators. In practice, conditions form a tree with the leaves being strings (the actual Condition) and the interior nodes being logical operators.

Constructor & Destructor Documentation

HPS::Condition::Condition ( char const *  in_utf8)

This constructor is the way to construct a Condition object from a string.

Parameters
in_utf8The string to use as the condition, assumed to be utf8 encoded.
HPS::Condition::Condition ( float  in_number)

This constructor is the way to construct a Condition object from a number.

Parameters
in_valueThe number to use as the condition.
HPS::Condition::Condition ( HPS::Condition::Intrinsic  in_special)

This constructor is the way to construct a Condition object from a special intrinsic type.

Parameters
in_specialThe intrinsic type to use as the condition.
HPS::Condition::Condition ( Condition const &  in_that)

The copy constructor copies the source condition.

Parameters
in_thatthe source to be copied.
HPS::Condition::Condition ( Condition &&  in_that)

The move constructor creates a Condition by transferring the underlying impl of the rvalue reference to this Condition thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a Condition to take the impl from.

Member Function Documentation

Condition HPS::Condition::AND ( Condition const &  in_operand2) const

An AND condition is satisfied if both of its operand conditions are satisfied.

Parameters
in_operand2The condition to AND with this object.
Returns
a new condition representing the logical AND of the operand condition with this object.
static Condition HPS::Condition::AND ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An AND condition is satisfied if both of its operand conditions are satisfied.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical AND of the operand conditions.
Condition HPS::Condition::EQ ( Condition const &  in_operand2) const

An EQ conditional expression is satisfied if its operand expressions are equal.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the equality comparison of the operand expression with this object.
static Condition HPS::Condition::EQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An EQ conditional expression is satisfied if its operand expressions are equal.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the equality comparison of the operand expressions.
bool HPS::Condition::Equals ( Condition const &  in_that) const

Check if the source object is equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.
Condition HPS::Condition::GT ( Condition const &  in_operand2) const

An GT conditional expression is satisfied if its second operand is greater than the first operand.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the greater than comparison of the operand expression with this object.
static Condition HPS::Condition::GT ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An GT conditional expression is satisfied if its second operand is greater than the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the greater than comparison of the operand expressions.
Condition HPS::Condition::GTEQ ( Condition const &  in_operand2) const

An GTEQ conditional expression is satisfied if its second operand is greater than or equal to the first operand.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the greater than or equal to comparison of the operand expression with this object.
static Condition HPS::Condition::GTEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An GTEQ conditional expression is satisfied if its second operand is greater than or equal to the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the greater than or equal to comparison of the operands.
bool HPS::Condition::IsSatisfiedBy ( UTF8Array const &  in_conditions) const

Determines if the source Condition object is satisfied by the given conditions.

Parameters
in_conditionsThe conditions to test against the Condition object.
Returns
true if the Condition object is satisfied, false otherwise.
bool HPS::Condition::IsSatisfiedBy ( char const *  in_condition) const

Determines if the source Condition object is satisfied by the given condition.

Parameters
in_conditionThe condition to test against the Condition object.
Returns
true if the Condition object is satisfied, false otherwise.
Condition HPS::Condition::LT ( Condition const &  in_operand2) const

An LT conditional expression is satisfied if its second operand is less than the first operand.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the less than comparison of the operand expression with this object.
static Condition HPS::Condition::LT ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An LT conditional expression is satisfied if its second operand is less than the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the less than comparison of the operand expressions.
Condition HPS::Condition::LTEQ ( Condition const &  in_operand2) const

An LTEQ conditional expression is satisfied if its second operand is less than or equal to the first operand.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the less than or equal to comparison of the operand expression with this object.
static Condition HPS::Condition::LTEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An LTEQ conditional expression is satisfied if its second operand is less than or equal to the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the less than or equal to comparison of the operand expressions.
Condition HPS::Condition::NEQ ( Condition const &  in_operand2) const

An NEQ conditional expression is satisfied if its operand expressions are not equal.

Parameters
in_operand2The expression to compare to this object.
Returns
a new conditional expression representing the non-equality comparison of the operand expression with this object.
static Condition HPS::Condition::NEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An NEQ conditional expression is satisfied if its operand expressions are not equal.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the non-equality comparison of the operand expressions.
static Condition HPS::Condition::NOT ( Condition const &  in_operand)
static

A NOT condition is satisfied if its operand condition is not satisfied.

Parameters
in_operandThe condition operand.
Returns
a new condition representing the logical negation of the operand.
HPS::Type HPS::Condition::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Object.

Condition HPS::Condition::operator! ( ) const

A NOT condition is satisfied if its operand condition is not satisfied.

Returns
a new condition representing the logical negation of this object.
bool HPS::Condition::operator!= ( Condition const &  in_that) const

Check if the source object is equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are not equivalent, false otherwise.
Condition HPS::Condition::operator&& ( Condition const &  in_operand2) const

An AND condition is satisfied if both of its operand conditions are satisfied.

Parameters
in_operand2The condition to AND with this object.
Returns
a new condition representing the logical AND of the operand condition with this object.
Condition& HPS::Condition::operator= ( Condition &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this Condition thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a Condition to take the impl from.
Returns
A reference to this Condition.
Condition& HPS::Condition::operator= ( Condition const &  in_that)

Copies the source Condition object to this object.

Parameters
in_thatThe source of the copy.
Returns
A reference to this object.
bool HPS::Condition::operator== ( Condition const &  in_that) const

Check if the source object is equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.
Condition HPS::Condition::operator^ ( Condition const &  in_operand2) const

An XOR condition is satisfied if either operand condition is satisfied, but not both.

Parameters
in_operand2The condition to XOR with this object.
Returns
a new condition representing the logical XOR of the operand condition with this object.
Condition HPS::Condition::operator|| ( Condition const &  in_operand2) const

An OR condition is satisfied if either of its operand conditions are satisfied.

Parameters
in_operand2The condition to OR with this object.
Returns
a new condition representing the logical OR of the operand condition with this object.
Condition HPS::Condition::OR ( Condition const &  in_operand2) const

An OR condition is satisfied if either of its operand conditions are satisfied.

Parameters
in_operand2The condition to OR with this object.
Returns
a new condition representing the logical OR of the operand condition with this object.
static Condition HPS::Condition::OR ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An OR condition is satisfied if either of its operand conditions are satisfied.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical OR of the operand conditions.
bool HPS::Condition::ShowCondition ( UTF8 out_condition) const

Shows the condition string that has been set on this object, if any. A Condition object can only have either a number, condition string, intrinsic type, or operands.

Parameters
out_conditionThe condition string.
Returns
true if a condition string has been set, false otherwise.
bool HPS::Condition::ShowIntrinsic ( Condition::Intrinsic &  out_special) const

Shows the intrinsic type that has been set on this object, if any. A Condition object can only have either a number, condition string, intrinsic type, or operands.

Parameters
out_specialThe intrinsic type.
Returns
true if an intrinsic type has been set, false otherwise.
bool HPS::Condition::ShowNumber ( float &  out_number) const

Shows the number that has been set on this object, if any. A Condition object can only have either a number, condition string, intrinsic type, or operands.

Parameters
out_numberThe number.
Returns
true if a number has been set, false otherwise.
bool HPS::Condition::ShowOperands ( ConditionArray &  out_operands) const

Retrieves the operands, if any, of this condition object. A Condition object can only have either a number, condition string, intrinsic type, or operands.

Parameters
out_operandsAn array of condition operands.
Returns
true if operands are set on this object, false otherwise.
Condition HPS::Condition::XOR ( Condition const &  in_operand2) const

An XOR condition is satisfied if either operand condition is satisfied, but not both.

Parameters
in_operand2The condition to XOR with this object.
Returns
a new condition representing the logical XOR of the operand condition with this object.
static Condition HPS::Condition::XOR ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
static

An XOR condition is satisfied if either operand condition is satisfied, but not both.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical XOR of the operand conditions.

Friends And Related Function Documentation

HPS_API Condition AND ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An AND condition is satisfied if both of its operand conditions are satisfied.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical AND of the operand conditions.
HPS_API Condition EQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An EQ conditional expression is satisfied if its operand expressions are equal.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the equality comparison of the operand expressions.
HPS_API Condition GT ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An GT conditional expression is satisfied if its second operand is greater than the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the greater than comparison of the operand expressions.
HPS_API Condition GTEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An GTEQ conditional expression is satisfied if its second operand is greater than or equal to the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the greater than or equal to comparison of the operands.
HPS_API Condition LT ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An LT conditional expression is satisfied if its second operand is less than the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the less than comparison of the operand expressions.
HPS_API Condition LTEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An LTEQ conditional expression is satisfied if its second operand is less than or equal to the first operand.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the less than or equal to comparison of the operand expressions.
HPS_API Condition NEQ ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An NEQ conditional expression is satisfied if its operand expressions are not equal.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new conditional expression representing the non-equality comparison of the operand expressions.
HPS_API Condition NOT ( Condition const &  in_operand)
friend

A NOT condition is satisfied if its operand condition is not satisfied.

Parameters
in_operandThe condition operand.
Returns
a new condition representing the logical negation of the operand.
HPS_API Condition OR ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An OR condition is satisfied if either of its operand conditions are satisfied.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical OR of the operand conditions.
HPS_API Condition XOR ( Condition const &  in_operand1,
Condition const &  in_operand2 
)
friend

An XOR condition is satisfied if either operand condition is satisfied, but not both.

Parameters
in_operand1The first condition operand.
in_operand2The second condition operand.
Returns
a new condition representing the logical XOR of the operand conditions.

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