# Frost::s_ctnr_t< T, C > Class Template Reference

Base type : container (sequence). More...

`#include <frost_utils_ctnr.h>`

List of all members.

## Public Types

typedef T | ValueType
typedef C | ContainerType
typedef C::iterator | iterator
typedef C::const_iterator | const_iterator
typedef s_range< iterator > | range
typedef s_range< const_iterator > | const_range

## Public Member Functions

| s_ctnr_t ()
| Default constructor.
virtual | ~s_ctnr_t ()
| Destructor.
| s_ctnr_t (const s_ctnr_t &mCtnr)
| Copy constructor.
template<class N , class M >
| s_ctnr_t (const s_ctnr_t< N, M > &mCtnr)
| Conversion constructor.
| s_ctnr_t (const ValueType &mElem)
| Constructor.
template<default_uint N>
| s_ctnr_t (const s_array< ValueType, N > &lElemArray)
| Constructor.
ValueType & | Back ()
| Returns the last element of this container.
const ValueType & | Back () const
| Returns the last element of this container.
void | PushBack (const ValueType &mElem)
| Adds a value at the end of the container.
void | PushBack (const s_ctnr_t &lArray)
| Adds a set of values at the end of the container.
void | PopBack ()
| Removes the last value of the container.
void | PopBack (const s_uint_t< default_uint > &uiNbr)
| Removes values from the end of the container.
ValueType & | Front ()
| Returns the first element of this container.
const ValueType & | Front () const
| Returns the first element of this container.
void | PushFront (const ValueType &mElem)
| Adds a value at the beginning of the container.
void | PushFront (const s_ctnr_t &lArray)
| Adds a set of values at the beginning of the container.
void | PopFront ()
| Removes the first value of the container.
void | PopFront (const s_uint_t< default_uint > &uiNbr)
| Removes values from the beginning of the container.
void | Clear ()
| Removes all elements from this container.
void | Resize (const s_uint_t< default_uint > &uiSize, const ValueType &mElem=ValueType())
| Inserts or erases elements from the end of this container.
s_bool | Find (const ValueType &mElem) const
| Searches the container for the provided element.
s_bool | Find (const ValueType &mElem, const s_uint_t< default_uint > &uiStart) const
| Searches the container for the provided element.
s_uint_t< default_uint > | FindPos (const ValueType &mElem) const
| Searches the container for the provided element.
s_uint_t< default_uint > | FindPos (const ValueType &mElem, const s_uint_t< default_uint > &uiStart) const
| Searches the container for the provided element.
iterator | Get (const ValueType &mElem)
| Searches the container for the provided element.
iterator | Get (const ValueType &mElem, const s_uint_t< default_uint > &uiStart)
| Searches the container for the provided element.
const_iterator | Get (const ValueType &mElem) const
| Searches the container for the provided element.
const_iterator | Get (const ValueType &mElem, const s_uint_t< default_uint > &uiStart) const
| Searches the container for the provided element.
iterator | Insert (const iterator &mIter, const T &mValue)
| Inserts an element before mIter.
iterator | Insert (const iterator &mIter, const range &mRange)
| Inserts all values in a range before mIter.
iterator | Insert (const iterator &mIter, const s_ctnr_t &mContainer)
| Inserts the content of a container before mIter.
void | Erase (const s_uint_t< default_uint > &uiPos)
| Erases an element from the container.
iterator | Erase (const iterator &mIter)
| Erases an element from the container.
void | EraseRange (const s_uint_t< default_uint > &uiStart, const s_uint_t< default_uint > &uiEnd)
| Erases a range of elements from the container.
iterator | EraseRange (const iterator &mBegin, const iterator &mEnd)
| Erases a range of elements from the container.
iterator | EraseRange (const range &mRange)
| Erases a range of elements from the container.
s_uint_t< default_uint > | GetSize () const
| Returns the number of elements in this container.
s_bool | IsEmpty () const
| Checks if this container is empty.
void | Reverse ()
| Inverts the order of the elements.
void | Sort ()
| Sorts the elements of this container according to the "<" operator.
template<default_uint N>
s_ctnr_t & | operator= (const s_array< ValueType, N > &lElemArray)
ValueType & | operator[] (const s_uint_t< default_uint > &uiIndex)
const ValueType & | operator[] (const s_uint_t< default_uint > &uiIndex) const
ValueType & | operator[] (const default_uint &uiIndex)
const ValueType & | operator[] (const default_uint &uiIndex) const
iterator | Begin ()
const_iterator | Begin () const
iterator | End ()
const_iterator | End () const
iterator | begin ()
const_iterator | begin () const
iterator | end ()
const_iterator | end () const

## Protected Attributes

ContainerType | mContainer_

## Detailed Description

### template<class T, class C>
class Frost::s_ctnr_t< T, C >

