STK++ 0.9.13
|
template one dimensional Arrays. More...
#include <STK_Array1D.h>
Classes | |
class | InnerOperator |
Public Member Functions | |
Array1D () | |
Default constructor. | |
Array1D (Range const &I) | |
constructor with a specified Range | |
Array1D (Range const &I, Type const &v) | |
Misc constructor with beg and end, initialization with a constant. | |
Array1D (Array1D const &T, bool ref=false) | |
Copy constructor. | |
template<int OtherSize> | |
Array1D (Array1D< Type, OtherSize > const &T, bool ref=false) | |
Copy constructor. | |
template<int OtherSize> | |
Array1D (Array1D< Type, OtherSize > const &T, RowRange const &I, bool ref=true) | |
constructor by reference, ref_=1. | |
Array1D (Allocator const &A, Range const &I, bool ref) | |
Wrapper constructor. | |
Array1D (Type *q, Range const &I) | |
Wrapper constructor: the container is a reference of a C-Array. | |
~Array1D () | |
destructor: allocated memory is liberated by MemAllocator base class. | |
Array1D & | operator= (Array1D const &T) |
operator = : overwrite the Array1D with T. | |
template<class OtherArray > | |
Array1D & | operator= (ITContainer1D< OtherArray > const &T) |
Copy an other type of 1D array in an Array1D. | |
Array1D & | operator= (Type const &v) |
operator= : set the container to a constant value. | |
![]() | |
bool | isRef () const |
void | setRef (bool ref) const |
Modify the state of the container: this become a reference (if ref is true ) or the owner of the data (if ref is false ). | |
Allocator const & | allocator () const |
RowRange const & | rows () const |
int | beginRows () const |
int | endRows () const |
int | sizeRows () const |
ColRange | cols () const |
int | beginCols () const |
int | endCols () const |
int | sizeCols () const |
int | lastIdxRows () const |
int | lastIdxCols () const |
int | capacity () const |
Type & | elt1Impl (int pos) |
access to an element | |
TypeConst | elt1Impl (int pos) const |
access to a constant element | |
Array1D< Type_, Size_ > & | setValue (Type const &value) |
set a value to this container. | |
void | setValue (int pos, TypeConst value) |
Write a value at a given position. | |
void | shiftImpl (int beg=baseIdx) |
New beginning index for the object. | |
Array1D< Type_, Size_ > & | resizeImpl (Range const &I) |
Resize the container. | |
void | reserve (int size) |
reserve internal memory for at least size elements. | |
void | clear () |
Clear the object. | |
void | move (Array1D< Type_, Size_ > const &T) |
move T to this. | |
Array1D< Type_, Size_ > & | pushBack (int n=1) |
Add n Elements to the end of the container. | |
Array1D< Type_, Size_ > & | popBack (int n=1) |
Delete last elts of the container. | |
Array1D< Type_, Size_ > & | erase (int pos, int n=1) |
Delete n elements at the pos index to the container. | |
Array1D< Type_, Size_ > & | insertElt (int pos, int n=1) |
Insert n elements at the position pos of the container. | |
Array1D< Type_, Size_ > & | insert (int pos, Type const &v) |
STL compatibility: Insert element v at position pos of the Array. | |
Array1D< Type_, Size_ > & | insert (Range const &I, Type const &v) |
STL compatibility: Insert element v in the range I of the Array. | |
Array1D< Type_, Size_ > & | push_front (Type const &v) |
STL compatibility: push front an element. | |
Array1D< Type_, Size_ > & | push_back (Type const &v) |
STL compatibility: append an element v. | |
void | swap (int pos1, int pos2) |
Swapping the pos1 elt and the pos2 elt. | |
void | exchange (IArray1D &T) |
exchange this Container with T. | |
Array1D< Type_, Size_ > & | assign (IArray1D const &src) |
overwrite this with src . | |
void | memmove (int pos1, int pos2, int n) |
Copy n elements from pos2 to pos1, guaranteeing correct behavior for overlapping. | |
RowRange const & | range () const |
int | begin () const |
int | end () const |
int | size () const |
int | lastIdx () const |
void | decLast (int n=1) |
decrement the end of the container. | |
void | incLast (int n=1) |
increment the end of the container (can be negative). | |
void | incRange (int n=1) |
increment the range of the container (can be negative). | |
void | setRange (RowRange const &I=RowRange()) |
Set range of the rows of the container. | |
Type & | elt (int i) |
TypeConst | elt (int i) const |
![]() | |
RowRange const & | range () const |
int | begin () const |
int | end () const |
int | size () const |
int | lastIdx () const |
Iterator | beginIterator () |
Iterator | endIterator () |
ConstIterator | beginConstIterator () const |
ConstIterator | endConstIterator () const |
ReverseIterator | rbeginIterator () |
ReverseIterator | rendIterator () |
ConstReverseIterator | rbeginConstIterator () const |
ConstReverseIterator | rendConstIterator () const |
bool | empty () const |
Is there some data ? | |
Type & | elt (int i) |
TypeConst | elt (int i) const |
Type & | operator[] (int i) |
TypeConst | operator[] (int i) const |
Type & | at (int i) |
TypeConst | at (int i) const |
SubVector | sub (Range const &I) const |
Access to many elements. | |
Type & | front () |
TypeConst | front () const |
Type & | back () |
TypeConst | back () const |
void | shift (int beg) |
Derived & | resize (Range const &I=RowRange()) |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Additional Inherited Members | |
![]() | |
IArray1D () | |
Default constructor. | |
IArray1D (Range const &I) | |
constructor with a specified Range. | |
IArray1D (Range const &I, Type const &v) | |
Misc constructor with first and last, initialization with a constant. | |
IArray1D (IArray1D const &T, bool ref) | |
Copy constructor. | |
IArray1D (IArray1D< OtherDerived > const &T, bool ref) | |
Copy constructor. | |
IArray1D (IArray1D< OtherDerived > const &T, RowRange const &I, bool ref) | |
copy constructor. | |
IArray1D (Allocator const &A, Range const &I, bool ref) | |
Wrapper constructor. | |
~IArray1D () | |
destructor: allocated memory is liberated by MemAllocator class. | |
Allocator & | allocator () |
void | initialize (RowRange const &I) |
function for memory allocation and initialization. | |
void | allocate (RowRange const &I) |
function for memory allocation. | |
void | freeMem () |
Method for memory deallocation. | |
![]() | |
ITContainer1D () | |
Default constructor. | |
ITContainer1D (RowRange const &I) | |
constructor with a specified range. | |
~ITContainer1D () | |
destructor. | |
void | exchange (ITContainer1D &T) |
exchange this container with T | |
void | setRange (RowRange const &I=RowRange()) |
Set range of the rows of the container. | |
void | incRange (int n=1) |
increment the range of the container (can be negative). | |
void | incFirst (int n=1) |
increment the beginning of the container (can be negative). | |
void | decFirst (int n=1) |
decrement the beginning of the container. | |
void | incLast (int n=1) |
increment the end of the container (can be negative). | |
void | decLast (int n=1) |
decrement the end of the container. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
template one dimensional Arrays.
An Array1D is a template non-oriented container (even if the Traits
struct define it as column oriented) implementing the interface class IArray1D
.
Type | of the objects stored in the Array1D |
Size_ | size of the vector if it known. Default is UnknownSize |
Definition at line 102 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::Allocator STK::Array1D< Type_, Size_ >::Allocator |
Definition at line 106 of file STK_Array1D.h.
Definition at line 105 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::ColRange STK::Array1D< Type_, Size_ >::ColRange |
Definition at line 122 of file STK_Array1D.h.
typedef ConstIterator STK::Array1D< Type_, Size_ >::const_iterator |
Definition at line 131 of file STK_Array1D.h.
typedef ConstReverseIterator STK::Array1D< Type_, Size_ >::const_reverse_iterator |
Definition at line 133 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::ConstIterator STK::Array1D< Type_, Size_ >::ConstIterator |
Definition at line 125 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::ConstReverseIterator STK::Array1D< Type_, Size_ >::ConstReverseIterator |
Definition at line 127 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::Iterator STK::Array1D< Type_, Size_ >::Iterator |
Definition at line 124 of file STK_Array1D.h.
Definition at line 130 of file STK_Array1D.h.
typedef ReverseIterator STK::Array1D< Type_, Size_ >::reverse_iterator |
Definition at line 132 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::ReverseIterator STK::Array1D< Type_, Size_ >::ReverseIterator |
Definition at line 126 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::RowRange STK::Array1D< Type_, Size_ >::RowRange |
Definition at line 121 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::Type STK::Array1D< Type_, Size_ >::Type |
Definition at line 118 of file STK_Array1D.h.
typedef hidden::Traits<Array1D<Type_,Size_>>::TypeConst STK::Array1D< Type_, Size_ >::TypeConst |
Definition at line 119 of file STK_Array1D.h.
Enumerator | |
---|---|
structure_ | |
orient_ | |
sizeCols_ | |
sizeRows_ | |
size_ | |
storage_ |
Definition at line 108 of file STK_Array1D.h.
|
inline |
constructor with a specified Range
I | range of the container |
Definition at line 142 of file STK_Array1D.h.
Misc constructor with beg and end, initialization with a constant.
I,v | range and initial value of the container |
Definition at line 146 of file STK_Array1D.h.
|
inline |
Copy constructor.
T | the container to copy |
ref | true if T is wrapped |
Definition at line 151 of file STK_Array1D.h.
|
inline |
Copy constructor.
T | the container to copy |
ref | true if T is wrapped |
Definition at line 157 of file STK_Array1D.h.
|
inline |
constructor by reference, ref_=1.
T,I | the container and the range of data to wrap |
ref | true if T is wrapped (the default) |
Definition at line 163 of file STK_Array1D.h.
Wrapper constructor.
A,I | range and allocator to wrap |
ref | true if A is wrapped |
Definition at line 169 of file STK_Array1D.h.
|
inline |
Wrapper constructor: the container is a reference of a C-Array.
q,I | pointer and range of data |
Definition at line 173 of file STK_Array1D.h.
|
inline |
destructor: allocated memory is liberated by MemAllocator base class.
Definition at line 175 of file STK_Array1D.h.
operator = : overwrite the Array1D with T.
T | the container to copy |
Definition at line 179 of file STK_Array1D.h.
References STK::IArray1D< Array1D< Type_, Size_ > >::assign().
|
inline |
Copy an other type of 1D array in an Array1D.
T | the array to copy |
Definition at line 185 of file STK_Array1D.h.
References STK::IArray1D< Array1D< Type_, Size_ > >::begin(), STK::IArray1D< Array1D< Type_, Size_ > >::elt(), STK::IArray1D< Array1D< Type_, Size_ > >::end(), STK::IArray1D< Array1D< Type_, Size_ > >::range(), and STK::ITContainer1D< Derived >::resize().
|
inline |
operator= : set the container to a constant value.
v | the value to set |
Definition at line 195 of file STK_Array1D.h.
References STK::IArray1D< Array1D< Type_, Size_ > >::begin(), STK::IArray1D< Array1D< Type_, Size_ > >::elt(), and STK::IArray1D< Array1D< Type_, Size_ > >::end().