BaseLinkArray Class Reference

#include <c4d_baselinkarray.h>

Inheritance diagram for BaseLinkArray:

Constructor/Destructor

 ~BaseLinkArray ()
 
void FlushAll ()
 

Get link/node/baselist

Int32 Find (GeListNode *bl, BaseDocument *doc) const
 
BaseLinkGetIndexLink (Int32 i) const
 
GeListNodeGetIndex (Int32 i, BaseDocument *doc) const
 
BaseList2DGetIndexBl (Int32 i, BaseDocument *doc, Int32 instanceof=110050) const
 

Append/Remove

Bool Append (GeListNode *bl)
 
Bool Remove (Int32 n)
 

Miscellaneous

Int32 GetRealCount (BaseDocument *doc) const
 

Additional Inherited Members

- Public Types inherited from BaseArray< BaseLink * >
typedef BaseLinkValueType
 
typedef DefaultAllocator AllocatorType
 
typedef IteratorTemplate< false > Iterator
 
typedef IteratorTemplate< true > ConstIterator
 
- Public Member Functions inherited from BaseArray< BaseLink * >
 BaseArray ()
 
 BaseArray (const DefaultAllocator &a)
 
 BaseArray (BaseArray &&src)
 
BaseArrayoperator= (BaseArray &&src)
 
 ~BaseArray ()
 
void Reset ()
 
void Flush ()
 
Int GetCount () const
 
Bool IsEmpty () const
 
Int GetCapacityCount () const
 
const BaseLink * & operator[] (Int idx) const
 
BaseLink * & operator[] (Int idx)
 
BaseLink * * Append ()
 
BaseLink * * Append (const BaseLink * &x)
 
BaseLink * * Append (BaseLink * &&x)
 
BaseLink * * Insert (Int position)
 
Iterator Insert (Iterator position)
 
BaseLink * * Insert (Int position, const BaseLink * &x)
 
Iterator Insert (Iterator position, const BaseLink * &x)
 
BaseLink * * Insert (Int position, BaseLink * &&x)
 
Iterator Insert (Iterator position, BaseLink * &&x)
 
BaseLink * * Insert (Int position, const BaseLink * *x, Int insertCnt)
 
Iterator Insert (Iterator position, const BaseLink * *x, Int insertCnt)
 
BaseLink * * Erase (Int position, Int eraseCnt=1)
 
Iterator Erase (Iterator position, Int eraseCnt=1)
 
const BaseLink * * GetFirst () const
 
BaseLink * * GetFirst ()
 
const BaseLink * * GetLast () const
 
BaseLink * * GetLast ()
 
Bool Resize (Int newCnt, BASEARRAYRESIZEFLAGS resizeFlags=BASEARRAYRESIZEFLAGS_DEFAULT)
 
Bool Pop (BaseLink * *dst=nullptr)
 
Int GetIndex (const BaseLink * &x) const
 
Bool EnsureCapacity (Int requestedCapacity)
 
Bool CopyFrom (const SourceArray &src, Bool fitToSize=true)
 
Bool CopyFrom (const BaseArray &src, Bool fitToSize)
 
Bool CopyFrom (const BaseArray &src)
 
void Swap (Iterator a, Iterator b)
 
ConstIterator Begin () const
 
Iterator Begin ()
 
ConstIterator End () const
 
Iterator End ()
 
Bool MoveAndShrink (BaseArray< BaseLink *, BASEARRAY_DEFAULT_CHUNK_SIZE, BASEARRAYFLAGS_0, DefaultAllocator > &dst, Int position, Int moveCnt)
 
BaseLink * * Disconnect (Int *dst=nullptr)
 
DefaultAllocatorGetAllocator ()
 
BaseLink * * AppendWithoutConstructor (Int increment=1)
 
BaseLink * * InsertWithoutConstructor (Int idx, Int increment=1)
 
- Protected Member Functions inherited from BaseArray< BaseLink * >
Bool FitToSize (Int newCapacity)
 
- Static Protected Member Functions inherited from DefaultAllocator
static Int ComputeArraySize (Int current_size, Int increment, Int min_chunk_size)
 
static void * Alloc (Int32 s)
 
static void * Alloc (Int64 s)
 
static void * AllocClear (Int32 s)
 
static void * AllocClear (Int64 s)
 
static void * Realloc (void *p, Int n)
 
template<class T >
static void Free (T *&p)
 
- Protected Attributes inherited from BaseArray< BaseLink * >
BaseLink * * _ptr
 
Int _cnt
 
Int _capacity
 

Detailed Description

A helper class to handle BaseLink instances.

Since
17.008

Constructor & Destructor Documentation

◆ ~BaseLinkArray()

Destructor.

Member Function Documentation

◆ FlushAll()

void FlushAll ( )

Frees all the base links in the array.

◆ Find()

Int32 Find ( GeListNode bl,
BaseDocument doc 
) const

Searches for a specific bl in the array and returns its index.

Parameters
[in]blThe node to find. The caller owns the pointed node.
[in]docThe document for bl. The caller owns the pointed document.
Returns
The BaseLink's index in the array, or NOTOK if it was not found.

◆ GetIndexLink()

BaseLink* GetIndexLink ( Int32  i) const

Gets the base link at index i.

Parameters
[in]iThe index of the base link to get. 0 <= i < GetCount()
Returns
The base link. The array owns the pointed base link.

◆ GetIndex()

GeListNode* GetIndex ( Int32  i,
BaseDocument doc 
) const

Gets the node at index i.

Parameters
[in]iThe index of the node to get. 0 <= i < GetCount()
[in]docThe document for the node. The caller owns the pointed document.
Returns
The node. The array owns the pointed node.

◆ GetIndexBl()

BaseList2D* GetIndexBl ( Int32  i,
BaseDocument doc,
Int32  instanceof = 110050 
) const

Gets the base list at index i.

Parameters
[in]iThe index of the base list to get. 0 <= i < GetCount()
[in]docThe document for the base list. The caller owns the pointed document.
[in]instanceofChecked against GeListNode::IsInstanceOf(). Pass NOTOK to ignore this test. Default to Tbaselist2d.
Returns
The base list. The array owns the pointed base list.

◆ Append()

Bool Append ( GeListNode bl)

Appends an node to the array.

Parameters
[in]blThe node to append. The caller owns the pointed node.
Returns
true if the base link was successfully added to the array, otherwise false.

◆ Remove()

Bool Remove ( Int32  n)

Removes and frees the base link at position n.

Parameters
[in]nThe position of the base link to remove. 0 <= n < GetCount()
Returns
true if the base link was successfully removed, otherwise false.

◆ GetRealCount()

Int32 GetRealCount ( BaseDocument doc) const

Gets the number of valid base links in the array.

Parameters
[in]docThe document to check the base links. The caller owns the pointed document.
Returns
The number of valid base links in the array.