2 #ifndef SYDEVS_TIME_SEQUENCE_H_
3 #define SYDEVS_TIME_SEQUENCE_H_
88 const std::vector<value_type>&
partitions()
const;
91 std::vector<value_type> partitions_;
92 std::vector<duration> offsets_;
134 return partitions_.empty();
140 return int64(offsets_.size());
const time_point operator[](int64 rhs) const
Returns the time point associated with the index rhs.
Definition: time_sequence.cpp:109
const_iterator lower_bound(const time_point &tp) const
Returns an iterator to the first position tp could be inserted.
Definition: time_sequence.cpp:43
const std::vector< value_type > & partitions() const
Returns the partition indices and associated time points.
Definition: time_sequence.h:144
const time_point back() const
Returns the last time point.
Definition: time_sequence.cpp:103
bool operator<(const const_iterator &rhs) const
Definition: time_sequence.cpp:252
const_iterator operator+(int64 rhs) const
Definition: time_sequence.cpp:218
const time_sequence::value_type operator[](int64 rhs) const
Definition: time_sequence.cpp:137
bool operator>(const const_iterator &rhs) const
Definition: time_sequence.cpp:258
const_iterator & operator-=(int64 rhs)
Definition: time_sequence.cpp:211
const_iterator operator-(int64 rhs) const
Definition: time_sequence.cpp:226
int64 size() const
Returns the number of time points.
Definition: time_sequence.h:138
bool empty() const
Returns true if the time sequence is empty.
Definition: time_sequence.h:132
void append(const time_point &tp)
Appends tp if it exceeds all previously added time points.
Definition: time_sequence.cpp:14
bool operator==(const const_iterator &rhs) const
Definition: time_sequence.cpp:240
A data structure which represents a sequence of increasing time points.
Definition: time_sequence.h:59
const time_point front() const
Returns the first time point.
Definition: time_sequence.cpp:97
A data structure which represents a point in time as an arbitrary-precision multiple of its shortest ...
Definition: time_point.h:84
bool operator>=(const const_iterator &rhs) const
Definition: time_sequence.cpp:270
const_iterator & operator--()
Definition: time_sequence.cpp:164
const_iterator & operator++()
Definition: time_sequence.cpp:143
const_iterator begin() const
Returns an iterator pointing to the oldest entry.
Definition: time_sequence.cpp:31
const time_sequence::value_type * operator->() const
Definition: time_sequence.cpp:130
const_iterator & operator+=(int64 rhs)
Definition: time_sequence.cpp:185
bool operator<=(const const_iterator &rhs) const
Definition: time_sequence.cpp:264
const float64 pi
Definition: number_types.h:24
Definition: time_sequence.h:96
const_iterator end() const
Returns an iterator pointing beyond the newest entry.
Definition: time_sequence.cpp:37
int64_t int64
Definition: number_types.h:14
std::pair< int64, time_point > value_type
The type used to store each entry.
Definition: time_sequence.h:63
time_sequence & operator=(const time_sequence &)=default
Copy assignment.
const time_sequence::value_type & operator*() const
Definition: time_sequence.cpp:123
~time_sequence()=default
Destructor.
const_iterator upper_bound(const time_point &tp) const
Returns an iterator to the last position tp could be inserted.
Definition: time_sequence.cpp:73
time_sequence()
Constructs an empty time sequence.
Definition: time_sequence.cpp:7
bool operator!=(const const_iterator &rhs) const
Definition: time_sequence.cpp:246