Base type : container (sequence).

This is a generic 1D container. It is implemented by an std::deque for s_ctnr, and an std::vector for s_array.

Definition at line 16 of file frost_utils_ctnr.h.

## Member Typedef Documentation

template<class T, class C>

typedef C::const_iterator Frost::s_ctnr_t< T, C >::const_iterator

Definition at line 23 of file frost_utils_ctnr.h.

template<class T, class C>

typedef s_range<const_iterator> Frost::s_ctnr_t< T, C >::const_range

Definition at line 25 of file frost_utils_ctnr.h.

template<class T, class C>

typedef C Frost::s_ctnr_t< T, C >::ContainerType

Definition at line 21 of file frost_utils_ctnr.h.

template<class T, class C>

typedef C::iterator Frost::s_ctnr_t< T, C >::iterator

Definition at line 22 of file frost_utils_ctnr.h.

template<class T, class C>

typedef s_range<iterator> Frost::s_ctnr_t< T, C >::range

Definition at line 24 of file frost_utils_ctnr.h.

template<class T, class C>

typedef T Frost::s_ctnr_t< T, C >::ValueType

Reimplemented in Frost::s_ctnr< T >, Frost::s_array< T, 0 >, Frost::s_ctnr< s_str >, and Frost::s_ctnr< s_refptr< Directory > >.

Definition at line 20 of file frost_utils_ctnr.h.

## Constructor & Destructor Documentation

template<class T, class C>

Frost::s_ctnr_t< T, C >::s_ctnr_t | ( |  | ) | `[inline]`

Default constructor.

Definition at line 28 of file frost_utils_ctnr.h.

template<class T, class C>

virtual Frost::s_ctnr_t< T, C >::~s_ctnr_t | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 33 of file frost_utils_ctnr.h.

template<class T, class C>

Frost::s_ctnr_t< T, C >::s_ctnr_t | ( | const s_ctnr_t< T, C > & | mCtnr | ) | `[inline]`

Copy constructor.

Definition at line 38 of file frost_utils_ctnr.h.

template<class T, class C>
template<class N , class M >

Frost::s_ctnr_t< T, C >::s_ctnr_t | ( | const s_ctnr_t< N, M > & | mCtnr | ) | `[inline]`

Conversion constructor.

Definition at line 45 of file frost_utils_ctnr.h.

template<class T, class C>

Frost::s_ctnr_t< T, C >::s_ctnr_t | ( | const ValueType & | mElem | ) | `[inline]`

Constructor.

Parameters:

  | mElem | The first element of the sequence

Note:
  You can use this constructor, but it's main use is to build s_ctnr_t by enclosing a series of values by parenthesis (if these values have implemented the ',' operator).

Definition at line 58 of file frost_utils_ctnr.h.

template<class T, class C>
template<default_uint N>

Frost::s_ctnr_t< T, C >::s_ctnr_t | ( | const s_array< ValueType, N > & | lElemArray | ) | `[inline]`

Constructor.

Parameters:

  | lElemArray | The array to use to initialize this s_ctnr_t

Note:
  Takes every elements contained by the s_array and puts them inside this s_ctnr_t.

Definition at line 82 of file frost_utils_ctnr.h.

## Member Function Documentation

template<class T, class C>

const ValueType& Frost::s_ctnr_t< T, C >::Back | ( |  | ) | const`[inline]`

Returns the last element of this container.

Returns:
  The last element of this container

Note:
  You should check this container is not empty before calling this function.

Definition at line 103 of file frost_utils_ctnr.h.

template<class T, class C>

ValueType& Frost::s_ctnr_t< T, C >::Back | ( |  | ) | `[inline]`

Returns the last element of this container.

Returns:
  The last element of this container

Note:
  You should check this container is not empty before calling this function.

Definition at line 93 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::begin | ( |  | ) | const`[inline]`

Definition at line 500 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::begin | ( |  | ) | `[inline]`

Definition at line 495 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::Begin | ( |  | ) | const`[inline]`

Definition at line 480 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Begin | ( |  | ) | `[inline]`

Definition at line 475 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::Clear | ( |  | ) | `[inline]`

Removes all elements from this container.

Definition at line 210 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::end | ( |  | ) | const`[inline]`

Definition at line 510 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::end | ( |  | ) | `[inline]`

Definition at line 505 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::End | ( |  | ) | const`[inline]`

Definition at line 490 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::End | ( |  | ) | `[inline]`

Definition at line 485 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Erase | ( | const iterator & | mIter | ) | `[inline]`

Erases an element from the container.

Parameters:

  | mIter | The iterator pointing at the element you want to remove

Returns:
  The iterator pointing at the next element in the container

Note:
  If the provided iterator was pointing to the last element, then End() is returned.

