IEnumAuxAssetsCallback Class Reference

IEnumAuxAssetsCallback Class Referenceabstract

#include <IAssetAccessor.h>

Class Description

An extension of AssetEnumCallback that exposes an interface for providing more detailed information about an asset.

An extension of AssetEnumCallback that allows an application component to declare more information about an asset, and to provide a callback method for retargeting that asset. A client wishing to expose more asset information should follow the following code example:

class PointCacheAssetAccessor : public IAssetAccessor {
public:
PointCacheAssetAccessor(PointCacheBase* aPointCache);
// path accessor functions
virtual MaxSDK::AssetManagement::AssetUser GetAsset() const ;
virtual bool SetPath(const MaxSDK::AssetManagement::AssetUser& aNewAsset) ;
// asset client information
virtual int GetAssetType() const ;
protected:
PointCacheBase* mPointCache;
};
PointCacheAssetAccessor::PointCacheAssetAccessor(PointCacheBase* aPointCache) :
mPointCache(aPointCache)
{
}
MaxSDK::AssetManagement::AssetUser PointCacheAssetAccessor::GetAsset() const {
return mPointCache->pblock->GetAssetUser(pb_cache_file);
;
}
bool PointCacheAssetAccessor::SetAsset(const MaxSDK::AssetManagement::AssetUser& aNewAsset) {
mPointCache->pblock->SetValue(pb_cache_file, 0, aNewAsset);
}
int PointCacheAssetAccessor::GetAssetType() const {
}
void PointCacheBase::EnumAuxFiles(AssetEnumCallback& nameEnum, DWORD flags)
{
if ((flags&FILE_ENUM_CHECK_AWORK1)&&TestAFlag(A_WORK1)) return; // LAM - 4/11/03
PointCacheAssetAccessor accessor(this);
if(accessor.GetAsset().GetId()!=MaxSDK::AssetManagement::kInvalidId) {
IEnumAuxAssetsCallback* callback = static_cast<IEnumAuxAssetsCallback*>(&nameEnum);
callback->DeclareAsset(accessor);
}
}
else {
// do normal enum business
}
}
If the FILE_ENUM_ACCESSOR_INTERFACE is passed to the EnumAuxFiles, then it
is safe to cast the AssetEnumCallback object to the IEnumAuxAssetsCallback interface.
From there, an asset can declare it's own asset interface, as shown in the above
example.  This example is taken from the <b>maxsdk\\samples\\modifiers\\pointcache</b> sample
plugin project.
+ Inheritance diagram for IEnumAuxAssetsCallback:

Public Member Functions

virtual void DeclareAsset (IAssetAccessor &anAccessor)=0
 Allows a client to implement and return an asset accessor object. More...
 
virtual void DeclareGroup (IAssetAccessor &anAccessor)=0
 Allows a client to declare a new asset sub-group. More...
 
virtual void EndGroup ()=0
 Used to end the declaration of a sub-group of assets. More...
 
- Public Member Functions inherited from AssetEnumCallback
virtual ~AssetEnumCallback ()
 
virtual void RecordAsset (const MaxSDK::AssetManagement::AssetUser &asset)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Member Function Documentation

virtual void DeclareAsset ( IAssetAccessor anAccessor)
pure virtual

Allows a client to implement and return an asset accessor object.

An application component wishing to declare an asset should implement the IAssetAccessor interface and return an instance of that implementation via this method. It is important to note that a link to this interface is not kept by the IEnumAuxAssetsCallback object receiving the interface. The interface need only be valid for the length of the DeclareAsset method call. This allows a component to pass in a stack object that will be destroyed at the end of the scope containing this method call. See class description for a code sample.

Parameters
[in]anAccessorAn asset accessor object.
virtual void DeclareGroup ( IAssetAccessor anAccessor)
pure virtual

Allows a client to declare a new asset sub-group.

Allows a client to declare a new asset subgroup. An example of a sub-group would be an xref file that has its own assets. This method declares that we are now enumerating a sub-group of assets, meaning that declared assets will be added to this group. It is possible to nest groups further by making repeated calls to this function. To end the declaration of a group, call EndGroup().

Precondition
The asset accessor should not return NULL for a newly declared group. It is the onus of the asset client to check that IAssetAccessor::GetPath returns a non-null value. If null is returned, neither DeclareGroup nor EndGroup should be called.
Parameters
[in]anAccessorAn asset accessor describing the asset which holds a a sub-group of assets.
virtual void EndGroup ( )
pure virtual

Used to end the declaration of a sub-group of assets.

Called when a client is done declaring a sub-group of assets. See DeclareGroup(IAssetAccessor&) for details.