FieldCallerStack Class Reference

#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.

公共成员函数

  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 >  添加 (const BaseList2D *caller)
Int   GetCount () const
UInt   GetValue () const
Bool   IsValid () const
void  添加 ( UInt levelValue)
maxon::Result < void >  AddOrAddCacheParentObject ( BaseObject *caller)

静态公共成员函数

static FieldCallerStack   创建 ()
static maxon::Result < FieldCallerStack 创建 (const BaseList2D *caller)
static maxon::Result < FieldCallerStack 创建 (const std::initializer_list< const BaseList2D * > &callers)
static FieldCallerStack   添加 (const FieldCallerStack &src, const BaseList2D *newCaller)

Public Attributes

UInt   _value
maxon::BaseArray < const BaseList2D * >  _callers

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldCallerStack )

构造函数 & 析构函数文档编制

◆  FieldCallerStack() [1/3]

FieldCallerStack ( )
default

◆  FieldCallerStack() [2/3]

FieldCallerStack ( UInt   value )
explicit

◆  FieldCallerStack() [3/3]

FieldCallerStack ( FieldCallerStack &&  src )

◆  ~FieldCallerStack()

~ FieldCallerStack ( )
default

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( FieldCallerStack   )
private

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( FieldCallerStack   )

◆  Create() [1/3]

static FieldCallerStack 创建 ( )
static

Creates an empty FieldCallerStack . Cannot fail. Same as using default constructor.

返回
A maxon::Result<FieldCallerStack>.

◆  Create() [2/3]

static maxon::Result < FieldCallerStack > Create ( const BaseList2D caller )
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.
返回
A maxon::Result<FieldCallerStack>.

◆  Create() [3/3]

static maxon::Result < FieldCallerStack > Create ( const std::initializer_list< const BaseList2D * > &  callers )
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.
返回
A maxon::Result<FieldCallerStack>.

◆  CopyFrom()

maxon::Result <void> CopyFrom ( const FieldCallerStack src )

Copies from the supplied FieldCallerStack .

参数
[in] src The source.
返回
A maxon::Result .

◆  operator[]()

const BaseList2D * operator[] ( Int   index ) const

Returns an element of the stack.

参数
[in] index The caller index.
返回
The element.

◆  operator const UInt &()

operator const UInt & ( ) const

Cast to UInt, return the value of the stack.

返回
The stack value.

◆  RecalcValue()

UInt RecalcValue ( ) const

Calculates the id of the caller stack from scratch. Does not update stored id value.

返回
The new id.

◆  UpdateValue() [1/2]

void UpdateValue ( )

Recalculates the id of the caller stack from scratch. Will update the internal stack id value.

◆  UpdateValue() [2/2]

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.

◆  Add() [1/3]

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.
返回
OK on success.

◆  Add() [2/3]

static FieldCallerStack 添加 ( const FieldCallerStack src ,
const BaseList2D newCaller  
)
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.
返回
A new stack passed by move constructor. Stack will be empty if internal error occurred.

◆  GetCount()

Int GetCount ( ) const

Returns the number of callers involved in this chain.

返回
The number of callers.

◆  GetValue()

UInt GetValue ( ) const

Returns the caller stack id.

返回
The id.

◆  IsValid()

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.

返回
True if valid.

◆  Add() [3/3]

void Add ( UInt   levelValue )

Adds a non caller value to the stack ID.

参数
[in] levelValue The value to add to the stack ID..

◆  AddOrAddCacheParentObject()

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.
返回
OK on success.

Member Data Documentation

◆  _value

UInt _value

Caller stack id.

◆  _callers

maxon::BaseArray <const BaseList2D *> _callers

Detailed stack for id _value.