AssetMetaDataInterface Class Reference

#include <assets.h>

Inheritance diagram for AssetMetaDataInterface:

Detailed Description

AssetMetaData allows to query the meta data of an asset. It is returned by AssetDescriptionInterface::GetMetaData. The methods of this interface are thread-safe, but the meta data of an asset may be changed concurrently, so the returned values may differ from call to call even when the calling thread made no modification inbetween.

You can't modify the meta data of an asset through this interface, you have to use AssetDescriptionInterface::StoreMetaData instead.

Public Types

enum class  KIND {
  NONE ,
  READ_ONLY ,
  PERSISTENT ,
  VERSION ,
  DERIVED ,
  USER ,
  MASK ,
  IGNORE_READ_ONLY
}
 

Public Member Functions

enum maxon::AssetMetaDataInterface::KIND MAXON_ENUM_FLAGS_CLASS (KIND)
 
MAXON_METHOD Result< BaseArray< Tuple< InternedId, KIND > > > GetExistingEntries () const
 
MAXON_METHOD Result< DataGet (const InternedId &metaId) const
 
template<typename T >
MAXON_FUNCTION Result< Opt< T > > Get (const InternedId &metaId) const
 
template<typename ATTR >
MAXON_FUNCTION Result< Opt< typename ATTR::ValueType > > Get () const
 
template<typename ATTR >
MAXON_FUNCTION Result< Opt< typename ATTR::ValueType > > Get (const ATTR &attr) const
 
template<typename ATTR >
MAXON_FUNCTION Result< typename ATTR::ValueType > Get (const ATTR &attr, const typename ATTR::ValueType &defaultValue) const
 
MAXON_METHOD Int GetTimeStamp (const InternedId &metaId) const
 
MAXON_METHOD Result< void > PrivateGet (const InternedId &metaId, const DataType &type, Generic *mem) const
 

Private Member Functions

 MAXON_INTERFACE (AssetMetaDataInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.assetmetadata", MAXON_IMPLEMENTATION_MODULE("net.maxon.asset"))
 

Static Private Member Functions

static MAXON_METHOD const AssetMetaDataInterfaceDefaultValuePtr ()
 

Member Enumeration Documentation

◆ KIND

enum KIND
strong

This enum defines flags for the kind of a meta data entry.

Enumerator
NONE 

No flag set.

READ_ONLY 

The meta data is read-only, for example the AssetTimeStamp.

PERSISTENT 

The meta data is persistent.

VERSION 

The meta data is tied to the version so that it isn't copied to a new version, for example the AssetVersionTag.

DERIVED 

The meta data is derived from the asset and other meta data.

USER 

The meta data should be stored in user folder.

MASK 

A mask for all regular flags.

IGNORE_READ_ONLY 

This flag is only used as argument for AssetRepositoryInterface::StoreMetaData to ignore the READ_ONLY flag.

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( AssetMetaDataInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxon.interface.assetmetadata"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.asset")   
)
private

◆ MAXON_ENUM_FLAGS_CLASS()

enum maxon::AssetMetaDataInterface::KIND MAXON_ENUM_FLAGS_CLASS ( KIND  )

◆ GetExistingEntries()

MAXON_METHOD Result<BaseArray<Tuple<InternedId, KIND> > > GetExistingEntries ( ) const

Returns an array with the current set of meta data entries.

Returns
The current set of meta data entries given by the meta data attribute id and kind.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ Get() [1/5]

MAXON_METHOD Result<Data> Get ( const InternedId metaId) const

Returns the current value of the meta data entry for the meta data attribute #metaId.

Parameters
[in]metaIdThe identifier of the meta data attribute.
Returns
The current value for the attribute, or an empty Data if there is no entry. An error is returned if there is an entry, but loading the entry value fails.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ Get() [2/5]

MAXON_FUNCTION Result<Opt<T> > Get ( const InternedId metaId) const

Returns the current value of the meta data entry for the meta data attribute #metaId.

Parameters
[in]metaIdThe identifier of the meta data attribute.
Template Parameters
TThe type of the meta data attribute.
Returns
The current value for the attribute, or an empty Opt if there is no entry. An error is returned if there is an entry, but loading the entry value fails.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ Get() [3/5]

MAXON_FUNCTION Result<Opt<typename ATTR::ValueType> > Get ( ) const

Returns the current value of the meta data entry for the meta data attribute ATTR.

Template Parameters
ATTRThe attribute for which the value shall be returned (has to be declared with MAXON_ATTRIBUTE).
Returns
The current value for the id, or an empty Opt if there is no entry. An error is returned if there is an entry, but loading the entry value fails.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ Get() [4/5]

MAXON_FUNCTION Result<Opt<typename ATTR::ValueType> > Get ( const ATTR &  attr) const

Returns the current value of the meta data entry for the meta data attribute #attr.

Parameters
[in]attrThe attribute for which the value shall be returned (has to be declared with MAXON_ATTRIBUTE).
Returns
The current value for the id, or an empty Opt if there is no entry. An error is returned if there is an entry, but loading the entry value fails.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ Get() [5/5]

MAXON_FUNCTION Result<typename ATTR::ValueType> Get ( const ATTR &  attr,
const typename ATTR::ValueType &  defaultValue 
) const

Returns the current value of the meta data entry for the meta data attribute #attr.

Parameters
[in]attrThe attribute for which the value shall be returned (has to be declared with MAXON_ATTRIBUTE).
[in]defaultValueThe default value to use when there is no entry.
Returns
The current value for the id, or the defaultValue if there is no entry. An error is returned if there is an entry, but loading the entry value fails.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ GetTimeStamp()

MAXON_METHOD Int GetTimeStamp ( const InternedId metaId) const

Returns the time stamp for the meta data attribute #metaId. The time stamp is increased each time the value changes.

Parameters
[in]metaIdThe identifier of the meta data attribute.
Returns
The time stamp for the attribute, or 0 if there is no entry for the attribute.
Note
The returned value may differ from call to call because another thread could have modified the meta data in between.

◆ DefaultValuePtr()

static MAXON_METHOD const AssetMetaDataInterface* DefaultValuePtr ( )
staticprivate

◆ PrivateGet()

MAXON_METHOD Result<void> PrivateGet ( const InternedId metaId,
const DataType type,
Generic *  mem 
) const