20 #ifndef TIME_MARKS_HH_ 21 #define TIME_MARKS_HH_ 51 typedef unsigned long int Type;
76 inline double time()
const {
186 {
return type_fixed_time_;}
191 {
return type_output_;}
196 {
return type_input_;}
289 : marks_(marks), it_(it), mask_(mask) {}
292 {
OLD_ASSERT(&marks_ == &it.
marks_,
"Can not assign TimeMarks::iterator of different container.\n");
301 while ( it_ != marks_.end() ) {
303 if (it_->match_mask(mask_))
break;
311 while ( it_ != marks_.begin() ) {
313 if (it_->match_mask(mask_))
break;
321 OLD_ASSERT(it_!= marks_.end(),
"Out of marks vector.\n");
328 OLD_ASSERT(it_!= marks_.end(),
"Out of marks vector.\n");
333 {
return it_ == other.
it_; }
336 {
return it_ != other.
it_; }
TimeMark::Type type_fixed_time()
Type mark_type() const
Getter for mark type.
bool operator<(const TimeMark &another) const
Iterator over TimeMark objects in TimeMarks object (database of TimeMark objects).
TimeMarksIterator & operator=(const TimeMarksIterator &it)
Type mark_type_
The type of the TimeMark.
TimeMark::Type type_output()
TimeMark(double time, Type type)
TimeMark::Type type_input_
Predefined type for change of boundary condition.
Basic time management functionality for unsteady (and steady) solvers (class Equation).
static const Type none_type
Mark Type with all bits unset.
static const Type every_type
Mark Type with all bits set.
TimeMarksIterator & operator--()
Prefix decrement. Skip non matching marks.
TimeMark::Type mask_
Mask type.
UnitSI operator*(const UnitSI &a, const UnitSI &b)
Product of two units.
double time_
The marked time.
bool operator==(const Null &, const Null &)
Global macros to enhance readability and debugging, general constants.
TimeMarksIterator & operator++()
Prefix increment. Skip non matching marks.
std::vector< TimeMark > marks_
TimeMarks list sorted according to the their time.
TimeMarksIterator iterator
Iterator class for iteration over time marks of particular type. This is always const_iterator.
This class is a collection of time marks to manage various events occurring during simulation time...
std::ostream & operator<<(std::ostream &stream, const TimeMark &marks)
TimeMark::Type next_mark_type_
MarkType that will be used at next new_time_mark() call.
bool match_mask(const TimeMark::Type &mask) const
TimeMark::Type mask()
Returns mask.
TimeMark::Type type_input()
TimeMarksIterator(const std::vector< TimeMark > &marks, const std::vector< TimeMark >::const_iterator &it, const TimeMark::Type &mask)
void add_to_type(const TimeMark::Type &type)
double time() const
Getter for the time of the TimeMark.
std::vector< TimeMark >::const_iterator it_
Iterator over the vector of TimeMark objects.
Class used for marking specified times at which some events occur.
TimeMark::Type type_fixed_time_
Predefined type for fixed time.
const std::vector< TimeMark > & marks_
Reference to the vector of TimeMark objects.
TimeMark::Type type_output_
Predefined type for output.