Container. More...
#include <rcontainer.h>
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) |
RContainer & | operator= (const RContainer< C, true, bOrder > &src) |
RContainer & | operator= (const RContainer< C, false, bOrder > &src) |
template<bool a> | |
void | Copy (const RContainer< C, a, bOrder > &src) |
template<bool a, bool o> | |
RContainer & | operator+= (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) |
iRContainer & | operator= (const iRContainer< C > &src) |
void | Copy (const iRContainer< C > &src) |
iRContainer & | operator+= (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) |
iRContainer & | NormalCopy (const iRContainer< C > &src) |
void | DeepCopy (const iRContainer< C > &src) |
iRContainer & | Add (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
-
C The class of the elements to be contained. bAlloc Specify if the elements are deallocated by the container. bOrder Specify 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:
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:
At least, a compare function must be implemented in the class C:
To iterate through the container, a RCursor can be used. Here is an example of a container managing instances of the class MyElement:
- Warning
- Some methods applied on an ordered container can disorder the container.
Constructor & Destructor Documentation
|
explicit |
Constructor of a container.
- Parameters
-
m The initial maximal size of the array. i The 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
-
src Container used as source.
RContainer | ( | const RContainer< C, false, bOrder > & | src | ) |
Copy constructor of a container.
- Parameters
-
src Container used as source.
|
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
-
idx Index.
- 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
-
max Maximal 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
-
m New maximal size of the array. If null, the old size remains. i New increasing value. If null, the old value remains. force If the container isn't responsible for the deallocation, does the element be still destroyed (true) or not (force).
|
static |
Generic static template function to sort a container.
- Parameters
-
a First pointer. b Second 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
-
sortOrder Pointer to a (static) function used for the ordering. min Starting index of the container part concerned. max Ending 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.
- 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:
void ReOrder | ( | int | sortOrderconst void *, const void * | ) |
ReOrder the whole container based on a given sort function.
- Parameters
-
sortOrder Pointer to a (static) function used for the ordering.
- Warning
- This method must be used with caution, because it can crash the container if:
- The container contains null pointers.
- 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
-
min Starting index of the container part concerned. max Ending 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
-
pos1 Position of the first element. pos2 Position 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
-
idx Index of the element in the container that must become the first one. reverse Define 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
-
b Determine if the source container is responsible for the allocation. o Determine if the source container is ordered.
- Parameters
-
src Source container.
RContainer& operator= | ( | const RContainer< C, true, bOrder > & | src | ) |
The assignment operator.
- Parameters
-
src Container 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
-
src Container 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
-
a Determine if the source container is responsible for the allocation.
- Parameters
-
src Container 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
-
src Container 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. find If the element represented by tag exist, find is set to true (set by the method). min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. sortkey The tag represents the sorting key. The default value depends if the container is ordered (true) or not (false). min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. min Starting index of the container part concerned. max Ending 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
-
idx Index 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
-
idx Index 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
-
idx Index 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
-
idx Index 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. sortkey The tag represents the sorting key. The default value depends if the container is ordered (true) or not (false). min Starting index of the container's part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. sortkey The tag represents the sorting key. The default value depends if the container is ordered (true) or not (false). min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. pos The 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. min Starting index of the container part concerned. max Ending 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
-
tab Array of pointers. min Starting index of the container part concerned. max Ending 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
-
tab Array of pointers. min Starting index of the container part concerned. max Ending 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
-
tab Array of pointers. min Starting index of the container part concerned. max Ending 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
-
tab Array of pointers. min Starting index of the container part concerned. max Ending 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 :
- The function verifies not if the index used is compatible with the order in case of the elements treated in ascending order.
- 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
-
ins A pointer to the element to insert. pos The position where to insert it. del Specify 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 :
- The function verifies not if the index used is compatible with the order in case of the elements treated in ascending order.
- 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
-
ins A pointer to the element to insert. pos The 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
-
ins A pointer to the element to insert. del Specify if a similar existing element must be deleted. min Starting index of the container part concerned. max Ending 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
-
pos Position of the element. shift Specify if the the container should be shifted or if the position should be left empty. del Specify 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
-
pos Position of the element. shift Specify 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
-
pos Position 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. sortkey The tag represents the sorting key. The default value depends if the container is ordered (true) or not (false). del Specify if the object must deleted or not. min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. sortkey The tag represents the sorting key. min Starting index of the container part concerned. max Ending 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
-
TUse The type of tag, the container uses the Compare(TUse &) member function of the elements.
- Parameters
-
tag The tag used. min Starting index of the container part concerned. max Ending 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
-
src1 First container. src2 Second container.
void Union | ( | const iRContainer< C > & | src1, |
const iRContainer< C > & | src2 | ||
) |
Compute the union of two containers. The container is emptied. before.
- Parameters
-
src1 First container. src2 Second container.