Container class for the input timed word.
More...
#include <word_container.hh>
|
| | WordContainer (FILE *file, bool isBinary=false) |
| | The constructor.
|
| |
| Container::value_type | operator[] (const std::size_t n) |
| | Access an element of the container.
|
| |
| Container::value_type | at (const std::size_t n) |
| | Access an element of the container.
|
| |
| std::size_t | size () const |
| | Returns the length of the timed word.
|
| |
| void | setFront (std::size_t n) |
| | Discard the elements before n-th position.
|
| |
| bool | fetch (std::size_t n) |
| | Fetch the timed words by n-th position.
|
| |
|
|
Container | vec |
| | The actual container of the timed word.
|
| |
template<class Container>
class WordContainer< Container >
Container class for the input timed word.
- Note
- This class just defines the interface of the container. The actual definition must be done in the class Container passed by template argument. An example is LazyDeque.
◆ WordContainer()
template<class Container >
The constructor.
- Parameters
-
| [in] | file | The name of the file that the input timed word is in. If the container does not use the timed word in a file (e.g., when a result of simulation is directly passed), this can be ignored. |
| [in] | isBinary | A flag if the input is in a binary file. |
◆ at()
template<class Container >
| Container::value_type WordContainer< Container >::at |
( |
const std::size_t |
n | ) |
|
|
inline |
Access an element of the container.
- Note
- If the argument is out of range, out_of_range exception can be thrown.
- Parameters
-
| [in] | n | A position in the timed word |
- Returns
- The n-th element in the timed word
◆ fetch()
template<class Container >
Fetch the timed words by n-th position.
- Parameters
-
| [in] | n | A position in the timed word |
- Returns
- It returns true if and only if the fetch succeeded.
◆ operator[]()
template<class Container >
| Container::value_type WordContainer< Container >::operator[] |
( |
const std::size_t |
n | ) |
|
|
inline |
Access an element of the container.
- Note
- If the argument is out of range, out_of_range exception can be thrown.
- Parameters
-
| [in] | n | A position in the timed word |
- Returns
- The n-th element in the timed word
◆ setFront()
template<class Container >
Discard the elements before n-th position.
- Note
- If n is out of range, out_of_range exception may be thrown.
- Parameters
-
| [in] | n | A position in the timed word |
◆ size()
template<class Container >
Returns the length of the timed word.
- Note
- If the length of the timed word is unknown (e.g., when the stream does not reach the end yet), the maximum value of std::size_t is returned.
- Returns
- The length of the timed word, if it is known.
The documentation for this class was generated from the following file: