DescID Class Reference

#include <c4d_descid.h>

Inheritance diagram for DescID:

Private Member Functions

void InitStructure ()
 
void FreeStructure ()
 
const DescIDoperator+= (const DescID &d)
 
const DescIDoperator+= (const DescLevel &d)
 

Private Attributes

Int32 level
 
DescLevelsubids
 

Friends

const DescID operator+ (const DescID &d1, const DescID &d2)
 

Constructor/Destructor

 DescID ()
 
 DescID (const DescID &src)
 
 DescID (Int32 id1)
 
 DescID (const DescLevel &id1)
 
 DescID (const DescLevel &id1, const DescLevel &id2)
 
 DescID (const DescLevel &id1, const DescLevel &id2, const DescLevel &id3)
 
 ~DescID ()
 

Set/Push/Pop Level

void SetId (const DescLevel &subid)
 
void PushId (const DescLevel &subid)
 
void PopId ()
 

Operator

const DescLeveloperator[] (Int32 pos) const
 
const DescIDoperator= (const DescID &id)
 
Bool operator== (const DescID &d) const
 
Bool operator!= (const DescID &d) const
 
const DescID operator<< (Int32 shift) const
 

Read/Write

Bool Read (HyperFile *hf)
 
Bool Write (HyperFile *hf) const
 

Miscellaneous

Int32 GetDepth () const
 
Bool IsPartOf (const DescID &cmp, Int32 *diff) const
 

Additional Inherited Members

- Static Public Member Functions inherited from iCustomDataType< DescID >
static DescIDAlloc ()
 
static void Free (DescID *&data)
 

Detailed Description

An ID class for description parameters. Contains a stack of DescLevel objects.
The description ID is used to exactly identify a parameter.
For first-level values (like a Float or Int value) it only consists of one DescLevel. For more complex datatypes like Vector and Gradient it can consist of 2 or more levels.

Constructor & Destructor Documentation

◆ DescID() [1/6]

DescID ( )

Default constructor.

◆ DescID() [2/6]

DescID ( const DescID src)

Copy constructor.

Parameters
[in]srcSource DescID.

◆ DescID() [3/6]

DescID ( Int32  id1)

Creates a description ID with one level.

Parameters
[in]id1First level.

◆ DescID() [4/6]

DescID ( const DescLevel id1)

Creates a description ID with one level.

Parameters
[in]id1First level.

◆ DescID() [5/6]

DescID ( const DescLevel id1,
const DescLevel id2 
)

Creates a description ID with two levels.

Parameters
[in]id1First level.
[in]id2Second level.

◆ DescID() [6/6]

DescID ( const DescLevel id1,
const DescLevel id2,
const DescLevel id3 
)

Creates an ID with three levels.

Parameters
[in]id1First level.
[in]id2Second level.
[in]id3Third level.

◆ ~DescID()

~DescID ( )

Default destructor.

Member Function Documentation

◆ InitStructure()

void InitStructure ( )
private

◆ FreeStructure()

void FreeStructure ( )
private

◆ operator+=() [1/2]

const DescID& operator+= ( const DescID d)
private

◆ operator+=() [2/2]

const DescID& operator+= ( const DescLevel d)
private

◆ SetId()

void SetId ( const DescLevel subid)

Sets the highest level to subid.

Parameters
[in]subidNew top level.

◆ PushId()

void PushId ( const DescLevel subid)

Pushes a new level onto the stack.

Parameters
[in]subidLevel to push.

◆ PopId()

void PopId ( )

Pop the highest level from the stack.

◆ operator[]()

const DescLevel& operator[] ( Int32  pos) const

Accesses the level at position pos in the stack.

Parameters
[in]posThe position. 0 <= pos < GetDepth()
Returns
The level at the specified position.

◆ operator=()

const DescID& operator= ( const DescID id)

Assignment operator. Assign id to the description ID.

Parameters
[in]idRight operand. Source description ID.
Returns
Left operant.

◆ operator==()

Bool operator== ( const DescID d) const

Equality operator. Checks if all levels are equal.

Parameters
[in]dRight operand description ID.
Returns
true if description IDs are equal, otherwise false.

◆ operator!=()

Bool operator!= ( const DescID d) const

Inequality operator. Checks if any level is different.

Parameters
[in]dRight operand description ID.
Returns
true if description IDs are not equal, otherwise false.

◆ operator<<()

const DescID operator<< ( Int32  shift) const

Gets the result of popping levels from the bottom of the stack.

Parameters
[in]shiftNumber of levels to pop. 0 <= shift < GetDepth().
Returns
Resulting description ID after popping level(s).

◆ Read()

Bool Read ( HyperFile hf)

Private.

◆ Write()

Bool Write ( HyperFile hf) const

Private.

◆ GetDepth()

Int32 GetDepth ( ) const

Gets the depth of the stack, i.e. the number of levels.

Returns
The depth of the stack.

◆ IsPartOf()

Bool IsPartOf ( const DescID cmp,
Int32 diff 
) const

Checks if the description ID is part of cmp and assign the length of the match to diff.

Parameters
[in]cmpThe super description ID.
[in]diffIf not nullptr this is assigned the length of the match.
Returns
true if the description ID matches the lowest part of cmp, otherwise false.

Friends And Related Function Documentation

◆ operator+

const DescID operator+ ( const DescID d1,
const DescID d2 
)
friend

Member Data Documentation

◆ level

Int32 level
private

◆ subids

DescLevel* subids
private