Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _MAXSDK_ASSET_USER_H_
00015 #define _MAXSDK_ASSET_USER_H_
00016
00017
00018 #include "..\maxheap.h"
00019 #include "..\strclass.h"
00020 #include "..\path.h"
00021 #include "..\ifnpub.h"
00022 #include "..\autoptr.h"
00023 #include "AssetType.h"
00024 #include "AssetId.h"
00025 #include "assetmanagementExport.h"
00026
00027
00028 class FileResolutionMgrImp;
00029
00030 #define IID_IASSET_USER Interface_ID(0x32f7bccf, 0xf1881566)
00031
00032 namespace MaxSDK
00033 {
00034 namespace AssetManagement
00035 {
00036 class AssetUser: public IObject, public FPMixinInterface
00037 {
00038 private:
00039 class AssetUserImp;
00040 AutoPtr<AssetUserImp> mImpl;
00041 unsigned int m_referencesHeld;
00042 static UINT64 num_created;
00043 static UINT64 num_alive;
00044 public:
00045
00047 CoreExport AssetUser();
00048
00052 CoreExport AssetUser(const AssetId& assetId);
00053
00056 CoreExport AssetUser(const AssetUser& assetU);
00057
00060 CoreExport AssetUser& operator=(const AssetUser& assetU);
00061
00064 CoreExport const AssetId& GetId()const;
00065
00068 CoreExport MSTR GetIdAsString()const;
00069
00072 CoreExport AssetType GetType() const;
00073
00076 CoreExport const MSTR& GetFileName()const;
00077
00081 CoreExport MSTR GetFullFilePath()const;
00082
00090 CoreExport bool GetFullFilePath(MaxSDK::Util::Path& filePath)const;
00091
00099 CoreExport bool GetFullFilePath(MSTR& filePath)const;
00100
00110 CoreExport void SetUsedInFileSave();
00111
00114 CoreExport void Reset();
00115
00117
00121 CoreExport IOResult Save(ISave* isave) const;
00122
00123 CoreExport ~AssetUser();
00124
00127 static CoreExport UINT64 GetNumCreated();
00128
00131 static CoreExport UINT64 GetNumAlive();
00132
00133
00134
00135 friend class ::FileResolutionMgrImp;
00136
00137
00138 BaseInterface* GetInterface(Interface_ID id);
00139 BaseInterface * GetInterfaceAt(int i)const;
00140 MCHAR * GetIObjectName() { return _M("AssetUser");}
00141 int NumInterfaces()const;
00142 void AcquireIObject();
00143 void ReleaseIObject();
00144 void DeleteIObject();
00145
00146
00147 LifetimeType LifetimeControl() { return wantsRelease; }
00148 FPInterfaceDesc* GetDescByID(Interface_ID id);
00149 Interface_ID GetID() { return IID_IASSET_USER; }
00150 FPInterfaceDesc* GetDesc() { return GetDescByID(IID_IASSET_USER); }
00151
00152
00153 enum { asset_type };
00154
00155
00156 enum
00157 {
00158 kGetAssetId,
00159 kGetFileName,
00160 kGetType,
00161 kCanGetFullFilePath,
00162 kGetFullFilePath,
00163 };
00164 #pragma warning(push)
00165 #pragma warning(disable:4238)
00166 BEGIN_FUNCTION_MAP
00167 FN_0(kGetAssetId, TYPE_TSTR_BV, GetIdAsString);
00168 FN_0(kGetFileName, TYPE_TSTR_BV, GetFileName);
00169 FN_0(kGetType, TYPE_ENUM, GetType);
00170 FN_1(kCanGetFullFilePath, TYPE_bool, GetFullFilePath, TYPE_TSTR_BR);
00171 FN_0(kGetFullFilePath, TYPE_TSTR_BV, GetFullFilePath);
00172 END_FUNCTION_MAP
00173 #pragma warning(pop)
00174
00175 protected:
00182 CoreExport const MSTR& GetResolvedAssetPath() const;
00183
00195 CoreExport bool SetResolvedAssetPath(const MSTR& resolvedPath);
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 CoreExport DWORD GetTimePathWasResolved() const;
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 CoreExport void SetTimePathWasResolved(DWORD newTime);
00219
00220 };
00221
00222 }
00223 }
00224
00225 #if !defined(NDEBUG) && defined(BUILD_WITH_IMPL)
00226
00227 #include "..\..\..\core\AssetUserImp.h"
00228 #endif
00229
00230 #endif