DataDescriptionDatabaseInterface Class Reference

#include <datadescriptiondatabase.h>

Detailed Description

Interface to access the storage of DataDescription objects.

Static Public Member Functions

static MAXON_METHOD Result< DataDescription > LoadDescription (const Id &category, const LanguageRef &language, const Id &dataType)
 
static MAXON_METHOD Result< DataDescription > LoadDescription (const Id &category, const LanguageRef &language, const IdAndVersion &dataType)
 
static MAXON_METHOD Result< void > DescriptionDefinitionChanged (const Id &category, const LanguageRef &language, const IdAndVersion &dataType)
 
static MAXON_METHOD Result< BaseArray< Tuple< Id, Data, String > > > GetEffectiveEnumList (const DataDictionary &dataEntry, const DataDictionary &guiEntry, const DataDescription &stringDescription, Bool resolveExtensionPointsAndGui, Bool withStrings, const LanguageRef &language, const AssetRepositoryRef &repository, const Data *filterData)
 
static MAXON_METHOD Result< BaseArray< Tuple< Id, Data, String > > > GetEffectiveEnumList (const DataDictionary &dataEntry, const DataDictionary &guiEntry, const DataDescription &stringDescription, Bool resolveExtensionPointsAndGui, Bool withStrings, const LanguageRef &language, const AssetRepositoryRef &repository, const GetDataCallbackType &getDataCallback, const Data *filterData)
 
static MAXON_METHOD Result< void > PostProcessStringDescription (DataDescription &description, const BaseArray< DataDictionary > &entries)
 
static MAXON_METHOD Result< IdResolveVariableIdentifier (const Id &identifier, const AssetRepositoryRef &repository, const GetDataCallbackType &getDataCallback, Opt< const DataDictionary & > dataEntry, Opt< const DataDictionary & > guiEntry=Opt< const DataDictionary & >{})
 
