Flow123d  last_with_con_2.0.0-4-g42e6930
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
TimeMark Class Reference

Class used for marking specified times at which some events occur. More...

#include <time_marks.hh>

Public Types

typedef unsigned long int Type
 

Public Member Functions

 TimeMark (double time, Type type)
 
Type mark_type () const
 Getter for mark type. More...
 
double time () const
 Getter for the time of the TimeMark. More...
 
bool match_mask (const TimeMark::Type &mask) const
 
void add_to_type (const TimeMark::Type &type)
 
bool operator< (const TimeMark &another) const
 
bool operator== (const TimeMark &other_mark) const
 For unordered maps and sets, hashing. More...
 

Static Public Attributes

static const Type every_type = ~0x0
 Mark Type with all bits set. More...
 
static const Type none_type = 0x0
 Mark Type with all bits unset. More...
 

Private Attributes

double time_
 The marked time. More...
 
Type mark_type_
 The type of the TimeMark. More...
 

Detailed Description

Class used for marking specified times at which some events occur.

This class represents one record in the TimeMarks simple database. Class members can not be modified after the item is created.

Definition at line 36 of file time_marks.hh.

Member Typedef Documentation

typedef unsigned long int TimeMark::Type

MarkType is a bitmap where each bit represents one base type such as (Output, Input, BC change, Fixed...) This allow more complex queries through bitwise operations. Also one TimeMark can be shared by more events. In the context of TimeMarks the Type can be either fixed or vague. If a TimeGovernor is connected to the TimeMarks object the TimeMarks with fixed Type are used to match exactly their times. Base Types should be created/obtained from TimeMarks class through the TimeMarks::new_mark_type method. There are three Types predefined in TimeMarks constructor:

  • type_fixed_time (hex 0x01)
  • type_output (hex 0x02)
  • type_bc_change (hex 0x04)
    See also
    TimeMarks

Definition at line 51 of file time_marks.hh.

Constructor & Destructor Documentation

TimeMark::TimeMark ( double  time,
Type  type 
)
inline

Constructor for a TimeMarks::Mark

Parameters
timetime of the mark
typetype of the mark

In order to create a fixed TimeMark (at time=0.1) with base TimeMark::Type my_type, use the TimeMarks class: TimeMark( 0.1, timemarks.type_fixed_time() | my_type)

Definition at line 66 of file time_marks.hh.

Member Function Documentation

void TimeMark::add_to_type ( const TimeMark::Type type)
inline

Add more bits that a mark satisfies.

Parameters
typetype that should be modified

Definition at line 91 of file time_marks.hh.

Type TimeMark::mark_type ( ) const
inline

Getter for mark type.

Definition at line 71 of file time_marks.hh.

Here is the caller graph for this function:

bool TimeMark::match_mask ( const TimeMark::Type mask) const
inline

Returns true if TimeMark's type has 1 on all positions where mask has 1.

Parameters
mask{Select bits that should be 1 for matching mark types.

Definition at line 85 of file time_marks.hh.

bool TimeMark::operator< ( const TimeMark another) const
inline

Comparison of time marks according to their time.

Parameters
anotheris another Timemark which should be compared.

Definition at line 97 of file time_marks.hh.

bool TimeMark::operator== ( const TimeMark other_mark) const
inline

For unordered maps and sets, hashing.

Definition at line 101 of file time_marks.hh.

double TimeMark::time ( ) const
inline

Getter for the time of the TimeMark.

Definition at line 76 of file time_marks.hh.

Here is the caller graph for this function:

Member Data Documentation

const TimeMark::Type TimeMark::every_type = ~0x0
static

Mark Type with all bits set.

Definition at line 54 of file time_marks.hh.

Type TimeMark::mark_type_
private

The type of the TimeMark.

Definition at line 110 of file time_marks.hh.

const TimeMark::Type TimeMark::none_type = 0x0
static

Mark Type with all bits unset.

Definition at line 56 of file time_marks.hh.

double TimeMark::time_
private

The marked time.

Definition at line 108 of file time_marks.hh.


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