![]() |
Scanframe Modular Application 0.1.0
|
Counted vector having additional methods and operators for ease of usage. This template class extends the std::vector template with easier to use methods for adding finding entries and an array operator. More...
#include <TVector.h>


Public Types | |
| typedef std::vector< T > | base_type |
| Base type of this template . | |
| typedef base_type::size_type | size_type |
| Size type of this template. | |
| typedef base_type::value_type | value_type |
| Value type contained by this vector template. | |
| typedef TIterator< value_type > | iter_type |
| Iteration type of the template. | |
| typedef const iter_type | const_iter_type |
| Iteration const type of the template. | |
Public Member Functions | |
| TVector ()=default | |
| Default constructor. | |
| TVector (const TVector &v) | |
| Copy constructor. | |
| TVector (TVector &&) noexcept=default | |
| Move constructor. | |
| TVector & | operator= (const TVector &v) noexcept |
| Assignment operator. | |
| TVector & | operator= (TVector &&v) noexcept |
| Assignment move operator. | |
| template<typename InputIterator > | |
| TVector (InputIterator first, InputIterator last) | |
| Initializing constructor using an iterator. | |
| TVector (std::initializer_list< value_type > list) | |
Initializing constructor using list like:TVector vect{1,2,3,4,5,6,7} | |
| TVector (const base_type &sv) | |
| Copy constructor for base type. | |
| TVector (size_type sz) | |
| Initializing constructor. | |
| size_type | add (const T &t) |
| Adds item at the end of the vector. | |
| size_type | add (T &&t) |
| Adds item at the end of the vector. | |
| TVector & | append (const T &t) |
| Appends an entry to the vectors items at the end of the vector. | |
| TVector & | append (T &&t) |
| Appends an entry to the vectors items at the end of the vector. | |
| TVector & | prepend (const T &t) |
| Prepends an entry to the vectors items at the beginning of the vector. | |
| TVector & | prepend (T &&t) |
| Prepends an entry to the vectors items at the beginning of the vector. | |
| size_type | add (const TVector &) |
| Adds the vectors items at the end of the vector. | |
| bool | addAt (const T &t, size_type index) |
| Adds an item at index position. | |
| bool | addAt (T &&t, size_type index) |
| Adds an item at index position. | |
| bool | detach (const T &t) |
| Removes specific item from the list by instance. Uses the compare operator from type T to find it. | |
| bool | detachAt (size_type index) |
| Removes specific item from the list by index. | |
| bool | isEmpty () const |
| Returns true when empty false otherwise. | |
| void | flush () |
| Removes all entries from the vector. | |
| void | flush (size_type stop, size_type start=0) |
| Removes specific range of entries from the vector. | |
| size_type | find (const T &) const |
| Finds an entry by instance in the vector. | |
| size_type | count () const |
| Returns the amount of entries in the vector. | |
| T & | first () |
| Gets the first element of the vector. | |
| const T & | first () const noexcept |
| Gets the first element of the vector. | |
| T & | last () |
| Gets the last element of the vector. | |
| const T & | last () const noexcept |
| Gets the last element of the vector. | |
| bool | startsWith (T t) const |
| Checks if the first element is of the passed value. | |
| bool | endsWith (T t) const |
| Checks if the last element is of the passed value. | |
| T & | get (size_type i) |
| Gets entry from index position. | |
| const T & | get (size_type i) const |
| Const version of getting entry from index position. | |
| base_type | getBase () |
| Returns the base type to access it methods explicitly. | |
| base_type | getBase () const |
| Returns the constant const base type. | |
| T & | operator[] (size_type i) |
| Reimplemented array operator. Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions. | |
| const T & | operator[] (size_type i) const |
| Const reimplemented array operator. Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions. | |
| std::ostream & | write (std::ostream &os, bool inc_hex) const |
Static Public Attributes | |
| static const size_t | npos = static_cast<size_type>(-1) |
| Value returned by various member functions when they fail. | |
Counted vector having additional methods and operators for ease of usage. This template class extends the std::vector template with easier to use methods for adding finding entries and an array operator.
| T | Type contained by the vector. |
| typedef std::vector<T> sf::TVector< T >::base_type |
Base type of this template .
| typedef const iter_type sf::TVector< T >::const_iter_type |
Iteration const type of the template.
| typedef TIterator<value_type> sf::TVector< T >::iter_type |
Iteration type of the template.
| typedef base_type::size_type sf::TVector< T >::size_type |
Size type of this template.
| typedef base_type::value_type sf::TVector< T >::value_type |
Value type contained by this vector template.
|
default |
Default constructor.
| sf::TVector< T >::TVector | ( | const TVector< T > & | v | ) |
Copy constructor.
|
defaultnoexcept |
Move constructor.
| sf::TVector< T >::TVector | ( | InputIterator | first, |
| InputIterator | last | ||
| ) |
Initializing constructor using an iterator.
| sf::TVector< T >::TVector | ( | std::initializer_list< value_type > | list | ) |
Initializing constructor using list like:
TVector vect{1,2,3,4,5,6,7}
|
explicit |
Copy constructor for base type.
|
explicit |
Initializing constructor.
| sz | Size of the vector. |
| size_type sf::TVector< T >::add | ( | const T & | t | ) |
Adds item at the end of the vector.
| size_type sf::TVector< T >::add | ( | const TVector< T > & | ) |
Adds the vectors items at the end of the vector.
| size_type sf::TVector< T >::add | ( | T && | t | ) |
Adds item at the end of the vector.
| bool sf::TVector< T >::addAt | ( | const T & | t, |
| size_type | index | ||
| ) |
Adds an item at index position.
| t | Reference of instance. |
| index | Position where to add/insert. |
| bool sf::TVector< T >::addAt | ( | T && | t, |
| size_type | index | ||
| ) |
Adds an item at index position.
| t | Reference of instance. |
| index | Position where to add/insert. |
| TVector & sf::TVector< T >::append | ( | const T & | t | ) |
Appends an entry to the vectors items at the end of the vector.
| TVector & sf::TVector< T >::append | ( | T && | t | ) |
Appends an entry to the vectors items at the end of the vector.
| size_type sf::TVector< T >::count | ( | ) | const |
Returns the amount of entries in the vector.
| bool sf::TVector< T >::detach | ( | const T & | t | ) |
Removes specific item from the list by instance. Uses the compare operator from type T to find it.
| t | Reference of instance to detach. |
| bool sf::TVector< T >::detachAt | ( | size_type | index | ) |
Removes specific item from the list by index.
| index | Index of the item. |
| bool sf::TVector< T >::endsWith | ( | T | t | ) | const |
Checks if the last element is of the passed value.
| size_type sf::TVector< T >::find | ( | const T & | ) | const |
Finds an entry by instance in the vector.
| T & sf::TVector< T >::first | ( | ) |
Gets the first element of the vector.
|
noexcept |
Gets the first element of the vector.
| void sf::TVector< T >::flush | ( | ) |
Removes all entries from the vector.
| void sf::TVector< T >::flush | ( | size_type | stop, |
| size_type | start = 0 |
||
| ) |
Removes specific range of entries from the vector.
| stop | |
| start |
| T & sf::TVector< T >::get | ( | size_type | i | ) |
Gets entry from index position.
| i | Index position |
| const T & sf::TVector< T >::get | ( | size_type | i | ) | const |
Const version of getting entry from index position.
| i | Index position |
| base_type sf::TVector< T >::getBase | ( | ) |
Returns the base type to access it methods explicitly.
| base_type sf::TVector< T >::getBase | ( | ) | const |
Returns the constant const base type.
| bool sf::TVector< T >::isEmpty | ( | ) | const |
Returns true when empty false otherwise.
| T & sf::TVector< T >::last | ( | ) |
Gets the last element of the vector.
|
noexcept |
Gets the last element of the vector.
|
noexcept |
Assignment operator.
|
noexcept |
Assignment move operator.
| T & sf::TVector< T >::operator[] | ( | size_type | i | ) |
Reimplemented array operator. Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions.
| i | Index position |
| const T & sf::TVector< T >::operator[] | ( | size_type | i | ) | const |
Const reimplemented array operator. Array operator needs reimplementation using std::vector::at() which does a range check in contrast to the std::vector::operator[] functions.
| i | Index position |
| TVector & sf::TVector< T >::prepend | ( | const T & | t | ) |
Prepends an entry to the vectors items at the beginning of the vector.
| TVector & sf::TVector< T >::prepend | ( | T && | t | ) |
Prepends an entry to the vectors items at the beginning of the vector.
| bool sf::TVector< T >::startsWith | ( | T | t | ) | const |
Checks if the first element is of the passed value.
| std::ostream & sf::TVector< T >::write | ( | std::ostream & | os, |
| bool | inc_hex | ||
| ) | const |
Writes the content to an output stream.
| os | Output stream. |
| inc_hex | Include hex notation when an integer type. |
|
static |
Value returned by various member functions when they fail.