#include <hps.h>
|
static const HPS::Type | staticType = HPS::Type::ConditionControl |
|
static const HPS::Type | staticType = HPS::Type::Control |
|
static const HPS::Type | staticType = HPS::Type::None |
|
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.
◆ ConditionControl() [1/3]
HPS::ConditionControl::ConditionControl |
( |
SegmentKey & |
in_seg | ) |
|
|
explicit |
Initializes a control tied to the segment in_seg.
◆ ConditionControl() [2/3]
Initializes a control tied to the same object as in_that.
◆ ConditionControl() [3/3]
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
-
◆ ~ConditionControl()
HPS::ConditionControl::~ConditionControl |
( |
| ) |
|
Releases a reference to the database object this control is tied to.
◆ AddCondition()
ConditionControl& HPS::ConditionControl::AddCondition |
( |
char const * |
in_condition | ) |
|
Adds a condition to the collection of active conditions on this segment.
- Parameters
-
in_condition | the 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]
The move assignment operator transfers the underlying impl of the rvalue reference to this ConditionControl thereby avoiding a copy.
- Parameters
-
- Returns
- A reference to this ConditionControl.
◆ operator=() [2/2]
◆ 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_condition | the condition to enable. |
- Returns
- a reference to this object.
◆ SetConditions() [1/2]
Sets a collection of conditions as the only active conditions on this segment, replacing any existing conditions.
- Parameters
-
in_conditions | An 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_count | the number of conditions in the array. |
in_conditions | An 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_condition | The 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_conditions | An 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_condition | The condition to remove. |
- Returns
- a reference to this object.
◆ UnsetEverything()
Unsets all conditions on this segment.
- Returns
- a reference to this object.
The documentation for this class was generated from the following file: