iCustomDataType< X > Struct Template Reference

#include <c4d_customdatatype.h>

Inheritance diagram for iCustomDataType< X >:

Detailed Description

template<class X>
struct iCustomDataType< X >

The base class for data types with Alloc() and Free() for use in libraries. Pass the public data type as template parameter.

Note
The advantage of this class is to not need to provide library functions for Alloc() and Free(), as the internal and external type will share this functionality.

Static Public Member Functions

static X * Alloc ()
 
static void Free (X *&data)
 

Member Function Documentation

◆ Alloc()

static X* Alloc ( )
static

Allocates an X data type. Destroy the allocated X data type with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated X data type, or nullptr if the allocation failed.

◆ Free()

static void Free ( X *&  data)
static

Destructs X data types allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]dataThe X data type to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.