Container. More...

#include <rcontainer.h>

Inheritance diagram for RContainer< C, bAlloc, bOrder >:
[legend]
Collaboration diagram for RContainer< C, bAlloc, bOrder >:
[legend]

Public Member Functions

 RContainer (size_t m, size_t i=0)
 
 RContainer (const RContainer< C, true, bOrder > &src)
 
 RContainer (const RContainer< C, false, bOrder > &src)
 
int Compare (const RContainer< C, bAlloc, bOrder > &) const
 
size_t GetNb (void) const
 
size_t GetMaxPos (void) const
 
size_t GetMaxNb (void) const
 
size_t GetIncNb (void) const
 
bool VerifyIndex (size_t idx) const
 
void VerifyTab (size_t max=0)
 
void Clear (size_t m=0, size_t i=0, bool force=false)
 
void ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max)
 
void ReOrder (int sortOrder(const void *, const void *))
 
void ReOrder (void)
 
void Exchange (size_t pos1, size_t pos2)
 
void Shift (size_t idx, bool reverse)
 
template<bool a, bool o>
void Transfer (RContainer< C, a, o > &src)
 
RContaineroperator= (const RContainer< C, true, bOrder > &src)
 
RContaineroperator= (const RContainer< C, false, bOrder > &src)
 
template<bool a>
void Copy (const RContainer< C, a, bOrder > &src)
 
template<bool a, bool o>
RContaineroperator+= (const RContainer< C, a, o > &src)
 
template<class TUse >
size_t GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
template<class TUse >
bool IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
template<class TUse >
bool IsIn (const TUse &tag, size_t min=0, size_t max=0) const
 
const C * operator[] (size_t idx) const
 
C * operator[] (size_t idx)
 
const C * GetPtrAt (size_t idx) const
 
C * GetPtrAt (size_t idx)
 
template<class TUse >
C * GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
template<class TUse >
C * GetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
template<class TUse >
C * GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
template<class TUse >
C * GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
template<class TUse >
C * GetInsertPtrAt (const TUse &tag, size_t pos)
 
template<class TUse >
RContainer< C, false, bOrder > * GetPtrs (const TUse &tag, size_t min=0, size_t max=0) const
 
