GvPortList Class Reference

#include <c4d_graphview.h>

Detailed Description

Manages a list of GvPortListEntry representing ports on a GvNode.

Note
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Private Member Functions

 GvPortList ()
 
 ~GvPortList ()
 

Alloc/Free

static GvPortListAlloc ()
 
static void Free (GvPortList *&list)
 

List

Int32 GetCount () const
 
Bool Append (GvPortListEntry *e)
 
Bool Remove (GvPortListEntry *e)
 
GvPortListEntryGetIndex (Int32 i) const
 
void FlushAll ()
 

Constructor & Destructor Documentation

◆ GvPortList()

GvPortList ( )
private

◆ ~GvPortList()

~GvPortList ( )
private

Member Function Documentation

◆ Alloc()

static GvPortList* Alloc ( )
static

Allocates a port list. Destroy the allocated port list with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated port list, or nullptr if the allocation failed.

◆ Free()

static void Free ( GvPortList *&  list)
static

Destructs port lists allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]listThe port lists to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ GetCount()

Int32 GetCount ( ) const

Gets the number of port entries.

Returns
The number of entries.

◆ Append()

Bool Append ( GvPortListEntry e)

Appends an entry to the end of the list.

Parameters
[in]eThe entry to append. The list takes over the ownership of the pointed entry.
Returns
true if the port was appended, otherwise false.

◆ Remove()

Bool Remove ( GvPortListEntry e)

Removes the entry given by e.

Note
e is compared by pointer, so it must be either the pointer originally given to Append() or one returned from GetIndex().
Parameters
[in]eThe entry to remove. If the removal succeed, the ownership is transfered to the caller.
Returns
true if the entry was found and removed, otherwise false.

◆ GetIndex()

GvPortListEntry* GetIndex ( Int32  i) const

Retrieves an entry by index.

Parameters
[in]iThe entry index: 0 <= i < GetCount().
Returns
The retrieved entry. The list owns the pointed entry.

◆ FlushAll()

void FlushAll ( )

Clears the list.