Definition at line 377 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::Erase | ( | const s_uint_t< default_uint > & | uiPos | ) | `[inline]`

Erases an element from the container.

Parameters:

  | uiPos | The position of the element to erase

Definition at line 365 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::EraseRange | ( | const range & | mRange | ) | `[inline]`

Erases a range of elements from the container.

Parameters:

  | mRange | The range to erase

Returns:
  The iterator pointing at the next element in the container

Definition at line 411 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::EraseRange | ( | const iterator & | mBegin,
|  | const iterator & | mEnd |
| ) |  |  | `[inline]`

Erases a range of elements from the container.

Parameters:

  | mBegin | The position from which to start erasing
  | mEnd | The position at which to stop erasing (exclusive)

Returns:
  The iterator pointing at the next element in the container

Definition at line 402 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::EraseRange | ( | const s_uint_t< default_uint > & | uiStart,
|  | const s_uint_t< default_uint > & | uiEnd |
| ) |  |  | `[inline]`

Erases a range of elements from the container.

Parameters:

  | uiStart | The position from which to start erasing
  | uiEnd | The position at which to stop erasing (exclusive)

Definition at line 386 of file frost_utils_ctnr.h.

template<class T, class C>

s_bool Frost::s_ctnr_t< T, C >::Find | ( | const ValueType & | mElem,
|  | const s_uint_t< default_uint > & | uiStart |
| ) |  |  | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for
  | uiStart | The position from which to start searching

Returns:
  'true' if the element has been found

Definition at line 242 of file frost_utils_ctnr.h.

template<class T, class C>

s_bool Frost::s_ctnr_t< T, C >::Find | ( | const ValueType & | mElem | ) | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for

Returns:
  'true' if the element has been found

Definition at line 232 of file frost_utils_ctnr.h.

template<class T, class C>

s_uint_t<default_uint> Frost::s_ctnr_t< T, C >::FindPos | ( | const ValueType & | mElem,
|  | const s_uint_t< default_uint > & | uiStart |
| ) |  |  | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for
  | uiStart | The position from which to start searching

Returns:
  The position of the element in the container

Note:
  If the element is not present in the container, this function returns s_uint::NaN.

Definition at line 269 of file frost_utils_ctnr.h.

template<class T, class C>

s_uint_t<default_uint> Frost::s_ctnr_t< T, C >::FindPos | ( | const ValueType & | mElem | ) | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for

Returns:
  The position of the element in the container

Note:
  If the element is not present in the container, this function returns s_uint::NaN.

Definition at line 253 of file frost_utils_ctnr.h.

template<class T, class C>

const ValueType& Frost::s_ctnr_t< T, C >::Front | ( |  | ) | const`[inline]`

Returns the first element of this container.

Returns:
  The first element of this container

Note:
  You should check this container is not empty before calling this function.

Definition at line 162 of file frost_utils_ctnr.h.

template<class T, class C>

ValueType& Frost::s_ctnr_t< T, C >::Front | ( |  | ) | `[inline]`

Returns the first element of this container.

Returns:
  The first element of this container

Note:
  You should check this container is not empty before calling this function.

Definition at line 152 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::Get | ( | const ValueType & | mElem,
|  | const s_uint_t< default_uint > & | uiStart |
| ) |  |  | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for
  | uiStart | The position from which to start searching

Returns:
  An iterator pointing to this element

Note:
  If the element is not present in the container, this function returns End().

Definition at line 319 of file frost_utils_ctnr.h.

template<class T, class C>

