#include <common.h>
Public Types | |
typedef Container::const_reference | const_reference |
typedef Container::const_iterator | const_iterator |
typedef Container::iterator | iterator |
typedef std::back_insert_iterator< Container > | insertion_iterator |
typedef Container::value_type | value_type |
typedef true_t | limit_t |
For debugging only. | |
Static Public Member Functions | |
static iterator | begin (Container &aC) |
static const_iterator | begin_const (const Container &aC) |
static iterator | end (Container &aC) |
static const_iterator | end_const (const Container &aC) |
static bool | is_not_begin (const Container &aC, iterator aEnd) |
Used to know whether we must flush a buffer of this type. | |
static size_t | ressz (const Container &aC, const_iterator aEnd) |
Returns the smallest number but bigger or equal to a container's size. | |
static size_t | max_size (void) |
We should in fact return the exact value a container will return. | |
static void | clear (Container &aCont) |
static ptrdiff_t | distance (const Container &aC) |
Not the size, but the distance between begin and end. Should be equal, but... | |
static insertion_iterator | begout (Container &aCont) |
This allows to process the same way, plain STL containers, and C-language arrays.
typedef Container::const_iterator rpa::container_traits< Container >::const_iterator |
typedef Container::const_reference rpa::container_traits< Container >::const_reference |
typedef std::back_insert_iterator< Container > rpa::container_traits< Container >::insertion_iterator |
typedef Container::iterator rpa::container_traits< Container >::iterator |
typedef true_t rpa::container_traits< Container >::limit_t |
For debugging only.
typedef Container::value_type rpa::container_traits< Container >::value_type |
static iterator rpa::container_traits< Container >::begin | ( | Container & | aC | ) | [inline, static] |
static const_iterator rpa::container_traits< Container >::begin_const | ( | const Container & | aC | ) | [inline, static] |
static insertion_iterator rpa::container_traits< Container >::begout | ( | Container & | aCont | ) | [inline, static] |
static void rpa::container_traits< Container >::clear | ( | Container & | aCont | ) | [inline, static] |
static ptrdiff_t rpa::container_traits< Container >::distance | ( | const Container & | aC | ) | [inline, static] |
Not the size, but the distance between begin and end. Should be equal, but...
static iterator rpa::container_traits< Container >::end | ( | Container & | aC | ) | [inline, static] |
static const_iterator rpa::container_traits< Container >::end_const | ( | const Container & | aC | ) | [inline, static] |
static bool rpa::container_traits< Container >::is_not_begin | ( | const Container & | aC, | |
iterator | aEnd | |||
) | [inline, static] |
Used to know whether we must flush a buffer of this type.
We cannot simply used the size of such a container, because a fixed-size array has no size - but we have the last pointer filled by the algorithm. More : We use already-allocated container where the algorithm simply rewrites over existing elements. Therefore, we must compare the latest used iterator with the actual beginning of the container.
static size_t rpa::container_traits< Container >::max_size | ( | void | ) | [inline, static] |
We should in fact return the exact value a container will return.
static size_t rpa::container_traits< Container >::ressz | ( | const Container & | aC, | |
const_iterator | aEnd | |||
) | [inline, static] |
Returns the smallest number but bigger or equal to a container's size.
ressz is used to return in constant time, the smallest possible number, but bigger or equal to the container's size. This number is used to reserve memory for copying. What is necessary is to copy only from the beginning of the container, to the iterator 'aEnd', not the end of the container. Avoids at all price any operation in linear time. For this, prefers a bit of temporary memory waste.
We could probably use 'iterator_in' : It does the same.