#include <c4d_fielddata.h>
A list of all of the "callers" i.e. objects that invoked the sampling function. Additionally contains an identifier one way hash created to generate a unique ID based on the objects invoking the sampling, you can append additional addresses/objects using the operator + and += functions in order to continue the chain and ensure that the caller ID remains unique within the FieldInfo for each call chain.
Public Member Functions | |
FieldCallerStack ()=default | |
FieldCallerStack (UInt value) | |
FieldCallerStack (FieldCallerStack &&src) | |
~FieldCallerStack ()=default | |
MAXON_OPERATOR_MOVE_ASSIGNMENT (FieldCallerStack) | |
maxon::Result< void > | CopyFrom (const FieldCallerStack &src) |
const BaseList2D * | operator[] (Int index) const |
operator const UInt & () const | |
UInt | RecalcValue () const |
void | UpdateValue () |
void | UpdateValue (const BaseList2D *caller) |
maxon::Result< void > | Add (const BaseList2D *caller) |
Int | GetCount () const |
UInt | GetValue () const |
Bool | IsValid () const |
void | Add (UInt levelValue) |
maxon::Result< void > | AddOrAddCacheParentObject (BaseObject *caller) |
Static Public Member Functions | |
static FieldCallerStack | Create () |
static maxon::Result< FieldCallerStack > | Create (const BaseList2D *caller) |
static maxon::Result< FieldCallerStack > | Create (const std::initializer_list< const BaseList2D * > &callers) |
static FieldCallerStack | Add (const FieldCallerStack &src, const BaseList2D *newCaller) |
Public Attributes | |
UInt | _value |
maxon::BaseArray< const BaseList2D * > | _callers |
Private Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (FieldCallerStack) | |
|
default |
|
explicit |
FieldCallerStack | ( | FieldCallerStack && | src | ) |
|
default |
|
private |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | FieldCallerStack | ) |
|
static |
Creates an empty FieldCallerStack. Cannot fail. Same as using default constructor.
|
static |
Creates a FieldCallerStack while relaying potential allocation errors. On error, the result will contain a default FieldCallerStack structure.
[in] | caller | The first caller for the stack. |
|
static |
Creates a FieldCallerStack while relaying potential allocation errors. On error, the result will contain a default FieldCallerStack structure.
[in] | callers | An initializer list to build the stack, first item is base of stack. |
maxon::Result<void> CopyFrom | ( | const FieldCallerStack & | src | ) |
const BaseList2D* operator[] | ( | Int | index | ) | const |
Returns an element of the stack.
[in] | index | The caller index. |
operator const UInt & | ( | ) | const |
Cast to UInt, return the value of the stack.
UInt RecalcValue | ( | ) | const |
Calculates the id of the caller stack from scratch. Does not update stored id value.
void UpdateValue | ( | ) |
Recalculates the id of the caller stack from scratch. Will update the internal stack id value.
void UpdateValue | ( | const BaseList2D * | caller | ) |
Calculates a new stack id from the current id and the added caller. Can be used to calculate a stack id without carrying the actual BaseList2d stack.
[in] | caller | The new caller, assuming already added to stack. |
maxon::Result<void> Add | ( | const BaseList2D * | caller | ) |
Adds a caller to the caller stack and updates the stack id.
[in] | caller | The caller object to add to the stack. |
|
static |
Adds a caller to the caller stack and returns a modified stack. This function hides the memory management iferr statement by returning an empty FieldCallerStack if an error occurs. It can be used within a field sampling call directly. But it is recommended to use the non static version and avoid any field sampling call if a prior memory error occurred.
[in] | src | The original stack. |
[in] | newCaller | The caller object to add to the stack. |
Int GetCount | ( | ) | const |
Returns the number of callers involved in this chain.
UInt GetValue | ( | ) | const |
Returns the caller stack id.
Bool IsValid | ( | ) | const |
Check for valid stack content. Empty stack is valid. Stack with null pointers is not valid. Non empty stack with no stack id value is not valid.
void Add | ( | UInt | levelValue | ) |
Adds a non caller value to the stack ID.
[in] | levelValue | The value to add to the stack ID.. |
maxon::Result<void> AddOrAddCacheParentObject | ( | BaseObject * | caller | ) |
Adds a the object or it's cache parent parent to the stack if the object has a cache along with all object uniqueIP's to maintain a better path to the object.
[in] | caller | The caller object or caller cache source to add to the stack ID. |
UInt _value |
Caller stack id.
maxon::BaseArray<const BaseList2D*> _callers |
Detailed stack for id _value.