![]() |
Home | Libraries | People | FAQ | More |
boost::time_series::ordered_inserter — A wrapper for an OrderedInserter which itself satisfies the OrderedInserter concept and that provides some conveniences for efficiently populating a Mutable_TimeSeries.
// In header: <boost/time_series/ordered_inserter.hpp> template<typename Series> struct ordered_inserter { // types typedef concepts::Mutable_TimeSeries< Series > series_concept; typedef series_concept::value_type value_type; typedef series_concept::run_type run_type; typedef series_concept::offset_type offset_type; typedef series_concept::ordered_inserter_type inserter_type; // construct/copy/destruct ordered_inserter(Series &); ordered_inserter(Series &, offset_type); ordered_inserter& operator=(ordered_inserter const &); ordered_inserter& operator=(value_type const &); template<typename Value, typename Offset> ordered_inserter& operator=(std::pair< Value, Offset > const &); template<typename Value, typename Offset> ordered_inserter& operator=(compressed_pair< Value, Offset > const &); template<typename Value, typename Offset> ordered_inserter& operator=(tuple< Value, Offset > const &); template<typename Value, typename Offset> ordered_inserter& operator=(tuple< Value, Offset, Offset > const &); // public member functions ordered_inserter & operator*() ; ordered_inserter & operator++() ; ordered_inserter & operator++(int) ; ordered_inserter & operator()(value_type const &) ; ordered_inserter & operator()(value_type const &, offset_type) ; ordered_inserter & operator()(value_type const &, offset_type, offset_type) ; void commit() ; offset_type offset_; // For exposition only. inserter_type inserter_; // For exposition only. };
A wrapper for an OrderedInserter which itself satisfies the OrderedInserter concept and that provides some conveniences for efficiently populating a Mutable_TimeSeries.
Since ordered_inserter<> satisfies the OrderedInserter concept, it can be used anywhere an OrderedInserter is required; for example, when calling any of the RangeRunStorage algorithms.
An ordered_inserter<> also overloads the function call operator so that runs can be inserted using the following convenient syntax: inserter(value, offset, end_offset). The return value of the predeeding call is a reference to the inserter object, so successive insertion operations can be chained.
An ordered_inserter<> is also a valid STL output iterator.
ordered_inserter(Series & series);
Initializes this->inserter_ to range_run_storage::ordered_inserter(series)
| Parameters: |
|
||
| Postconditions: | this->offset_ == -inf |
||
| Notes: | implicit |
ordered_inserter(Series & series, offset_type offset);
Initializes this->inserter_ to range_run_storage::ordered_inserter(series)
| Parameters: |
|
||||
| Postconditions: | this->offset_ == offset |
ordered_inserter& operator=(ordered_inserter const &);
| Returns: | *this |
ordered_inserter& operator=(value_type const & value);
Same as (*this)(value)
| Returns: | *this |
template<typename Value, typename Offset> ordered_inserter& operator=(std::pair< Value, Offset > const & tup);
Same as (*this)(tup.first, tup.second)
| Requires: |
Value is implicitly convertible to value_type Offset is implicitly convertible to offset_type |
| Returns: | *this |
template<typename Value, typename Offset> ordered_inserter& operator=(compressed_pair< Value, Offset > const & tup);
Same as (*this)(tup.first(), tup.second())
| Requires: |
Value is implicitly convertible to value_type Offset is implicitly convertible to offset_type |
| Returns: | *this |
template<typename Value, typename Offset> ordered_inserter& operator=(tuple< Value, Offset > const & tup);
Same as (*this)(get<0>(tup), get<1>(tup))
| Requires: |
Value is implicitly convertible to value_type Offset is implicitly convertible to offset_type |
| Returns: | *this |
template<typename Value, typename Offset> ordered_inserter& operator=(tuple< Value, Offset, Offset > const & tup);
Same as (*this)(get<0>(tup), get<1>(tup), get<2>(tup))
| Requires: |
Value is implicitly convertible to value_type Offset is implicitly convertible to offset_type |
| Returns: | *this |
ordered_inserter & operator*() ;
| Returns: | *this |
ordered_inserter & operator++() ;
| Returns: | *this |
ordered_inserter & operator++(int) ;
| Returns: | *this |
ordered_inserter & operator()(value_type const & value) ;
Calls range_run_storage::set_at(this->inserter_, run_type(this->offset_, this->offset_ + 1), value)
| Requires: | -inf != this->offset_ |
| Postconditions: | this->offset_ is greater by 1. |
| Returns: | *this |
ordered_inserter & operator()(value_type const & value, offset_type offset) ;
Calls range_run_storage::set_at(this->inserter_, run_type(offset, offset + 1), value)
| Requires: | offset >= this->offset_ |
| Postconditions: | this->offset_ == offset + 1 |
| Returns: | *this |
ordered_inserter & operator()(value_type const & value, offset_type offset, offset_type endoff) ;
Calls range_run_storage::set_at(this->inserter_, std::make_pair(offset, endoff), value)
| Requires: | offset >= this->offset_ |
| Postconditions: | this->offset_ == endoff |
| Returns: | *this |
void commit() ;
Calls range_run_storage::commit(this->inserter_)