DataDescriptionDefinitionDatabaseImplInterface Class Reference

#include <datadescriptiondefinitiondatabaseimpl.h>

Inheritance diagram for DataDescriptionDefinitionDatabaseImplInterface:

Detailed Description

Allows to create different implementations of data description database stores.

Public Member Functions

MAXON_METHOD Bool Contains (const Id &category, const IdAndVersion &dataType, const LanguageRef &language) const
 
MAXON_METHOD Result< DataDescriptionDefinition > LoadDescription (LOADDESCRIPTIONMODE mode, const Id &category, const LanguageRef &language, const IdAndVersion &dataType, Id *foundInDatabase=nullptr) const
 
MAXON_METHOD Result< Tuple< Bool, DataDescriptionDefinition * > > StoreDescription (const Id &databaseId, const Id &category, const LanguageRef &language, const IdAndVersion &dataType, const DataDescriptionDefinition &description, const DataDescriptionDefinition &overwrittenDescription, Bool usePendingSystem)
 
MAXON_METHOD Result< BoolDeleteDescription (const Id &category, const LanguageRef &language, const IdAndVersion &dataType)
 
MAXON_METHOD Result< BaseArray< IdAndVersion > > GetRegisteredDescriptions (const Id &category, const LanguageRef &language) const
 
MAXON_METHOD Result< BaseArray< LanguageRef > > GetRegisteredLanguages () const
 
MAXON_METHOD Result< void > WriteDataBases () const
 
MAXON_METHOD Result< IntRenameId (const Id &oldId, const Id &newId)
 
MAXON_METHOD Result< IntRenameAttribute (const InternedId &oldId, const InternedId &newId)
 
MAXON_METHOD Result< BoolCheckUniqueAttributeName (const InternedId &searchId) const
 
MAXON_METHOD Result< DataDescription > UpdateDescriptions (const Id &category, const IdAndVersion &dataTypeId, const LanguageRef &language) const
 
MAXON_METHOD Bool IsWritableDatabase (const Id &languageId) const
 
MAXON_METHOD Int GetChangeCounts () const
 
MAXON_METHOD Int GetUserChangeCount () const
 
MAXON_METHOD Result< void > Write () const
 
MAXON_METHOD Result< void > WriteUserChangedDataBases ()
 

Private Member Functions

 MAXON_INTERFACE (DataDescriptionDefinitionDatabaseImplInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.datadescriptiondefinitiondatabaseimpl")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( DataDescriptionDefinitionDatabaseImplInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.datadescriptiondefinitiondatabaseimpl"   
)
private

◆ Contains()

MAXON_METHOD Bool Contains ( const Id category,
const IdAndVersion dataType,
const LanguageRef &  language 
) const

checks if the database contains the datatype.

Parameters
[in]categoryDatabase category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI).
[in]dataTypeData type id to load.
[in]languageLanguage (only valid for category DATADESCRIPTION_CATEGORY_STRING).
Returns
True if the database contains the data type.

◆ LoadDescription()

MAXON_METHOD Result<DataDescriptionDefinition> LoadDescription ( LOADDESCRIPTIONMODE  mode,
const Id category,
const LanguageRef &  language,
const IdAndVersion dataType,
Id foundInDatabase = nullptr 
) const

Loads a description from the registered databases.

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.
[out]foundInDatabaseOptional: Pointer to an Id of the database where the entry was found.
Returns
DataDescriptionDefinition on success.

◆ StoreDescription()

MAXON_METHOD Result<Tuple<Bool, DataDescriptionDefinition*> > StoreDescription ( const Id databaseId,
const Id category,
const LanguageRef &  language,
const IdAndVersion dataType,
const DataDescriptionDefinition &  description,
const DataDescriptionDefinition &  overwrittenDescription,
Bool  usePendingSystem 
)

Stores the given description under the given values.

Parameters
[in]databaseIdDatabase id (see RegisterDatabase()/GetRegisteredDatabases()).
[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 store.
[in]descriptionDescription data to store.
Returns
Tuple with a Bool (changed or not) and the pointer of the stored description if changed. Error otherwise.

◆ DeleteDescription()

MAXON_METHOD Result<Bool> DeleteDescription ( const Id category,
const LanguageRef &  language,
const IdAndVersion dataType 
)

DeleteDescription deletes a description from the database.

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 delete.
Returns
True/False on success. True means the description was found and deleted. False if the description was not found.

◆ GetRegisteredDescriptions()

MAXON_METHOD Result<BaseArray<IdAndVersion> > GetRegisteredDescriptions ( const Id category,
const LanguageRef &  language 
) const

Return all registered descriptions.

Parameters
[in]categoryDatabase category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI).
[in]languageLanguage (only valid for category DATADESCRIPTION_CATEGORY_STRING).
Returns
Array on success.

◆ GetRegisteredLanguages()

MAXON_METHOD Result<BaseArray<LanguageRef> > GetRegisteredLanguages ( ) const

Returns all registered languages of this database.

Returns
Array with languages on success.

◆ WriteDataBases()

MAXON_METHOD Result<void> WriteDataBases ( ) const

Save all databases (including user changes and version update changes).

Returns
OK on success.

◆ RenameId()

MAXON_METHOD Result<Int> RenameId ( const Id oldId,
const Id newId 
)

Renames a id in all databases to the new id.

Parameters
[in]oldIdOld id to rename
[in]newIdId to replace.
Returns
Number of values that were renamed.

◆ RenameAttribute()

MAXON_METHOD Result<Int> RenameAttribute ( const InternedId oldId,
const InternedId newId 
)

Renames an attribute in all databases.

Parameters
[in]oldIdOld attribute key.
[in]newIdNew attribute key.
Returns
Number of values that were renamed.

◆ CheckUniqueAttributeName()

MAXON_METHOD Result<Bool> CheckUniqueAttributeName ( const InternedId searchId) const

Checks if the given id is unique in all databases.

Parameters
[in]searchIdId to search for.
Returns
True if the id is unique. False if the id already exists.

◆ UpdateDescriptions()

MAXON_METHOD Result<DataDescription> UpdateDescriptions ( const Id category,
const IdAndVersion dataTypeId,
const LanguageRef &  language 
) const

Updates the description from the given DataDescriptionDefinition.

Parameters
[in]categoryCategory to search.
[in]dataTypeIdData type id to process.
[in]languageLanguage to process.
Returns
OK on success.

◆ IsWritableDatabase()

MAXON_METHOD Bool IsWritableDatabase ( const Id languageId) const

Returns true if the database is writable.

Parameters
[in]languageIdLanguage id to check.

◆ GetChangeCounts()

MAXON_METHOD Int GetChangeCounts ( ) const

Returns the number of changes made since the last Write(). This includes user changes and all automatic version update changes.

Returns
The number of changes.

◆ GetUserChangeCount()

MAXON_METHOD Int GetUserChangeCount ( ) const

Returns the number of changes made by user since the last Write().

Returns
The number of changes.

◆ Write()

MAXON_METHOD Result<void> Write ( ) const

Writes all changes permanently to hard drive.

Returns
OK on success.

◆ WriteUserChangedDataBases()

MAXON_METHOD Result<void> WriteUserChangedDataBases ( )

Save all databases edited by a user.

Returns
OK on success.