GeData Class Reference

#include <c4d_gedata.h>

Detailed Description

The GeData class can hold values of many different types, including custom data types.
It is used by many parts of the API, and can be stored in BaseContainer objects.

Private Attributes

Int32 Type
 
Int32 dummy
 
union {
   Int32   DInteger
 
   Float   DReal
 
   void *   Ddata
 
   Int64   DLLong
 
}; 
 

Constructor/Destructor

 GeData (void)
 
 GeData (double n)
 
 GeData (const GeData &n)
 
 GeData (Int32 n)
 
 GeData (Float32 n)
 
 GeData (void *v, VOIDVALUETYPE xdummy)
 
 GeData (Int64 v, LLONGVALUETYPE xdummy)
 
 GeData (const Vector &n)
 
 GeData (const C4DUuid &n)
 
 GeData (const Matrix &n)
 
 GeData (const Char *n)
 
 GeData (const String &n)
 
 GeData (void *mem, Int count)
 
 GeData (const Filename &n)
 
 GeData (const BaseTime &n)
 
 GeData (const BaseContainer &n)
 
 GeData (const BaseLink *n)
 
 GeData (BaseList2D *bl)
 
 GeData (Int32 type, const CustomDataType &data)
 
 GeData (Int32 type, DEFAULTVALUETYPE v)
 
void Free (void)
 
 ~GeData (void)
 

Operator

const GeDataoperator= (const GeData &n)
 
Bool operator== (const GeData &d) const
 
Bool operator!= (const GeData &d) const
 

Type

Bool SetDefault (Int32 type)
 
Int32 GetType (void) const
 

Get Data

Bool GetBool (void) const
 
Int32 GetInt32 (void) const
 
Int64 GetInt64 (void) const
 
Float GetFloat (void) const
 
void * GetVoid (void) const
 
const VectorGetVector (void) const
 
const MatrixGetMatrix (void) const
 
const StringGetString (void) const
 
const C4DUuidGetUuid (void) const
 
const FilenameGetFilename (void) const
 
const BaseTimeGetTime (void) const
 
BaseContainerGetContainer (void) const
 
BaseLinkGetBaseLink (void) const
 
CustomDataTypeGetCustomDataType (Int32 datatype) const
 
BaseList2DGetLink (const BaseDocument *doc, Int32 instanceof=0) const
 
C4DAtomGoalGetLinkAtom (const BaseDocument *doc, Int32 instanceof=0) const
 
void * GetMemoryAndRelease (Int &count)
 
void * GetMemory (Int &count)
 

Set Data

void CopyData (GeData *dest, AliasTrans *aliastrans) const
 
void SetFloat (Float v)
 
void SetInt32 (Int32 v)
 
void SetInt64 (const Int64 &v)
 
void SetVoid (void *v)
 
void SetMemory (void *data, Int count)
 
void SetVector (const Vector &v)
 
void SetMatrix (const Matrix &v)
 
void SetString (const String &v)
 
void SetUuid (const C4DUuid &v)
 
void SetFilename (const Filename &v)
 
void SetBaseTime (const BaseTime &v)
 
void SetContainer (const BaseContainer &v)
 
void SetBaseLink (const BaseLink &v)
 
void SetBaseList2D (BaseList2D *bl)
 
void SetCustomDataType (Int32 datatype, const CustomDataType &v)
 

Constructor & Destructor Documentation

§ GeData() [1/20]

GeData ( void  )

Creates a DA_NIL data with no value.

§ GeData() [2/20]

GeData ( double  n)

Creates a float data.

Parameters
[in]nThe initial value.

§ GeData() [3/20]

GeData ( const GeData n)

Copy constructor.

Parameters
[in]nThe data to copy.

§ GeData() [4/20]

GeData ( Int32  n)

Creates an Int32 data.

Parameters
[in]nThe initial value.

§ GeData() [5/20]

GeData ( Float32  n)

Creates a Float32 data.

Parameters
[in]nThe initial value.

§ GeData() [6/20]

GeData ( void *  v,
VOIDVALUETYPE  xdummy 
)

Creates a void* data.

Parameters
[in]vThe initial void* value.
[in]xdummyThe dummy parameter. Should always be VOIDVALUE.

§ GeData() [7/20]

GeData ( Int64  v,
LLONGVALUETYPE  xdummy 
)

Creates a long long (64-bit integer) data.

Parameters
[in]vThe initial value.
[in]xdummyThe dummy parameter. Should always be LLONGVALUE.

§ GeData() [8/20]

GeData ( const Vector n)