size_t GetTab (const void **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (void **tab, size_t min=0, size_t max=0)
 
size_t GetTab (const C **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (C **tab, size_t min=0, size_t max=0)
 
void InsertPtrAt (C *ins, size_t pos, bool del)
 
void InsertPtrAt (C *ins, size_t pos)
 
void InsertPtr (C *ins, bool del=false, size_t min=0, size_t max=0)
 
void DeletePtrAt (size_t pos, bool shift, bool del)
 
void DeletePtrAt (size_t pos, bool shift)
 
void DeletePtrAt (size_t pos)
 
template<class TUse >
void DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0)
 
template<class TUse >
void DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
template<class TUse >
void DeletePtr (const TUse &tag, size_t min=0, size_t max=0)
 
void Inter (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
void Union (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
virtual ~RContainer (void)
 
- Public Member Functions inherited from iRContainer< C >
size_t GetNb (void) const
 
size_t GetMaxPos (void) const
 
size_t GetMaxNb (void) const
 
size_t GetIncNb (void) const
 
bool VerifyIndex (size_t idx) const
 
void VerifyTab (size_t max=0)
 
void Clear (size_t m=0, size_t i=0, bool force=false)
 
void ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max)
 
void ReOrder (int sortOrder(const void *, const void *))
 
void ReOrder (void)
 
void Exchange (size_t pos1, size_t pos2)
 
void Shift (size_t idx, bool reverse)
 
void Transfer (iRContainer< C > &src)
 
iRContaineroperator= (const iRContainer< C > &src)
 
void Copy (const iRContainer< C > &src)
 
iRContaineroperator+= (const iRContainer< C > &src)
 
template<class TUse >
size_t GetIndex (bool order, const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
template<class TUse >
size_t GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
template<class TUse >
bool IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
template<class TUse >
bool IsIn (const TUse &tag, size_t min=0, size_t max=0) const
 
const C * operator[] (size_t idx) const
 
C * operator[] (size_t idx)
 
const C * GetPtrAt (size_t idx) const
 
C * GetPtrAt (size_t idx)
 
template<class TUse >
C * GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
template<class TUse >
C * GetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
template<class TUse >
C * GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
template<class TUse >
C * GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
template<class TUse >
C * GetInsertPtrAt (const TUse &tag, size_t pos)
 
size_t GetTab (const void **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (void **tab, size_t min=0, size_t max=0)
 
size_t GetTab (const C **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (C **tab, size_t min=0, size_t max=0)
 
void InsertPtrAt (C *ins, size_t pos, bool del)
 
void InsertPtrAt (C *ins, size_t pos)
 
void InsertPtr (C *ins, bool del=false, size_t min=0, size_t max=0)
 
void DeletePtrAt (size_t pos, bool shift, bool del)
 
void DeletePtrAt (size_t pos, bool shift)
 
void DeletePtrAt (size_t pos)
 
template<class TUse >
void DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0)
 
template<class TUse >
void DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
template<class TUse >
void DeletePtr (const TUse &tag, size_t min=0, size_t max=0)
 
void Inter (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
void Union (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
virtual ~iRContainer (void)
 

Static Public Member Functions

static int SortOrder (const void *a, const void *b)
 
- Static Public Member Functions inherited from iRContainer< C >
static int SortOrder (const void *a, const void *b)
 

Additional Inherited Members

- Protected Member Functions inherited from iRContainer< C >
void Create (const iRContainer< C > &src)
 
iRContainerNormalCopy (const iRContainer< C > &src)
 
void DeepCopy (const iRContainer< C > &src)
 
iRContainerAdd (const iRContainer< C > &src)
 
- Protected Attributes inherited from iRContainer< C >
C ** Tab
 
size_t NbPtr
 
size_t MaxPtr
 
size_t LastPtr
 
size_t IncPtr
 

Detailed Description

template<class C, bool bAlloc, bool bOrder = false>
class R::RContainer< C, bAlloc, bOrder >

Container.

This class represent a container of elements (class C). It inherits all the methods provided by the interface defined by iRContainer. Its elements are stored in an array of pointers which will be increase when necessary. The container can be responsible for the deallocation of the elements (bAlloc), and the elements can be ordered (bOrder).

Template Parameters
CThe class of the elements to be contained.
bAllocSpecify if the elements are deallocated by the container.
bOrderSpecify if the elements are ordered in the container.

To make the necessary comparisons, the container uses member functions of the class representing the elements (class C). These functions have the signature:

int Compare(const TUse& tag) const;
int Compare(const TUse* tag) const;

The TUse represent a class or a structure used for the comparisons. These functions are working like the strcmp function from the standard C/C++ library. The result returned specifies if the tag precedes (>0), is the same (0) or is after (<0) the element used. The structure used for the Comparisons can represent or not the sort key used when the container must be ordered. The user must specify if the key used for a search is the sorting one or not.

When a lot of elements must be inserted into a ordered container, each element may require that some existing elements are shifted to the right. This can be time consumming. A better approach is then to force the elements to be inserted at the end of the container, and then to sort it:

RContainer<RString,true,true> Test(20);
Test.InsertPtrAt(new RString("This"),Test.GetNb());
Test.InsertPtrAt(new RString("is"),Test.GetNb());
Test.InsertPtrAt(new RString("a"),Test.GetNb());
Test.InsertPtrAt(new RString("little"),Test.GetNb());
Test.InsertPtrAt(new RString("test"),Test.GetNb());
Test.ReOrder();

At least, a compare function must be implemented in the class C:

int Compare(const C&) const;

To iterate through the container, a RCursor can be used. Here is an example of a container managing instances of the class MyElement:

#include <rcontainer.h>
#include <rcursor.h>
using namespace R;
class MyElement
{
size_t Id;
public:
MyElement(size_t id) : Id(id) {}
MyElement(const MyElement& e) : Id(e.Id) {}
void DoSomething(double d) {cout<<d<<endl;}
int Compare(const MyElement& e) const {return(Id-e.Id);}
int Compare(const size_t id) const {return(Id-id);}
int Compare(const char* text) const
{
size_t id=atoi(text);
return(Compare(id));
}
};
int main()
{
c.InsertPtr(new MyElement(5));
if(c.IsIn<char*>("5"))
cout<<"An element of value 5 is in the container"<<endl;
c.InsertPtr(new MyElement(10));
for(cur.Start();!cur.End();cur.Next())
cur()->DoSomething(2.3);
}
Warning
Some methods applied on an ordered container can disorder the container.

Constructor & Destructor Documentation

RContainer ( size_t  m,
size_t  i = 0 
)
explicit

Constructor of a container.

Parameters
mThe initial maximal size of the array.
iThe value used when increasing the array. If null value, the size is set to the half the maximal size and at least at 10.
RContainer ( const RContainer< C, true, bOrder > &  src)

Copy constructor of a container.

Parameters
srcContainer used as source.
RContainer ( const RContainer< C, false, bOrder > &  src)

Copy constructor of a container.

Parameters
srcContainer used as source.
virtual ~RContainer ( void  )
virtual

Destruct the container.

Member Function Documentation

int Compare ( const RContainer< C, bAlloc, bOrder > &  ) const

Compare method that can be used to construct an unordered container of containers.

size_t GetNb ( void  ) const
Returns
the number of elements in the container.
size_t GetMaxPos ( void  ) const
Returns
the maximal position occupied by an elements in the container.
size_t GetMaxNb ( void  ) const
Returns
the maximum number of elements in the container.
size_t GetIncNb ( void  ) const
Returns
the increment used to resize the container.
bool VerifyIndex ( size_t  idx) const

Verify if an index is a valid one in the container.

Parameters
idxIndex.
Returns
true if the index is valid.
void VerifyTab ( size_t  max = 0)

Verify if the container can hold a certain number of elements. If not, the container is extended.

Parameters
maxMaximal number of elements that must be contained. If null, the method verifies that one element can be added.
void Clear ( size_t  m = 0,
size_t  i = 0,
bool  force = false 
)

Clear the container and destruct the elements if it is responsible for the deallocation.The container can also be extended.

Parameters
mNew maximal size of the array. If null, the old size remains.
iNew increasing value. If null, the old value remains.
forceIf the container isn't responsible for the deallocation, does the element be still destroyed (true) or not (force).
static int SortOrder ( const void *  a,
const void *  b 
)
static

Generic static template function to sort a container.

Parameters
aFirst pointer.
bSecond pointer.
Returns
-1,0 or 1 depending of the result of the Compare method of the class of the elements contained.
void ReOrder ( int   sortOrderconst void *, const void *,
size_t  min,
size_t  max 
)

ReOrder a part of the container based on a given sort function.

Parameters
sortOrderPointer to a (static) function used for the ordering.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Warning
This method must be used with caution, because it can crash the container if:
  1. The container contains null pointers.
  2. The container is ordered and the method does not use the same criterion for the ordering.

If you want to use the 'Compare' method of the objects contained as sort method for a given range, use the SortOrder method:

RContainer<RString,true,false> Cont(10);
Cont.InsertPtr(new RString("Second"));
Cont.InsertPtr(new RString("First"));
Cont.InsertPtr(new RString("Third"));
// Sort the first two element with the default compare method of strings.
Cont.ReOrder(RContainer<RString,true,false>::SortOrder,0,2);
void ReOrder ( int   sortOrderconst void *, const void *)

ReOrder the whole container based on a given sort function.

Parameters
sortOrderPointer to a (static) function used for the ordering.
Warning
This method must be used with caution, because it can crash the container if:
  1. The container contains null pointers.
  2. The container is ordered and the method does not use the same criterion for the ordering.
void ReOrder ( void   )

ReOrder the container based on the 'Compare' method of the objects contained.

Parameters
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Warning
This method must be used with caution, because it can crash the container if the container contains null pointers.
void Exchange ( size_t  pos1,
size_t  pos2 
)

Exchange two elements in the container. The method does not verify if the exchange is compatible with the ordering of the container.

Parameters
pos1Position of the first element.
pos2Position of the second element.
Warning
If applied on an ordered container, this method can disorder it.
void Shift ( size_t  idx,
bool  reverse 
)

Shift the elements in the container. This is done by choosing an element that will become the first one. Depending from the element chosen, the elements seems to be shifted to the left or to the right:

  • Choosing 2 means that 2→0, 3→1, 4→2, LastPos→LastPos-2, 0→LastPos-1, etc. It simulates a shift to the left.
  • Choosing LastPos means LastPos→0, 0→1, 2→1, etc. It simulates a shift to the right.

While shifted, the elements may also be reverse. Let us suppose a container with the elements (0,1,2,3,4,5), and that the element 2 becomes the first one:

  • If no reverse, the result is (2,3,4,5,0,1).
  • If reverse, the result is (2,1,0,5,4).

The method does not verify if the shift is compatible with the ordering of the container.

Parameters
idxIndex of the element in the container that must become the first one.
reverseDefine if the elements are reversed (the element idx-1 becomes the second one) or not (the element idx+1 becomes the second one).
Remarks
If the shift is not reversed, a temporary container is created (with a maximal size of NbPtr/2). It makes the shift fast since the method uses the memcpy and memmove functions. If the shift is reserved, the method makes NbPtr/2 exchanges.
Warning
If applied on an ordered container, this method can disorder it.
void Transfer ( RContainer< C, a, o > &  src)

Transfer a container into another one. The destination container is cleared before.

Template Parameters
bDetermine if the source container is responsible for the allocation.
oDetermine if the source container is ordered.
Parameters
srcSource container.
RContainer& operator= ( const RContainer< C, true, bOrder > &  src)

The assignment operator.

Parameters
srcContainer used as source.
Warning
If the container is not a responsible for the allocation, the elements of src are just copied and not re-created. Use Copy if you want a "deep" copy of src.
Returns
a pointer to the container.
RContainer& operator= ( const RContainer< C, false, bOrder > &  src)

The assignment operator.

Parameters
srcContainer used as source.
Warning
If the container is not a responsible for the allocation, the elements of src are just copied and not re-created. Use Copy if you want a "deep" copy of src.
Returns
a pointer to the container.
void Copy ( const RContainer< C, a, bOrder > &  src)

Deep copy of a container.

Template Parameters
aDetermine if the source container is responsible for the allocation.
Parameters
srcContainer used as source.
RContainer& operator+= ( const RContainer< C, a, o > &  src)

Add the elements of a container. If the source container contains null elements, these elements are not copied.

Parameters
srcContainer used as source.
size_t GetIndex ( const TUse &  tag,
bool &  find,
size_t  min = 0,
size_t  max = 0 
) const

This function returns the index of an element represented by tag, and it is used when the elements are to be ordered. The search can be limited to a part of the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
findIf the element represented by tag exist, find is set to true (set by the method).
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the index of the element if it exists or the index where is has to inserted.
bool IsIn ( const TUse &  tag,
bool  sortkey,
size_t  min = 0,
size_t  max = 0 
) const

Look if a certain element is in the container. The search can be limited to a part of the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
sortkeyThe tag represents the sorting key. The default value depends if the container is ordered (true) or not (false).
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
true if the element is in the container.
bool IsIn ( const TUse &  tag,
size_t  min = 0,
size_t  max = 0 
) const

Look if a certain element is in the container. The search can be limited to a part of the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
true if the element is in the container.
const C* operator[] ( size_t  idx) const

Get a pointer to the ith element in the container (Only read). The operator generates an exception is the index is out of range.

Parameters
idxIndex of the element to get.
Returns
a pointer.
C* operator[] ( size_t  idx)

Get a pointer to the ith element in the container (Read/Write). The operator generates an exception is the index is out of range.

Parameters
idxIndex of the element to get.
Returns
a pointer.
Warning
If applied on an ordered container, this method can disorder it.
const C* GetPtrAt ( size_t  idx) const

Get a pointer of the ith element in the container (Only read).

Parameters
idxIndex of the element to get.
Returns
the pointer of null if the index is out of range.
C* GetPtrAt ( size_t  idx)

Get a pointer of the ith element in the container (Read/Write).

Parameters
idxIndex of the element to get.
Returns
the pointer of null if the index is out of range.
C* GetPtr ( const TUse &  tag,
bool  sortkey,
size_t  min = 0,
size_t  max = 0 
) const

Get a pointer to a certain element in the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
sortkeyThe tag represents the sorting key. The default value depends if the container is ordered (true) or not (false).
minStarting index of the container's part concerned.
maxEnding index of the container's part concerned.
Returns
the pointer or 0 if the element is not in the container.
C* GetPtr ( const TUse &  tag,
size_t  min = 0,
size_t  max = 0 
) const

Get a pointer to a certain element in the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the pointer or 0 if the element is not in the container.
C* GetInsertPtr ( const TUse &  tag,
bool  sortkey,
size_t  min = 0,
size_t  max = 0 
)

Get a pointer to a certain element in the container. If the element is not existing, the container creates it by using the constructor with TUse as parameter.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
sortkeyThe tag represents the sorting key. The default value depends if the container is ordered (true) or not (false).
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
a pointer to the element of the container.
C* GetInsertPtr ( const TUse &  tag,
size_t  min = 0,
size_t  max = 0 
)

Get a pointer to a certain element in the container. If the element is not existing, the container creates it by using the constructor with TUse as parameter.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
a pointer to the element of the container.
C* GetInsertPtrAt ( const TUse &  tag,
size_t  pos 
)

Get a pointer to a certain element in the container. If the element is not existing, the container creates it by using the constructor with TUse as parameter.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
posThe position where to insert it.
Returns
a pointer to the element of the container.
Warning
If applied on an ordered container, this method can disorder it.
RContainer<C,false,bOrder>* GetPtrs ( const TUse &  tag,
size_t  min = 0,
size_t  max = 0 
) const

This method returns a container of all the elements that are responding to the given criteria. This method can be limited to a part of the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
a pointer to the result container.
size_t GetTab ( const void **  tab,
size_t  min = 0,
size_t  max = 0 
) const

Copy the array of pointers into a temporary array. This array must have the right size (Read only). This method can be limited to a part of the container.

Parameters
tabArray of pointers.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the number of elements in the array (including eventually null pointers).
size_t GetTab ( void **  tab,
size_t  min = 0,
size_t  max = 0 
)

Copy the array of pointers into a temporary array. This array must have the right size (Read/Write). This method can be limited to a part of the container.

Parameters
tabArray of pointers.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the number of elements in the array (including eventually null pointers).
size_t GetTab ( const C **  tab,
size_t  min = 0,
size_t  max = 0 
) const

Copy the array of pointers into a temporary array. This array must have the right size (Read only). This method can be limited to a part of the container.

Parameters
tabArray of pointers.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the number of elements in the array (including eventually null pointers).
size_t GetTab ( C **  tab,
size_t  min = 0,
size_t  max = 0 
)

Copy the array of pointers into a temporary array. This array must have the right size (Read/Write). This method can be limited to a part of the container.

Parameters
tabArray of pointers.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
Returns
the number of elements in the array (including eventually null pointers).
void InsertPtrAt ( C *  ins,
size_t  pos,
bool  del 
)

Insert an element at a certain position. Two remarks must be made :

  1. The function verifies not if the index used is compatible with the order in case of the elements treated in ascending order.
  2. By using this function, the user can leave "blanks" in the container. In other words, some "valid" pointers could be null. This situation is not handle by the other functions of the container.
Parameters
insA pointer to the element to insert.
posThe position where to insert it.
delSpecify if the object that was previously at the position should be deleted (true) or shifted (false).
Warning
If applied on an ordered container, this method can disorder it.
void InsertPtrAt ( C *  ins,
size_t  pos 
)

Insert an element at a certain position. Two remarks must be made :

  1. The function verifies not if the index used is compatible with the order in case of the elements treated in ascending order.
  2. By using this function, the user can leave "blanks" in the container. In other words, some "valid" pointers could be null. This situation is not handle by the other functions of the container.
Parameters
insA pointer to the element to insert.
posThe position where to insert it.
Warning
If applied on an ordered container, this method can disorder it.
void InsertPtr ( C *  ins,
bool  del = false,
size_t  min = 0,
size_t  max = 0 
)

Insert an element in the container. If the container is ordered and if the corresponding index is already used, the previously inserted element is removed from the container (and destroy if the container is responsible for the allocation). This method can be limited to a part of the container.

Parameters
insA pointer to the element to insert.
delSpecify if a similar existing element must be deleted.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
void DeletePtrAt ( size_t  pos,
bool  shift,
bool  del 
)

Delete an element from the container at a given position.

Parameters
posPosition of the element.
shiftSpecify if the the container should be shifted or if the position should be left empty.
delSpecify if the object must deleted or not.
Warning
If applied on an ordered container, this method can disorder it.
void DeletePtrAt ( size_t  pos,
bool  shift 
)

Delete an element from the container at a given position. The elements are deallocated if the container is responsible for that.

Parameters
posPosition of the element.
shiftSpecify if the the container should be shifted or if the position should be left empty.
Warning
If applied on an ordered container, this method can disorder it.
void DeletePtrAt ( size_t  pos)

Delete an element from the container at a given position. The elements are shifted and deallocated if the container is responsible for that.

Parameters
posPosition of the element.
Warning
If applied on an ordered container, this method can disorder it.
void DeletePtr ( const TUse &  tag,
bool  sortkey,
bool  del,
size_t  min = 0,
size_t  max = 0 
)

Delete an element from the container. This method can be limited to a part of the container.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
sortkeyThe tag represents the sorting key. The default value depends if the container is ordered (true) or not (false).
delSpecify if the object must deleted or not.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
void DeletePtr ( const TUse &  tag,
bool  sortkey,
size_t  min = 0,
size_t  max = 0 
)

Delete an element from the container. This method can be limited to a part of the container. The elements are deallocated if the container is responsible for that.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
sortkeyThe tag represents the sorting key.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
void DeletePtr ( const TUse &  tag,
size_t  min = 0,
size_t  max = 0 
)

Delete an element from the container. This method can be limited to a part of the container. If the elements of the container are ordered, the it is supposed that the tag is a sorting key of it. The elements are deallocated if the container is responsible for that.

Template Parameters
TUseThe type of tag, the container uses the Compare(TUse &) member function of the elements.
Parameters
tagThe tag used.
minStarting index of the container part concerned.
maxEnding index of the container part concerned.
void Inter ( const iRContainer< C > &  src1,
const iRContainer< C > &  src2 
)

Compute the intersection of two containers. The container is emptied. before.

Parameters
src1First container.
src2Second container.
void Union ( const iRContainer< C > &  src1,
const iRContainer< C > &  src2 
)

Compute the union of two containers. The container is emptied. before.

Parameters
src1First container.
src2Second container.