const_iterator Frost::s_ctnr_t< T, C >::Get | ( | const ValueType & | mElem | ) | const`[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for

Returns:
  An iterator pointing to this element

Note:
  If the element is not present in the container, this function returns End().

Definition at line 307 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Get | ( | const ValueType & | mElem,
|  | const s_uint_t< default_uint > & | uiStart |
| ) |  |  | `[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for
  | uiStart | The position from which to start searching

Returns:
  An iterator pointing to this element

Note:
  If the element is not present in the container, this function returns End().

Definition at line 295 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Get | ( | const ValueType & | mElem | ) | `[inline]`

Searches the container for the provided element.

Parameters:

  | mElem | The element to search for

Note:
  If the element is not present in the container, this function returns End().

Definition at line 283 of file frost_utils_ctnr.h.

template<class T, class C>

s_uint_t<default_uint> Frost::s_ctnr_t< T, C >::GetSize | ( |  | ) | const`[inline]`

Returns the number of elements in this container.

Returns:
  The number of elements in this container

Definition at line 419 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Insert | ( | const iterator & | mIter,
|  | const s_ctnr_t< T, C > & | mContainer |
| ) |  |  | `[inline]`

Inserts the content of a container before mIter.

Parameters:

  | mIter | The reference iterator
  | mContainer | The container to insert

Returns:
  An iterator pointing to the last inserted value

Definition at line 354 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Insert | ( | const iterator & | mIter,
|  | const range & | mRange |
| ) |  |  | `[inline]`

Inserts all values in a range before mIter.

Parameters:

  | mIter | The reference iterator
  | mRange | The range containing values to insert

Returns:
  An iterator pointing to the last inserted value

Note:
  The last element of the range will not be inserted.

Definition at line 341 of file frost_utils_ctnr.h.

template<class T, class C>

iterator Frost::s_ctnr_t< T, C >::Insert | ( | const iterator & | mIter,
|  | const T & | mValue |
| ) |  |  | `[inline]`

Inserts an element before mIter.

Parameters:

  | mIter | The reference iterator
  | mValue | The value to insert

Returns:
  An iterator pointing to the inserted value

Definition at line 330 of file frost_utils_ctnr.h.

template<class T, class C>

s_bool Frost::s_ctnr_t< T, C >::IsEmpty | ( |  | ) | const`[inline]`

Checks if this container is empty.

Returns:
  'true' if this container is empty

Definition at line 427 of file frost_utils_ctnr.h.

template<class T, class C>
template<default_uint N>

s_ctnr_t& Frost::s_ctnr_t< T, C >::operator= | ( | const s_array< ValueType, N > & | lElemArray | ) | `[inline]`

Definition at line 445 of file frost_utils_ctnr.h.

template<class T, class C>

const ValueType& Frost::s_ctnr_t< T, C >::operator[] | ( | const default_uint & | uiIndex | ) | const`[inline]`

Definition at line 470 of file frost_utils_ctnr.h.

template<class T, class C>

ValueType& Frost::s_ctnr_t< T, C >::operator[] | ( | const default_uint & | uiIndex | ) | `[inline]`

Definition at line 465 of file frost_utils_ctnr.h.

template<class T, class C>

const ValueType& Frost::s_ctnr_t< T, C >::operator[] | ( | const s_uint_t< default_uint > & | uiIndex | ) | const`[inline]`

Definition at line 460 of file frost_utils_ctnr.h.

template<class T, class C>

ValueType& Frost::s_ctnr_t< T, C >::operator[] | ( | const s_uint_t< default_uint > & | uiIndex | ) | `[inline]`

Definition at line 455 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PopBack | ( | const s_uint_t< default_uint > & | uiNbr | ) | `[inline]`

Removes values from the end of the container.

Parameters:

  | uiNbr | The number of value to remove

Definition at line 136 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PopBack | ( |  | ) | `[inline]`

Removes the last value of the container.

Definition at line 128 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PopFront | ( | const s_uint_t< default_uint > & | uiNbr | ) | `[inline]`

Removes values from the beginning of the container.

Parameters:

  | uiNbr | The number of value to remove

Definition at line 198 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PopFront | ( |  | ) | `[inline]`

Removes the first value of the container.

Definition at line 190 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PushBack | ( | const s_ctnr_t< T, C > & | lArray | ) | `[inline]`

Adds a set of values at the end of the container.

Parameters:

  | lArray | The array of value to add

Note:
  Order is preserved.

Definition at line 120 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PushBack | ( | const ValueType & | mElem | ) | `[inline]`

Adds a value at the end of the container.

Parameters:

  | mElem | The value to add

Definition at line 111 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PushFront | ( | const s_ctnr_t< T, C > & | lArray | ) | `[inline]`

Adds a set of values at the beginning of the container.

Parameters:

  | lArray | The array of value to add

Note:
  Order is preserved.

Definition at line 179 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::PushFront | ( | const ValueType & | mElem | ) | `[inline]`

Adds a value at the beginning of the container.

Parameters:

  | mElem | The value to add

Definition at line 170 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::Resize | ( | const s_uint_t< default_uint > & | uiSize,
|  | const ValueType & | mElem = `ValueType()` |
| ) |  |  | `[inline]`

Inserts or erases elements from the end of this container.

Parameters:

  | uiSize | The new size of the container
  | mElem | The dummy element to append is the new size is greater than the current one

Note:
  If uiSize is superior to the container's current size, mElem is appended as many time as neccessary to fit the new size. Else, elements are erased.

Definition at line 223 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::Reverse | ( |  | ) | `[inline]`

Inverts the order of the elements.

Definition at line 433 of file frost_utils_ctnr.h.

template<class T, class C>

void Frost::s_ctnr_t< T, C >::Sort | ( |  | ) | `[inline]`

Sorts the elements of this container according to the "<" operator.

Definition at line 439 of file frost_utils_ctnr.h.

## Member Data Documentation

template<class T, class C>

ContainerType Frost::s_ctnr_t< T, C >::mContainer_`[protected]`

Definition at line 517 of file frost_utils_ctnr.h.

The documentation for this class was generated from the following file:

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_ctnr.h