Creates a Vector data.

Parameters
[in]nThe initial value.

§ GeData() [9/20]

GeData ( const C4DUuid n)

Creates a C4DUuid data.

Parameters
[in]nThe initial value.

§ GeData() [10/20]

GeData ( const Matrix n)

Creates a Matrix data.

Parameters
[in]nThe initial value.

§ GeData() [11/20]

GeData ( const Char n)

Creates a String data from a character buffer.

Parameters
[in]nThe initial value.

§ GeData() [12/20]

GeData ( const String n)

Creates a String data.

Parameters
[in]nThe initial value.

§ GeData() [13/20]

GeData ( void *  mem,
Int  count 
)

Creates a memory buffer data.

Parameters
[in]memThe initial memory buffer value.
[in]countThe number of bytes in the initial buffer.

§ GeData() [14/20]

GeData ( const Filename n)

Creates a Filename data.

Parameters
[in]nThe initial value.

§ GeData() [15/20]

GeData ( const BaseTime n)

Creates a BaseTime data.

Parameters
[in]nThe initial value.

§ GeData() [16/20]

GeData ( const BaseContainer n)

Creates a BaseContainer data.

Parameters
[in]nThe initial value.

§ GeData() [17/20]

GeData ( const BaseLink n)

Creates a BaseLink data.

Parameters
[in]nThe initial value.

§ GeData() [18/20]

GeData ( BaseList2D bl)

Creates a BaseList2D data.

Parameters
[in]blThe initial value.

§ GeData() [19/20]

GeData ( Int32  type,
const CustomDataType data 
)

Creates a data with a custom data type.

Parameters
[in]typeThe custom data type ID.
[in]dataThe custom data.

§ GeData() [20/20]

GeData ( Int32  type,
DEFAULTVALUETYPE  v 
)

Creates a custom data type with the default value for the type.
The second parameter is simply a typing trick so that the compiler chooses this constructor:

Parameters
[in]typeThe custom data type ID.
[in]vThe dummy parameter. Should always be DEFAULTVALUE.

§ ~GeData()

~GeData ( void  )

Destructor.

Member Function Documentation

§ Free()

void Free ( void  )

Deletes the internal data and sets the type to DA_NIL.

§ operator=()

const GeData& operator= ( const GeData n)

Assignment operator.

Parameters
[in]nThe data to assign.
Returns
The assigned data.

§ operator==()

Bool operator== ( const GeData d) const

Equality operator.

Parameters
[in]dThe data to compare with.
Returns
true if the data are equal, otherwise false.

§ operator!=()

Bool operator!= ( const GeData d) const

Inequality operator.

Parameters
[in]dThe data to compare with.
Returns
true if the data are different, otherwise false.

§ SetDefault()

Bool SetDefault ( Int32  type)

Sets the default value for the data type.

Parameters
[in]typeThe type ID: DA
Returns
true if successful, otherwise false.

§ GetType()

Int32 GetType ( void  ) const

Retrieves the type of the data.

Returns
The data type: DA

§ GetBool()

Bool GetBool ( void  ) const

Retrieves the value of Bool data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetInt32()

Int32 GetInt32 ( void  ) const

Retrieves the value of Int32 data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetInt64()

Int64 GetInt64 ( void  ) const

Retrieves the value of Int64 data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetFloat()

Float GetFloat ( void  ) const

Retrieves the value of Float data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetVoid()

void* GetVoid ( void  ) const

Retrieves the value of void* data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetVector()

const Vector& GetVector ( void  ) const

Retrieves the value of Vector data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetMatrix()

const Matrix& GetMatrix ( void  ) const

Retrieves the value of Matrix data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetString()

const String& GetString ( void  ) const

Retrieves the value of String data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetUuid()

const C4DUuid& GetUuid ( void  ) const

Retrieves the value of C4DUuid data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetFilename()

const Filename& GetFilename ( void  ) const

Retrieves the value of Filename data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetTime()

const BaseTime& GetTime ( void  ) const

Retrieves the value of BaseTime data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetContainer()

BaseContainer* GetContainer ( void  ) const

Retrieves the value of BaseContainer data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetBaseLink()

BaseLink* GetBaseLink ( void  ) const

Retrieves the value of BaseLink data objects. Forbidden for other data.

Returns
The value. Only valid as long as the GeData value exists.

§ GetCustomDataType()

CustomDataType* GetCustomDataType ( Int32  datatype) const

Retrieves the value of a CustomDataType, or nullptr if the wrong data type was specified. Forbidden for other data types.

