3 #include "lazy_deque.hh"
28 :
vec(file, isBinary) {}
36 typename Container::value_type
operator[](
const std::size_t n) {
46 typename Container::value_type
at(
const std::size_t n) {
return vec.at(n); }
54 std::size_t
size()
const {
return vec.size(); }
68 bool fetch(std::size_t n) {
return vec.fetch(n); }
82 template <
class T>
class Vector :
public std::vector<T> {
86 void setFront(std::size_t) {}
87 bool fetch(std::size_t n) {
return n < this->size(); }
94 const auto getOneElem = isBinary ? getOneBinary : getOne;
96 while (getOneElem(file, elem) != EOF) {
97 this->
vec.push_back(elem);
Definition: word_container.hh:82
Container class for the input timed word.
Definition: word_container.hh:13
bool fetch(std::size_t n)
Fetch the timed words by n-th position.
Definition: word_container.hh:68
Container::value_type operator[](const std::size_t n)
Access an element of the container.
Definition: word_container.hh:36
Container vec
The actual container of the timed word.
Definition: word_container.hh:16
Container::value_type at(const std::size_t n)
Access an element of the container.
Definition: word_container.hh:46
std::size_t size() const
Returns the length of the timed word.
Definition: word_container.hh:54
void setFront(std::size_t n)
Discard the elements before n-th position.
Definition: word_container.hh:61
Word container with runtime allocation and free.
Word container without any runtime memory alloc / free.
Definition: word_container.hh:90