static MAXON_METHOD Result< IdGetAndResolvePresetIdentifier (const AssetRepositoryRef &repository, const GetDataCallbackType &getDataCallback, const DataDictionary &guiEntry, Opt< const DataDictionary & > dataEntry=Opt< const DataDictionary & >{}, Bool &outResolveSuccess=DefaultLValue< Bool >{})
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (DataDescriptionDatabaseInterface, MAXON_REFERENCE_STATIC, "net.maxon.interface.datadescriptiondatabase", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( DataDescriptionDatabaseInterface  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.datadescriptiondatabase"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ LoadDescription() [1/2]

static MAXON_METHOD Result<DataDescription> LoadDescription ( const Id category,
const LanguageRef &  language,
const Id dataType 
)
static

LoadDescription description.

Parameters
[in]categoryDatabase category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI).
[in]languageLanguage (only valid for category DATADESCRIPTION_CATEGORY_STRING).
[in]dataTypeData type id to load.
Returns
OK on success.

◆ LoadDescription() [2/2]

static MAXON_METHOD Result<DataDescription> LoadDescription ( const Id category,
const LanguageRef &  language,
const IdAndVersion dataType 
)
static

◆ DescriptionDefinitionChanged()

static MAXON_METHOD Result<void> DescriptionDefinitionChanged ( const Id category,
const LanguageRef &  language,
const IdAndVersion dataType 
)
static

Resets the cached description.

◆ GetEffectiveEnumList() [1/2]

static MAXON_METHOD Result<BaseArray<Tuple<Id, Data, String> > > GetEffectiveEnumList ( const DataDictionary &  dataEntry,
const DataDictionary &  guiEntry,
const DataDescription &  stringDescription,
Bool  resolveExtensionPointsAndGui,
Bool  withStrings,
const LanguageRef &  language,
const AssetRepositoryRef &  repository,
const Data filterData 
)
static

GetEffectiveEnumList returns the enum list prepared for display in the ui with the user order etc. It takes DESCRIPTION::DATA::BASE::ENUM and DESCRIPTION::UI::BASE::ENUM into account.

Parameters
[in]dataEntryDescription of the data.
[in]guiEntryDescription of the ui.
[in]stringDescriptionDescription of the strings.
[in]resolveExtensionPointsAndGuiTrue if extension points and ui order should be evaluated. False will return the unprocessed DESCRIPTION::DATA::BASE::ENUM array.
[in]withStringsTrue if strings shall be set up.
[in]languageLanguage to use.
[in]repositoryAsset Repository to use.
[in]filterDataFilter only for this one type. Nullptr to disable filtering.
Returns
OK on success.

◆ GetEffectiveEnumList() [2/2]

static MAXON_METHOD Result<BaseArray<Tuple<Id, Data, String> > > GetEffectiveEnumList ( const DataDictionary &  dataEntry,
const DataDictionary &  guiEntry,
const DataDescription &  stringDescription,
Bool  resolveExtensionPointsAndGui,
Bool  withStrings,
const LanguageRef &  language,
const AssetRepositoryRef &  repository,
const GetDataCallbackType getDataCallback,
const Data filterData 
)
static
See also
GetEffectiveEnumList. Same functionality, but supports resolving variable identifiers with #getDataCallback.

◆ PostProcessStringDescription()

static MAXON_METHOD Result<void> PostProcessStringDescription ( DataDescription &  description,
const BaseArray< DataDictionary > &  entries 
)
static

PostProcessStringDescription description.

Parameters
[in]descriptionDescription to modify
[in]entriesString description entries to process.
Returns
OK on success.

◆ ResolveVariableIdentifier()

static MAXON_METHOD Result<Id> ResolveVariableIdentifier ( const Id identifier,
const AssetRepositoryRef &  repository,
const GetDataCallbackType getDataCallback,
Opt< const DataDictionary & >  dataEntry,
Opt< const DataDictionary & >  guiEntry = Opt< const DataDictionary & >{} 
)
static

Returns a usable identifier with all variables resolved. identifier usually comes from DESCRIPTION::UI::BASE::PRESETDATABASEID or DESCRIPTION::UI::BASE::PRESETDATABASEDYNAMICID. It can also come from GetEffectiveEnumList, as long as the context to resolve the variables is at hand. For instance "preset_net.maxon.preset.neutron.distribution.parametric.spiral.{var#net.maxon.description.data.base.datatype}". This has to be resolved to load the correct preset database. The variable parts of the given identifier must be found in the supplied DataDictionary entries or through GetDataBCallbackType.

See also
VARIABLEID_PREFIX.
Parameters
[in]identifierThe identifier to resolve.
[in]repositoryRepository from where the entries stem.
[in]getDataCallbackCallback used to read read description entry values.
[in]dataEntryOptional. The description definition DATADESCRIPTION_CATEGORY_DATA entry used to resolve the identifier.
[in]guiEntryOptional. The description definition DATADESCRIPTION_CATEGORY_GUI entry used to resolve the identifier.
Returns
Resolved identifier. An error if variables ("{var#@}") were not resolved successfully.

◆ GetAndResolvePresetIdentifier()

static MAXON_METHOD Result<Id> GetAndResolvePresetIdentifier ( const AssetRepositoryRef &  repository,
const GetDataCallbackType getDataCallback,
const DataDictionary &  guiEntry,
Opt< const DataDictionary & >  dataEntry = Opt< const DataDictionary & >{},
Bool outResolveSuccess = DefaultLValueBool >{} 
)
static

Returns a usable preset identifier with all variables resolved. #presetIdentifier will be read in DESCRIPTION::UI::BASE::PRESETDATABASEID or DESCRIPTION::UI::BASE::PRESETDATABASEDYNAMICID. The latter has priority and might contains links to other definition entries which need to be resolved.. For instance "preset_net.maxon.preset.neutron.distribution.parametric.spiral.{net.maxon.description.data.base.datatype}". This has to be resolved to load the correct preset database. The variable parts of the given identifier must be found in the supplied data or gui entries. If no entry dictionaries are supplied, resolving will not occur and the preset identifier will be handled as constant.

Parameters
[in]repositoryRepository from where the entries stem.
[in]getDataCallbackCallback used to read read description entry values.
[in]guiEntryThe description definition DATADESCRIPTION_CATEGORY_GUI entry used to resolve the preset identifier.
[in]dataEntryOptional. The description definition DATADESCRIPTION_CATEGORY_DATA entry used to resolve the preset identifier.
[out]outResolveSuccessOptional. Will be set to true if a dynamic identifier is set and was resolved properly.
Returns
Preset resolved PRESETDATABASEDYNAMICID database identifier or PRESETDATABASEID if resolve failed.