DescID Class Reference Library » 描述

#include <lib_description.h>

Inheritance diagram for DescID:

详细描述

An ID class for description elements. Contains a stack of DescLevel 对象。
A description ID is used to exactly identify a parameter value.

Private Attributes

std::aligned_storage< sizeof( maxon::BaseArray < DescLevel >), alignof( maxon::BaseArray < DescLevel >)>::type  _private

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 DescLevel operator[] ( Int32 pos) const
const DescID operator= (const DescID &id)
Bool   operator== (const DescID &d) const
Bool   operator!= (const DescID &d) const
const DescID   operator<< ( Int32 shift) const
const DescID operator+= (const DescID &s)
const friend DescID   operator+ (const DescID &v1, const DescID &v2)

Read/Write

Bool   读取 ( HyperFile *hf)
Bool   Write ( HyperFile *hf)

杂项

Int32   GetDepth () const
Bool   IsPartOf (const DescID &cmp, Int32 *pos) const
maxon::HashInt   GetHashCode () const

Additional Inherited Members

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

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

◆  DescID() [1/6]

DescID ( )

Default constructor.

◆  DescID() [2/6]

DescID ( const DescID src )

Copy constructor.

参数
[in] src Source DescID .

◆  DescID() [3/6]

DescID ( Int32   id1 )

Creates a description ID with one level.

参数
[in] id1 First level.

◆  DescID() [4/6]

DescID ( const DescLevel id1 )

Creates a description ID with one level.

参数
[in] id1 First level.

◆  DescID() [5/6]

DescID ( const DescLevel id1 ,
const DescLevel id2  
)

Creates a description ID with two levels.

参数
[in] id1 First level.
[in] id2 Second level.

◆  DescID() [6/6]

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

Creates an ID with three levels.

参数
[in] id1 First level.
[in] id2 Second level.
[in] id3 Third level.

◆  ~DescID()

~ DescID ( )

Default destructor.

成员函数文档编制

◆  SetId()

void SetId ( const DescLevel subid )

Sets the highest level to subid .

参数
[in] subid New top level.

◆  PushId()

void PushId ( const DescLevel subid )

Pushes a new level onto the stack.

参数
[in] subid Level 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.

参数
[in] pos The position: 0 <= pos < GetDepth()
返回
The level at the specified position.

◆  operator=()

const DescID & operator= ( const DescID id )

Assignment operator. Assigns id to the description ID.

参数
[in] id Right operand. Source description ID.
返回
Left operant.

◆  operator==()

Bool operator== ( const DescID d ) const

Equality operator. Checks if all levels are equal.

参数
[in] d Right operand description ID.
返回
true if description IDs are equal, otherwise false .

◆  operator!=()

Bool operator!= ( const DescID d ) const

Inequality operator. Checks if any level is different.

参数
[in] d Right operand description ID.
返回
true if description IDs are not equal, otherwise false .

◆  operator<<()

const DescID operator<< ( Int32   shift ) const

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

参数
[in] shift Number of levels to pop. 0 <= shift < GetDepth() .
返回
Resulting description ID after popping level(s).

◆  operator+=()

const DescID & operator+= ( const DescID s )

Add operator. Merges two description IDs.

参数
[in] s Right operand. Source description ID.
返回
Left operant.

◆  Read()

Bool 读取 ( HyperFile hf )

Reads the description ID from hf .

参数
[in] hf The hyper file to read from. The caller owns the pointed hyper file.
返回
true if successful, otherwise false .

◆  Write()

Bool Write ( HyperFile hf )

Writes the description ID to hf .

参数
[in] hf The hyper file to write to. The caller owns the pointed hyper file.
返回
true if successful, otherwise false .

◆  GetDepth()

Int32 GetDepth ( ) const

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

返回
The depth of the stack.

◆  IsPartOf()

Bool IsPartOf ( const DescID cmp ,
Int32 pos  
) const

Checks if the description ID is part of cmp and assigns the length of the match to pos .

参数
[in] cmp The super description ID.
[out] pos If not nullptr this is assigned the length of the match.
返回
true if the description ID matches the lowest part of cmp , otherwise false .

◆  GetHashCode()

maxon::HashInt GetHashCode ( ) const

Gets a hash code for the description ID.

由于
R17.032
返回
The hash code.

Friends And Related Function Documentation

◆  operator+

const friend DescID operator+ ( const DescID v1 ,
const DescID v2  
)
friend

Add operator. Merges two description IDs.

参数
[in] v1 Left operand.
[in] v2 Right operand.
返回
Result.

Member Data Documentation

◆  _private

std::aligned_storage<sizeof( maxon::BaseArray < DescLevel >), alignof( maxon::BaseArray < DescLevel >)>::type _private
private