C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
One-dimensional array of pointers. More...
#include <templ_fdp_array.h>
Public Member Functions | |
FDPArray () | |
Constructor. | |
FDPArray (size_t i_upper, uint16 i_delta, DestroyFunc fd) | |
Constructor. | |
virtual | ~FDPArray () |
Destructor. | |
bool | OwnsElem () const |
Whether a function of deletion of elements is set? | |
void | OwnsElem (DestroyFunc fd) |
Set a function of deletion of elements. | |
bool | SetSize (size_t newSize, bool clear) |
Functions that allocate potentially large memory, return an operation result (success/error). More... | |
void | Flush (DelType=defDelete) |
Delete all elements. | |
void | Clear (TotalDestroyFunc) |
Delete all elements. | |
Type * | RemoveObj (Type *delObject, DelType del=defDelete) |
Delete an element from array by the pointer. | |
virtual Type * | RemoveInd (size_t delIndex, DelType del=defDelete) |
Delete an element from array by the index. | |
Type * | DestroyInd (size_t delIndex, DestroyFunc) |
Delete an element from array. | |
Type * | DestroyObj (Type *delObject, DestroyFunc) |
Delete an element from array. | |
virtual void | clear () |
Set the number of elements to null. | |
FDPArray (FDPArray< Type > &&) | |
Constructor of an array moving. | |
FDPArray< Type > & | operator= (FDPArray< Type > &&) |
Operator of an array moving. | |
![]() | |
RPArray () | |
Constructor. | |
RPArray (size_t i_upper, uint16 i_delta=1) | |
Constructor. | |
virtual | ~RPArray () |
Destructor. | |
uint16 | Delta () const |
Get the increment by the number of elements while the allocation of additional memory. | |
size_t | Upper () const |
The number of elements the memory is allocated for. | |
void | Delta (uint16 newDelta) |
Set the increment by the number of elements while the allocation of additional memory (1 - autoincrement). | |
void | SetMaxDelta (uint16 newDelta) |
Set the maximum increment. | |
bool | SetSize (size_t newSize) |
Functions that allocate potentially large memory, return an operation result (success/error). More... | |
bool | Reserve (size_t n, bool addAdditionalSpace=true) |
Reserve space for a given number of elements. | |
bool | Add (Type *) |
Add an element to the end of the array. | |
bool | AddAt (Type *e, size_t index) |
Insert an element to the given position. | |
bool | AddAfter (Type *e, size_t index) |
Add an element after the specified one. | |
bool | Insert (size_t index, Type *) |
Insert an element before the specified one. | |
bool | AddArray (const RPArray< Type > &) |
Add array. | |
bool | AddCArray (const Type **, size_t count) |
Add C-array. | |
bool | InsertArray (const RPArray< Type > &, size_t index) |
Add an array to the position. | |
void | DetachAll () |
Delete all elements and set the number of elements to null. | |
void | Adjust () |
Free the unnecessary memory. | |
Type * | DetachInd (size_t delIndex) |
Detach an element from the array. | |
bool | DetachObj (const Type *delObject) |
Detach an element from the array. | |
void | Swap (RPArray &arr) |
Swap data of arrays. | |
size_t | FindIt (const Type *) const |
Find an element by a pointer. | |
bool | IsExist (const Type *) const |
Whether an element belongs the array. | |
size_t | Count () const |
Get the number of array elements. | |
ptrdiff_t | MaxIndex () const |
Get the index of the last element in the array. | |
void | Sort (CompFunc comp) |
Sort the array. | |
Type *& | operator[] (size_t loc) const |
Access by index operator. | |
Type * | GetLast () const |
Get the address of the last element in the array. | |
size_t | size () const |
Get the number of elements in array. | |
bool | reserve (size_t n) |
Reserve space for a given number of elements. | |
size_t | capacity () const |
What is the number of elements the memory is allocated for? | |
void | push_back (const Type *e) |
Add an element to the end of the array. | |
void | emplace_back (const Type *e) |
Add an element to the end of the array. | |
template<class Iterator > | |
void | insert (Iterator pos, const Type *e) |
Insert an element before the specified one. | |
template<class Iterator > | |
void | erase (Iterator pos) |
Delete an element from array by the index. | |
template<class Iterator > | |
void | erase (Iterator first, Iterator last) |
Delete elements from the array from first to last-1 inclusively. | |
void | shrink_to_fit () |
Free the unnecessary memory (Reduce capacity). | |
const TPtr * | begin () const |
Get the pointer to the first array element. | |
TPtr * | begin () |
Get the pointer to the first array element. | |
const TPtr * | end () const |
Get the pointer to the piece of memory after the array. | |
TPtr * | end () |
Get the pointer to the piece of memory after the array. | |
const TPtr * | cbegin () const |
Get the pointer to the first array element. | |
const TPtr * | cend () const |
Get the pointer to the piece of memory after the array. | |
RPArray (RPArray< Type > &&) | |
Constructor of an array moving. | |
RPArray< Type > & | operator= (RPArray< Type > &&) |
Operator of an array moving. | |
Additional Inherited Members | |
![]() | |
typedef Type * | TPtr |
A name of the pointer to the object. | |
typedef int(* | CompFunc) (const Type **, const Type **) |
A template of sorting function. | |
![]() | |
const Type ** | GetAddr () const |
Get the pointer to the first array element. | |
const TPtr * | _Begin () const |
Get the pointer to the first array element. | |
TPtr * | _Begin () |
Get the pointer to the first array element. | |
const TPtr * | _End () const |
Get the pointer to the piece of memory after the array. | |
bool | CatchMemory () |
Catch memory. | |
bool | AddMemory (size_t n) |
Provide memory for n elements, independently from AutoDelta. | |
size_t | AutoDelta () const |
Calculate autoincrement. | |
![]() | |
size_t | count |
The number of elements in array. | |
size_t | upper |
The number of elements the memory is allocated for. | |
uint16 | delta |
Increment by the number of elements while the allocation of additional memory. | |
One-dimensional array of pointers.
One-dimensional array of pointers to objects.
It may be used for the classes with pointers. Deletion of objects is performed by the function of deletion.
Attention! Destructing of large arrays is performed slower than in PArray.
In order to avoid of losing time Clear( TotalDestroyFunc ) should be used.
|
inline |
Functions that allocate potentially large memory, return an operation result (success/error).
Set the new size of an array.