HPS::ConditionControl Class Reference

#include <hps.h>

Inheritance diagram for HPS::ConditionControl:
HPS::Control HPS::Object

Public Member Functions

ConditionControlAddCondition (char const *in_condition)
 
 ConditionControl (SegmentKey &in_seg)
 
 ConditionControl (ConditionControl const &in_that)
 
 ConditionControl (ConditionControl &&in_that)
 
size_t GetCount () const
 
HPS::Type ObjectType () const
 
ConditionControloperator= (ConditionControl &&in_that)
 
ConditionControloperator= (ConditionControl const &in_that)
 
ConditionControlSetCondition (char const *in_condition)
 
ConditionControlSetConditions (UTF8Array const &in_conditions)
 
ConditionControlSetConditions (size_t in_count, UTF8 const in_conditions [])
 
bool ShowCondition (char const *in_condition) const
 
bool ShowConditions (UTF8Array &out_conditions) const
 
virtual HPS::Type Type () const
 
ConditionControlUnsetCondition (char const *in_condition)
 
ConditionControlUnsetEverything ()
 
 ~ConditionControl ()
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::ConditionControl
 
- Static Public Attributes inherited from HPS::Control
static const HPS::Type staticType = HPS::Type::Control
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 
- Protected Member Functions inherited from HPS::Control
 Control (Control &&in_that)
 
Controloperator= (Control &&in_that)
 

Detailed Description

The ConditionControl class is a smart pointer that is tied to a database object. This class is used to set and unset conditions on a segment. A condition can be used to control when a style is applied, or to control when an included segment is included.

Constructor & Destructor Documentation

◆ ConditionControl() [1/3]

HPS::ConditionControl::ConditionControl ( SegmentKey in_seg)
explicit

Initializes a control tied to the segment in_seg.

◆ ConditionControl() [2/3]

HPS::ConditionControl::ConditionControl ( ConditionControl const &  in_that)

Initializes a control tied to the same object as in_that.

◆ ConditionControl() [3/3]

HPS::ConditionControl::ConditionControl ( ConditionControl &&  in_that)

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

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

◆ ~ConditionControl()

HPS::ConditionControl::~ConditionControl ( )

Releases a reference to the database object this control is tied to.

Member Function Documentation

◆ AddCondition()

ConditionControl& HPS::ConditionControl::AddCondition ( char const *  in_condition)

Adds a condition to the collection of active conditions on this segment.

Parameters
in_conditionthe condition to enable.
Returns
a reference to this object.

◆ GetCount()

size_t HPS::ConditionControl::GetCount ( ) const

Retrieves the number of conditions set on this segment.

Returns
The number of conditions set on this segment.

◆ ObjectType()

HPS::Type HPS::ConditionControl::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

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

Reimplemented from HPS::Control.

◆ operator=() [1/2]

ConditionControl& HPS::ConditionControl::operator= ( ConditionControl &&  in_that)

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

Parameters
in_thatAn rvalue reference to a ConditionControl to take the impl from.
Returns
A reference to this ConditionControl.

◆ operator=() [2/2]

ConditionControl& HPS::ConditionControl::operator= ( ConditionControl const &  in_that)

Share the underlying smart-pointer of the ConditionControl source.

Parameters
in_thatThe ConditionControl source of the assignment.
Returns
A reference to this ConditionControl.

◆ SetCondition()

ConditionControl& HPS::ConditionControl::SetCondition ( char const *  in_condition)

Sets a condition as the only active condition on this segment, replacing any existing conditions.

Parameters
in_conditionthe condition to enable.
Returns
a reference to this object.

◆ SetConditions() [1/2]

ConditionControl& HPS::ConditionControl::SetConditions ( UTF8Array const &  in_conditions)

Sets a collection of conditions as the only active conditions on this segment, replacing any existing conditions.

Parameters
in_conditionsAn array of conditions to enable.
Returns
a reference to this object.

◆ SetConditions() [2/2]

ConditionControl& HPS::ConditionControl::SetConditions ( size_t  in_count,
UTF8 const  in_conditions[] 
)

Sets a collection of conditions as the only active conditions on this segment, replacing any existing conditions.

Parameters
in_countthe number of conditions in the array.
in_conditionsAn array of conditions to enable.
Returns
a reference to this object.

◆ ShowCondition()

bool HPS::ConditionControl::ShowCondition ( char const *  in_condition) const

Queries the existence of one condition on this segment.

Parameters
in_conditionThe condition in question.
Returns
true if the setting is valid, false otherwise.

◆ ShowConditions()

bool HPS::ConditionControl::ShowConditions ( UTF8Array out_conditions) const

Shows all conditions on this segment.

Parameters
out_conditionsAn array of conditions that are active on the segment.
Returns
true if any conditions are set, false otherwise.

◆ Type()

virtual HPS::Type HPS::ConditionControl::Type ( ) const
inlinevirtual

This function returns the true type of the underlying object. This function is useful for finding the type of smart pointer objects that have been cast to more generic types.

Warning
This function must synchronize the database (by waiting for all pending database operations to complete) in order to know the type status of this object with certainty. Therefore this function can negatively impact performance. You should vigorously avoid using this function in high-traffic or peformance-critical areas of your code.
Returns
The true type of the object in question.

Reimplemented from HPS::Control.

◆ UnsetCondition()

ConditionControl& HPS::ConditionControl::UnsetCondition ( char const *  in_condition)

Removes a specified condition from the active conditions on this segment.

Parameters
in_conditionThe condition to remove.
Returns
a reference to this object.

◆ UnsetEverything()

ConditionControl& HPS::ConditionControl::UnsetEverything ( )

Unsets all conditions on this segment.

Returns
a reference to this object.

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