Parameters
[in]datatypeThe data type ID.
Returns
The custom data type value, or nullptr if the types do not match. The data owns the pointed value.
Only valid as long as the GeData value exists.

§ GetLink()

BaseList2D* GetLink ( const BaseDocument doc,
Int32  instanceof = 0 
) const

Evaluates the link of DA_ALIASLINK data objects. Equivalent to GetBaseLink()->GetLink().
If instanceof is specified, nullptr is returned if the object is not of this type. Forbidden for other data.

Parameters
[in]docThe document to evaluate the link in. The caller owns the pointed document.
[in]instanceofSet this to a node type to only return the link if it is of this type.
Returns
The evaluated link. Cinema 4D owns the pointed link.
Only valid as long as the GeData value exists.

§ GetLinkAtom()

C4DAtomGoal* GetLinkAtom ( const BaseDocument doc,
Int32  instanceof = 0 
) const

Evaluates the atom link of DA_ALIASLINK data objects. Equivalent to GetBaseLink()->GetLinkAtom().
If instanceof is specified, nullptr is returned if the object is not of this type. Forbidden for other data.

Parameters
[in]docThe document to evaluate the atom link in. The caller owns the pointed document.
[in]instanceofSet this to a node type to only return the atom link if it is of this type.
Returns
The evaluated atom link. Cinema 4D owns the pointed atom link.
Only valid as long as the GeData value exists.

§ GetMemoryAndRelease()

void* GetMemoryAndRelease ( Int count)

Retrieves the value of memory buffer data objects. Forbidden for other data.

Note
In this version of GetMemory() the caller takes over the ownership of the memory block.
The memory block must be allocated with NewMem() and deallocated with DeleteMem().
Parameters
[in]countAssigned the number of bytes in the returned memory buffer.
Returns
The memory buffer. The caller takes over the ownership of the memory block.
Only valid as long as the GeData value exists.

§ GetMemory()

void* GetMemory ( Int count)

Retrieves the value of memory buffer data objects. Forbidden for other data.

Note
The memory block must be allocated with NewMem() and deallocated with DeleteMem().
Parameters
[in]countAssigned the number of bytes in the returned memory buffer.
Returns
The memory buffer. The data owns the pointed memory block.
Only valid as long as the GeData value exists.

§ CopyData()

void CopyData ( GeData dest,
AliasTrans aliastrans 
) const

Copies the data to another with an alias translator for the links.

Parameters
[in]destThe destination data. The caller owns the pointed data.
[in]aliastransAn alias translator for the operation. Can be nullptr. The caller owns the pointed alias translator.

§ SetFloat()

void SetFloat ( Float  v)

Sets the Float value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetInt32()

void SetInt32 ( Int32  v)

Sets the Int32 value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetInt64()

void SetInt64 ( const Int64 v)

Sets the Int64 value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetVoid()

void SetVoid ( void *  v)

Sets the void* value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetMemory()

void SetMemory ( void *  data,
Int  count 
)

Sets the memory buffer value and changes the data type accordingly.

Parameters
[in]dataThe new memory buffer value.
[in]countThe number of bytes in the memory buffer.

§ SetVector()

void SetVector ( const Vector v)

Sets the Vector value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetMatrix()

void SetMatrix ( const Matrix v)

Sets the Matrix value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetString()

void SetString ( const String v)

Sets the String value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetUuid()

void SetUuid ( const C4DUuid v)

Sets the C4DUuid value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetFilename()

void SetFilename ( const Filename v)

Sets the Filename value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetBaseTime()

void SetBaseTime ( const BaseTime v)

Sets the BaseTime value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetContainer()

void SetContainer ( const BaseContainer v)

Sets the BaseContainer value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetBaseLink()

void SetBaseLink ( const BaseLink v)

Sets the BaseLink value and changes the data type accordingly.

Parameters
[in]vThe new value.

§ SetBaseList2D()

void SetBaseList2D ( BaseList2D bl)

Sets the BaseList2D value and changes the data type accordingly.

Parameters
[in]blThe new value.

§ SetCustomDataType()

void SetCustomDataType ( Int32  datatype,
const CustomDataType v 
)

Sets the value for custom data type and changes the data type accordingly.

Parameters
[in]datatypeThe custom data type ID.
[in]vThe new custom data type value.

Member Data Documentation

§ Type

Int32 Type
private

§ dummy

Int32 dummy
private

§ DInteger

Int32 DInteger

§ DReal

Float DReal

§ Ddata

void* Ddata

§ DLLong

Int64 DLLong

§ @14

union { ... }