Detailed Description

Model of an elementary clock constraint formula.

The constraint consists of an index of a clock, a comperative operator and a constant time value. Semantically, an elementary contraint is satisfied at a time t if at that time the clock value compares true with the constant time. The clock index 0 is used to indicate an invalid contraint. It is only the context of the more general TimeContraint that provides a reference to a clock SymbolTable.

Parameters
mClockClock index
mCompOperatorSymbolic integer value for comperative operator
mTimeConstantTime constant for comparison

Definition at line 125 of file tp_timeconstraint.h.

#include <tp_timeconstraint.h>

Public Types

enum  Operator { GreaterEqual , GreaterThan , LessThan , LessEqual }
 Typedef for comparison operators in elementary clock constraints. More...
 

Public Member Functions

 ElemConstraint (void)
 Construct an (invalid) elementary clock constraint (clockindex 0) More...
 
 ElemConstraint (Idx clockindex, Operator op, Time::Type timeconst)
 Construct an elementary clock constraint from values. More...
 
void Set (Idx clockindex, Operator op, Time::Type timeconst)
 Set all values. More...
 
Idx Clock (Idx newClock)
 Set clock by index. More...
 
Idx Clock (void) const
 Get clock by index. More...
 
void CompOperator (Operator newOp)
 Set operator. More...
 
Operator CompOperator (void) const
 Get operator. More...
 
void TimeConstant (Time::Type newTimeConst)
 Set time constant. More...
 
Time::Type TimeConstant (void) const
 Get time constant. More...
 
std::string Str (void) const
 Writes ElemConstraint to std::string. More...
 
bool operator== (const ElemConstraint &otherElemConstraint) const
 Test for equality. More...
 
bool operator!= (const ElemConstraint &otherElemConstraint) const
 Test for equality. More...
 
bool operator< (const ElemConstraint &otherElemConstraint) const
 Less operator for ordering in container classes. More...
 

Static Public Member Functions

static std::string OperatorName (Operator op)
 Conversion from symbolic operator to string. More...
 

Protected Attributes

Idx mClockIndex
 Index of clock. More...
 
Operator mCompOperator
 Comparative operator. More...
 
Time::Type mTimeConstant
 Time constant to compare with clock value. More...
 

Member Enumeration Documentation

◆ Operator

Typedef for comparison operators in elementary clock constraints.

Enumerator
GreaterEqual 
GreaterThan 
LessThan 
LessEqual 

Definition at line 133 of file tp_timeconstraint.h.

Constructor & Destructor Documentation

◆ ElemConstraint() [1/2]

faudes::ElemConstraint::ElemConstraint ( void  )

Construct an (invalid) elementary clock constraint (clockindex 0)

Definition at line 107 of file tp_timeconstraint.cpp.

◆ ElemConstraint() [2/2]

faudes::ElemConstraint::ElemConstraint ( Idx  clockindex,
Operator  op,
Time::Type  timeconst 
)

Construct an elementary clock constraint from values.

Parameters
clockindexClock by index.
opSymbolic value for operator
timeconstValue for time constant

Definition at line 112 of file tp_timeconstraint.cpp.

Member Function Documentation

◆ Clock() [1/2]

Idx faudes::ElemConstraint::Clock ( Idx  newClock)

Set clock by index.

Definition at line 125 of file tp_timeconstraint.cpp.

◆ Clock() [2/2]

Idx faudes::ElemConstraint::Clock ( void  ) const

Get clock by index.

Returns
clock index

Definition at line 131 of file tp_timeconstraint.cpp.

◆ CompOperator() [1/2]

void faudes::ElemConstraint::CompOperator ( Operator  newOp)

Set operator.

Parameters
newOpSymbolic value of new operator

Definition at line 136 of file tp_timeconstraint.cpp.

◆ CompOperator() [2/2]

ElemConstraint::Operator faudes::ElemConstraint::CompOperator ( void  ) const

Get operator.

Returns
Operator

Definition at line 142 of file tp_timeconstraint.cpp.

◆ operator!=()

bool faudes::ElemConstraint::operator!= ( const ElemConstraint otherElemConstraint) const

Test for equality.

Parameters
otherElemConstraintOther elementary constraint
Returns
True if not equal; see operator==.

Definition at line 174 of file tp_timeconstraint.cpp.

◆ operator<()

bool faudes::ElemConstraint::operator< ( const ElemConstraint otherElemConstraint) const

Less operator for ordering in container classes.

Parameters
otherElemConstraintOther ElemConstraint
Returns
True when clock index of left constraint is less than the one of right constraint. Else false.

Definition at line 179 of file tp_timeconstraint.cpp.

◆ operator==()

bool faudes::ElemConstraint::operator== ( const ElemConstraint otherElemConstraint) const

Test for equality.

Parameters
otherElemConstraintOther elementary constraint
Returns
True if mClockIndex, mTimeConstant and mCompOperator are equal. Else false.

Definition at line 167 of file tp_timeconstraint.cpp.

◆ OperatorName()

std::string faudes::ElemConstraint::OperatorName ( Operator  op)
static

Conversion from symbolic operator to string.

Definition at line 95 of file tp_timeconstraint.cpp.

◆ Set()

void faudes::ElemConstraint::Set ( Idx  clockindex,
Operator  op,
Time::Type  timeconst 
)

Set all values.

Parameters
clockindexClock by index.
opSymbolic value for operator
timeconstValue for time constant

Definition at line 118 of file tp_timeconstraint.cpp.

◆ Str()

std::string faudes::ElemConstraint::Str ( void  ) const

Writes ElemConstraint to std::string.

Returns
std::string

Definition at line 158 of file tp_timeconstraint.cpp.

◆ TimeConstant() [1/2]

void faudes::ElemConstraint::TimeConstant ( Time::Type  newTimeConst)

Set time constant.

Parameters
newTimeConstValue of new time constant

Definition at line 148 of file tp_timeconstraint.cpp.

◆ TimeConstant() [2/2]

Time::Type faudes::ElemConstraint::TimeConstant ( void  ) const

Get time constant.

Returns
Time constant

Definition at line 153 of file tp_timeconstraint.cpp.

Member Data Documentation

◆ mClockIndex

Idx faudes::ElemConstraint::mClockIndex
protected

Index of clock.

Definition at line 252 of file tp_timeconstraint.h.

◆ mCompOperator

Operator faudes::ElemConstraint::mCompOperator
protected

Comparative operator.

Definition at line 255 of file tp_timeconstraint.h.

◆ mTimeConstant

Time::Type faudes::ElemConstraint::mTimeConstant
protected

Time constant to compare with clock value.

Definition at line 258 of file tp_timeconstraint.h.


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

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen