3#include "lazy_deque.hh"
13template <
class Container>
29 :
vec(file, isBinary) {}
37 typename Container::value_type
operator[](
const std::size_t n) {
47 typename Container::value_type
at(
const std::size_t n) {
return vec.at(n); }
55 std::size_t
size()
const {
return vec.size(); }
69 bool fetch(std::size_t n) {
return vec.fetch(n); }
83template <
class T>
class Vector :
public std::vector<T> {
87 void setFront(std::size_t) {}
88 bool fetch(std::size_t n) {
return n < this->size(); }
95 const auto getOneElem = isBinary ? getOneBinary : getOne;
97 while (getOneElem(file, elem) != EOF) {
98 this->
vec.push_back(elem);
Definition word_container.hh:83
Container class for the input timed word.
Definition word_container.hh:14
bool fetch(std::size_t n)
Fetch the timed words by n-th position.
Definition word_container.hh:69
Container::value_type operator[](const std::size_t n)
Access an element of the container.
Definition word_container.hh:37
WordContainer(FILE *file, bool isBinary=false)
The constructor.
Definition word_container.hh:28
Container vec
The actual container of the timed word.
Definition word_container.hh:17
Container::value_type at(const std::size_t n)
Access an element of the container.
Definition word_container.hh:47
std::size_t size() const
Returns the length of the timed word.
Definition word_container.hh:55
void setFront(std::size_t n)
Discard the elements before n-th position.
Definition word_container.hh:62
Word container with runtime allocation and free.
Word container without any runtime memory alloc / free.
Definition word_container.hh:91