#include <tp_timeconstraint.h>
Semantically, the elementary constraints are combibed by conjunction, ie the TimeConstraint is satisfied if all ElemConstraint s are satisfied. This implementation also maintains the clock symboltable to may cloc indices to symbolic names.
ClockConstraints | Set of elementary clock constraints |
Definition at line 243 of file tp_timeconstraint.h.
Public Types | |
typedef std::set< ElemConstraint >::const_iterator | Iterator |
Iterator to access ElemConstraints. | |
typedef std::set< ElemConstraint >::const_reverse_iterator | RIterator |
Reverse iterator to access ElemConstraints. | |
typedef ElemConstraint::Operator | Operator |
Convenience typedef for operators. | |
Public Member Functions | |
TimeConstraint (void) | |
Construct an empty TimeConstraint (allways satisfied). | |
TimeConstraint (const TimeConstraint &rOtherTimeConstraint) | |
Copy constructor. | |
TimeConstraint (const std::string &rFilename, const std::string &rLabel="TimeConstraint") | |
Constructor from file. | |
~TimeConstraint (void) | |
Destructor. | |
SymbolTable * | ClockSymbolTablep (void) const |
Get Pointer to mpClockSymbolTable. | |
void | ClockSymbolTablep (SymbolTable *pSymTab) |
Set Pointer to mpClockSymbolTable. | |
void | Write (void) const |
Write to console. | |
void | Write (const std::string &rFileName, const std::string &rLabel="TimeConstraint", std::ios::openmode openmode=std::ios::out|std::ios::trunc) const |
Write to file with label (default: "TimeConstraint") and openmode (default: truncate file). | |
void | Write (TokenWriter &tw) const |
Write to TokenWriter. | |
void | Write (TokenWriter &tw, const std::string &rLabel) const |
Write to TokenWriter with a given label. | |
std::string | ToString (void) const |
Write to a std::string. | |
void | DWrite (void) const |
Write NameSet to console, debug version. | |
void | DWrite (TokenWriter &tw) const |
Write to TokenWriter, debug version. | |
void | Read (const std::string &rFileName, const std::string &rLabel="TimeConstraint") |
Read from file. | |
void | Read (TokenReader &tr, const std::string &rLabel="TimeConstraint") |
Read from tokenreader. | |
std::string | Name (void) const |
Return name of Constraint. | |
void | Name (const std::string &rName) |
Set name of Constraint. | |
bool | Empty (void) const |
Checks if TimeConstraint containts no ElemConstraints. | |
Idx | Size (void) const |
Returns number of ElemConstraint s. | |
Iterator | Insert (const ElemConstraint &rElemConstr) |
Adds an elementary clock constraint to the time constraint. | |
Iterator | Insert (const std::string clockname, Operator op, const tpTime::Type timeconst) |
Adds an elementary clock constraint to the time constraint. | |
Iterator | Insert (Idx clockindex, Operator op, const tpTime::Type timeconst) |
Adds an elementary clock constraint to the time constraint. | |
void | Insert (const std::list< ElemConstraint > &rNewConstraints) |
Adds a list of elementary clock constraints to the time constraint. | |
void | Insert (const TimeConstraint &rOtherTimeConstraint) |
Adds elementary clock constraints from other TimeConstant to the time constraint. | |
TimeConstraint & | operator<< (const TimeConstraint &rOtherTimeConstraint) |
Convenience operator to combine a TimeConstraint with another TimeConstraint. | |
TimeConstraint & | operator<< (const ElemConstraint &rElemConstr) |
Convenience operator to combines a TimeConstraint with an elementary TimeConstraint. | |
std::set< ElemConstraint > | ClockConstraints (void) const |
Returns copy of ClockConstraints. | |
Idx | InsClock (const std::string &rClockName) const |
Advertise clock to ClockSymbolTable and retrive index. | |
std::string | ClockName (Idx clockindex) const |
Lookup clock name. | |
Idx | ClockIndex (const std::string &rClockName) const |
Lookup clock index. | |
std::string | EStr (const ElemConstraint &rElemConstr) const |
Pretty printable string of elem. | |
bool | EraseByClock (Idx clock) |
Removes all elementary clock constraints refering to a specified clock. | |
Iterator | Erase (Iterator it) |
Calls std::set::erase(iterator). | |
bool | Erase (const ElemConstraint &rElemConstr) |
Removes elementary clock constraint. | |
bool | Erase (const std::string &rClockName, Operator op, const tpTime::Type timeconst) |
Removes elementary clock constraint. | |
bool | Erase (Idx clockindex, Operator op, const tpTime::Type timeconst) |
Removes elementary clock constraint. | |
void | Clear (void) |
Clear all. | |
bool | Exists (const ElemConstraint &rElemConstr) const |
Checks if elementary clock constraint is contained in constraint. | |
Iterator | Begin (void) const |
Iterator to begin of set. | |
Iterator | End (void) const |
Iterator to end of set. | |
RIterator | RBegin (void) const |
Reverse iterator that yields the ElemConstraints in reverse order starting at the last element and ending after the first. | |
RIterator | REnd (void) const |
Reverse iterator that yields the ElemConstraints in reverse order starting at the last element and ending after the first. | |
Iterator | Begin (Idx clock) const |
Iterator to first constraint with specified clock. | |
Iterator | End (Idx clock) const |
Iterator to first constraint just behind specified clock. | |
ClockSet | ActiveClocks (void) const |
Returns a Clockset containing all clocks used by the TimeConstraint. | |
TimeInterval | Interval (Idx clockindex) const |
Given a clock, compute the timeinterval in which the constraint is satisfied. | |
TimeInterval | Interval (const std::string &clockname) const |
Given a clock, compute the timeinterval in which the constraint is satisfied. | |
void | Interval (Idx clockindex, const TimeInterval &rInterval) |
Given a clock and an interval, set up the constraint such that it is valid in the given interval. | |
void | Interval (const std::string &rClockName, const TimeInterval &rInterval) |
Given a clock and an interval, set up the constraint such that it is valid in the given interval. | |
void | Minimize (void) |
Minimize by eliminating redundant elementary constraints. | |
Protected Types | |
typedef std::set< ElemConstraint >::iterator | iterator |
nonconst iterator to access ElemConstraints | |
Protected Attributes | |
std::string | mName |
My name. | |
std::set< ElemConstraint > | mClockConstraints |
Set of elementary clock constraints. | |
SymbolTable * | mpClockSymbolTable |
SymbolTable for clock names. |
|
nonconst iterator to access ElemConstraints
Definition at line 752 of file tp_timeconstraint.h. |
|
Iterator to access ElemConstraints.
Definition at line 248 of file tp_timeconstraint.h. |
|
Convenience typedef for operators.
Definition at line 254 of file tp_timeconstraint.h. |
|
Reverse iterator to access ElemConstraints.
Definition at line 251 of file tp_timeconstraint.h. |
|
Construct an empty TimeConstraint (allways satisfied).
Definition at line 144 of file tp_timeconstraint.cpp. |
|
Copy constructor.
Definition at line 158 of file tp_timeconstraint.cpp. |
|
Constructor from file. Uses Read() to scan a file for specified label to read the constraint.
Definition at line 151 of file tp_timeconstraint.cpp. |
|
Destructor.
Definition at line 167 of file tp_timeconstraint.cpp. |
|
Returns a Clockset containing all clocks used by the TimeConstraint.
Definition at line 398 of file tp_timeconstraint.cpp. |
|
Iterator to first constraint with specified clock.
Definition at line 388 of file tp_timeconstraint.cpp. |
|
Iterator to begin of set.
Definition at line 367 of file tp_timeconstraint.cpp. |
|
Clear all.
Definition at line 359 of file tp_timeconstraint.cpp. |
|
Returns copy of ClockConstraints.
Definition at line 283 of file tp_timeconstraint.cpp. |
|
Lookup clock index.
Definition at line 208 of file tp_timeconstraint.cpp. |
|
Lookup clock name.
Definition at line 203 of file tp_timeconstraint.cpp. |
|
Set Pointer to mpClockSymbolTable.
Definition at line 176 of file tp_timeconstraint.cpp. |
|
Get Pointer to mpClockSymbolTable.
Definition at line 171 of file tp_timeconstraint.cpp. |
|
Write to TokenWriter, debug version.
Definition at line 560 of file tp_timeconstraint.cpp. |
|
Write NameSet to console, debug version.
Definition at line 554 of file tp_timeconstraint.cpp. |
|
Checks if TimeConstraint containts no ElemConstraints.
Definition at line 188 of file tp_timeconstraint.cpp. |
|
Iterator to first constraint just behind specified clock.
Definition at line 393 of file tp_timeconstraint.cpp. |
|
Iterator to end of set.
Definition at line 373 of file tp_timeconstraint.cpp. |
|
Removes elementary clock constraint.
Definition at line 330 of file tp_timeconstraint.cpp. |
|
Removes elementary clock constraint.
Definition at line 339 of file tp_timeconstraint.cpp. |
|
Removes elementary clock constraint.
Definition at line 318 of file tp_timeconstraint.cpp. |
|
Calls std::set::erase(iterator). ElemConstraint refered by it is removed from constraint.
Definition at line 307 of file tp_timeconstraint.cpp. |
|
Removes all elementary clock constraints refering to a specified clock.
Definition at line 289 of file tp_timeconstraint.cpp. |
|
Pretty printable string of elem. constraint
Definition at line 214 of file tp_timeconstraint.cpp. |
|
Checks if elementary clock constraint is contained in constraint.
Definition at line 348 of file tp_timeconstraint.cpp. |
|
Advertise clock to ClockSymbolTable and retrive index.
Definition at line 198 of file tp_timeconstraint.cpp. |
|
Adds elementary clock constraints from other TimeConstant to the time constraint.
Definition at line 267 of file tp_timeconstraint.cpp. |
|
Adds a list of elementary clock constraints to the time constraint.
Definition at line 256 of file tp_timeconstraint.cpp. |
|
Adds an elementary clock constraint to the time constraint.
Definition at line 235 of file tp_timeconstraint.cpp. |
|
Adds an elementary clock constraint to the time constraint.
Definition at line 244 of file tp_timeconstraint.cpp. |
|
Adds an elementary clock constraint to the time constraint.
Definition at line 224 of file tp_timeconstraint.cpp. |
|
Given a clock and an interval, set up the constraint such that it is valid in the given interval.
Definition at line 449 of file tp_timeconstraint.cpp. |
|
Given a clock and an interval, set up the constraint such that it is valid in the given interval.
Definition at line 455 of file tp_timeconstraint.cpp. |
|
Given a clock, compute the timeinterval in which the constraint is satisfied.
Definition at line 411 of file tp_timeconstraint.cpp. |
|
Given a clock, compute the timeinterval in which the constraint is satisfied.
Definition at line 417 of file tp_timeconstraint.cpp. |
|
Minimize by eliminating redundant elementary constraints. The current implemantation retrieves the time constraints as intervals per clock and then converts back to a time constraint. Definition at line 482 of file tp_timeconstraint.cpp. |
|
Set name of Constraint.
Definition at line 417 of file tp_timeconstraint.h. |
|
Return name of Constraint.
Definition at line 409 of file tp_timeconstraint.h. |
|
Convenience operator to combines a TimeConstraint with an elementary TimeConstraint.
Definition at line 508 of file tp_timeconstraint.h. |
|
Convenience operator to combine a TimeConstraint with another TimeConstraint.
Definition at line 497 of file tp_timeconstraint.h. |
|
Reverse iterator that yields the ElemConstraints in reverse order starting at the last element and ending after the first. See set<...>rbegin(void). Returns the "End".
Definition at line 378 of file tp_timeconstraint.cpp. |
|
Read from tokenreader. Clears before. It is an error if the file contains an index
Definition at line 577 of file tp_timeconstraint.cpp. |
|
Read from file. Reads specified label by creating a tokenreader and calling read(tr)
Definition at line 571 of file tp_timeconstraint.cpp. |
|
Reverse iterator that yields the ElemConstraints in reverse order starting at the last element and ending after the first. See set<...>rend(void). Returns the "Begin".
Definition at line 383 of file tp_timeconstraint.cpp. |
|
Returns number of ElemConstraint s.
Definition at line 193 of file tp_timeconstraint.cpp. |
|
Write to a std::string.
Definition at line 546 of file tp_timeconstraint.cpp. |
|
Write to TokenWriter with a given label.
Definition at line 518 of file tp_timeconstraint.cpp. |
|
Write to TokenWriter. The name of the constraint is used as the label in the file.
Definition at line 512 of file tp_timeconstraint.cpp. |
|
Write to file with label (default: "TimeConstraint") and openmode (default: truncate file).
Definition at line 498 of file tp_timeconstraint.cpp. |
|
Write to console.
Definition at line 492 of file tp_timeconstraint.cpp. |
|
Set of elementary clock constraints.
Definition at line 746 of file tp_timeconstraint.h. |
|
My name.
Definition at line 743 of file tp_timeconstraint.h. |
|
SymbolTable for clock names.
Definition at line 749 of file tp_timeconstraint.h. |