DataDescriptionInterface Class Reference

#include <datadescription.h>

Detailed Description

Interface to store descriptions of objects. The DataDescription object is a cow object. It stores a compiled version of the DataDescriptionDefinitionRef for each datatype.

Public Member Functions

MAXON_METHOD DataDictionary GetInfo () const
 
MAXON_METHOD Result< void > SetInfo (const DataDictionary &info)
 
MAXON_METHOD Int GetEntryCount () const
 
MAXON_METHOD Result< BaseArray< DataDictionary > > GetEntries () const
 
MAXON_METHOD Result< DataDictionary > GetEntry (const InternedId &id) const
 
MAXON_METHOD Result< DataDictionary > FindEntry (const InternedId &id) const
 
MAXON_METHOD Result< BoolSetEntry (const DataDictionary &props, Bool merge=false)
 
MAXON_METHOD Result< void > EraseEntry (const InternedId &id)
 
MAXON_METHOD void Reset ()
 
MAXON_METHOD Bool IsEqual (const DataDescriptionInterface *other, EQUALITY equality) const
 
MAXON_METHOD COMPARERESULT Compare (const DataDescriptionInterface *other) const
 
MAXON_METHOD HashInt GetHashCode () const
 
MAXON_METHOD UniqueHash GetUniqueHashCode () const
 
MAXON_METHOD String ToString (const FormatStatement *formatStatement=nullptr) const
 

Static Public Member Functions

static MAXON_METHOD Result< void > DescribeIO (const DataSerializeInterface &stream)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (DataDescriptionInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.interface.datadescription", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( DataDescriptionInterface  ,
MAXON_REFERENCE_COPY_ON_WRITE  ,
"net.maxon.interface.datadescription"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ GetInfo()

MAXON_METHOD DataDictionary GetInfo ( ) const

Returns the info dictionary.

◆ SetInfo()

MAXON_METHOD Result<void> SetInfo ( const DataDictionary &  info)

SetInfo the info dictionary of the description.

Parameters
[in]infoDictionary with infos.
Returns
OK on success.

◆ GetEntryCount()

MAXON_METHOD Int GetEntryCount ( ) const

Returns the number of entries in the description.

◆ GetEntries()

MAXON_METHOD Result<BaseArray<DataDictionary> > GetEntries ( ) const

Returns a array with all entries.

◆ GetEntry()

MAXON_METHOD Result<DataDictionary> GetEntry ( const InternedId id) const

Returns a specific entry with the given id. Deprecated. Will be deprecated, use FindEntry instead.

Parameters
[in]idId to return.
Returns
DataDictionary on success. Error if the requested attribute was not in the description.

◆ FindEntry()

MAXON_METHOD Result<DataDictionary> FindEntry ( const InternedId id) const

Searches for the occurrence of the entry.

Parameters
[in]idId to search.
Returns
Entry on success. Error if entry is not found.

◆ SetEntry()

MAXON_METHOD Result<Bool> SetEntry ( const DataDictionary &  props,
Bool  merge = false 
)

SetEntry description.

Parameters
[in]propsProperties to set. The DESCRIPTION::BASE::IDENTIFIER will be used as key for the hashmap.
[in]mergeTrue if the container should be merged with the existing props im the description. The given props will have priority over the existing.
Returns
true if properties has been changed.

◆ EraseEntry()

MAXON_METHOD Result<void> EraseEntry ( const InternedId id)

Deletes a attribute from the description.

Parameters
[in]idId of the attribute to delete.
Returns
OK on success.

◆ Reset()

MAXON_METHOD void Reset ( )

Resets the description and clear all attributes.

◆ IsEqual()

MAXON_METHOD Bool IsEqual ( const DataDescriptionInterface other,
EQUALITY  equality 
) const

Compares two descriptions.

Parameters
[in]otherOther description to compare.
[in]equalitySee @EQUALITY.
Returns
True in equality.

◆ Compare()

MAXON_METHOD COMPARERESULT Compare ( const DataDescriptionInterface other) const

Compares the 2 values.

◆ GetHashCode()

MAXON_METHOD HashInt GetHashCode ( ) const

Returns the hash code of this @CLASS.

Returns
Hash code of this @CLASS.

◆ GetUniqueHashCode()

MAXON_METHOD UniqueHash GetUniqueHashCode ( ) const

Returns the 128-bit hash value of this @CLASS. The implementation ensures uniform distribution, so for practical purposes you can safely assume that two objects are equal if their hash values are equal.

Returns
Hash value of this @CLASS.

◆ ToString()

MAXON_METHOD String ToString ( const FormatStatement formatStatement = nullptr) const

Returns a readable string of the content.

Parameters
[in]formatStatementNullptr or additional formatting instruction. Use "{N}" for nive formatting of the name only. Otherwise the unique id is printed together with the name.
Returns
The converted result.

◆ DescribeIO()

static MAXON_METHOD Result<void> DescribeIO ( const DataSerializeInterface stream)
static

Describe all elements of this class for I/O operations.

Parameters
[in]streamThe stream that is used to register the class members.
Returns
OK on success.