public:
TestTicketObserver()
: mLoadingFailedCalled(0), mLoadingSucceededCalled(0),
- mSavingFailedCalled(0), mSavingSucceededCalled(0),
mUploadedCount(0)
{}
tet_printf("TicketObserver: LoadingSucceeded() called %d times", mLoadingSucceededCalled);
return mLoadingSucceededCalled;
}
- int SaveFailedCalled() {
- tet_printf("TicketObserver: SavingFailed() called %d times", mSavingFailedCalled);
- return mSavingFailedCalled;
- }
- int SaveSucceededCalled() {
- tet_printf("TicketObserver: SavingSucceeded() called %d times", mSavingSucceededCalled);
- return mSavingSucceededCalled;
- }
int UploadCalled() {
tet_printf("TicketObserver: Uploaded() called %d times", mUploadedCount);
return mUploadedCount;
void Reset() {
mLoadingFailedCalled = 0;
mLoadingSucceededCalled = 0;
- mSavingFailedCalled = 0;
- mSavingSucceededCalled = 0;
mUploadedCount = 0;
}
public: // From ResourceTicketObserver
virtual void ResourceLoadingFailed(const Internal::ResourceTicket& ticket) {mLoadingFailedCalled++;}
virtual void ResourceLoadingSucceeded(const Internal::ResourceTicket& ticket) {mLoadingSucceededCalled++;}
- virtual void ResourceSavingFailed(const Internal::ResourceTicket& ticket) {mSavingFailedCalled++;}
- virtual void ResourceSavingSucceeded(const Internal::ResourceTicket& ticket) {mSavingSucceededCalled++;}
virtual void ResourceUploaded(const Internal::ResourceTicket& ticket) {mUploadedCount++;}
private:
int mLoadingFailedCalled;
int mLoadingSucceededCalled;
- int mSavingFailedCalled;
- int mSavingSucceededCalled;
int mUploadedCount;
};
END_TEST;
}
-/**
-//int UtcDaliInternalSaveResource01(void)//
-{
- TestApplication application;
- tet_infoline("Testing SaveResource() with valid id, and valid filename");
- testTicketObserver.Reset();
-
- DALI_TEST_CHECK(0);
- END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource02(void)//
-{
- TestApplication application;
- tet_infoline("Testing SaveResource() with invalid id");
- testTicketObserver.Reset();
-
- DALI_TEST_CHECK(0);
- END_TEST;
-}
-
-//int UtcDaliInternalSaveResource03(void)//
-{
- TestApplication application;
- tet_infoline("Testing SaveResource() with invalid id");
- testTicketObserver.Reset();
-
- DALI_TEST_CHECK ( 0 );
- END_TEST;
-}
-
-
-//int UtcDaliInternalSaveResource04(void)//
-{
- TestApplication application;
- tet_infoline("Testing SaveResource() with valid id, but invalid filename");
- testTicketObserver.Reset();
- DALI_TEST_CHECK( 0 );
- END_TEST;
-}
-*/
-
-int UtcDaliInternalSaveResource05(void)
-{
- TestApplication application;
- tet_infoline("Testing SaveResource() with valid id, but invalid resource type");
- testTicketObserver.Reset();
-
- Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient();
-
- // First, load a bitmap resource
- Internal::ResourceTicketPtr ticket = CheckLoadBitmap(application, "bitmap.jpg", 80, 80);
-
- // Try saving it
- resourceClient.SaveResource( ticket, "bitmap.png" );
- application.SendNotification(); // Flush update messages
- application.Render(); // Process save resource request
-
- DALI_TEST_CHECK( ! application.GetPlatform().WasCalled(TestPlatformAbstraction::SaveResourceFunc ) );
- END_TEST;
-}
-
int UtcDaliInternalRequestResourceTicket01(void)
{
TestApplication application;
}
/**
- * @copydoc PlatformAbstraction::SaveResource()
- */
-void TestPlatformAbstraction::SaveResource(const Integration::ResourceRequest& request)
-{
- mTrace.PushCall("SaveResource", "");
- if(mRequest != NULL)
- {
- delete mRequest;
- tet_infoline ("Warning: multiple resource requests not handled by Test Suite. You may see unexpected errors");
- }
- mRequest = new Integration::ResourceRequest(request);
-}
-
-/**
* @copydoc PlatformAbstraction::CancelLoad()
*/
void TestPlatformAbstraction::CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId)
{
cache.LoadFailed( mResources.loadFailedId, mResources.loadFailure );
}
- if(mResources.saved)
- {
- cache.SaveComplete( mResources.savedId, mResources.savedType );
- }
- if(mResources.saveFailed)
- {
- cache.SaveFailed( mResources.saveFailedId, mResources.saveFailure );
- }
}
/**
case SuspendFunc: return mTrace.FindMethod("Suspend");
case ResumeFunc: return mTrace.FindMethod("Resume");
case LoadResourceFunc: return mTrace.FindMethod("LoadResource");
- case SaveResourceFunc: return mTrace.FindMethod("SaveResource");
case LoadFileFunc: return mTrace.FindMethod("LoadFile");
case SaveFileFunc: return mTrace.FindMethod("SaveFile");
case CancelLoadFunc: return mTrace.FindMethod("CancelLoad");
mResources.loadFailure = failure;
}
-void TestPlatformAbstraction::SetResourceSaved(Integration::ResourceId savedId,
- Integration::ResourceTypeId savedType)
-{
- mResources.saved = true;
- mResources.savedId = savedId;
- mResources.savedType = savedType;
-}
-
-void TestPlatformAbstraction::SetResourceSaveFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure)
-{
- mResources.saveFailed = true;
- mResources.saveFailedId = id;
- mResources.saveFailure = failure;
-}
-
Integration::ResourceRequest* TestPlatformAbstraction::GetRequest()
{
return mRequest;
bool loadFailed;
Integration::ResourceId loadFailedId;
Integration::ResourceFailure loadFailure;
-
- bool saved;
- Integration::ResourceId savedId;
- Integration::ResourceTypeId savedType;
-
- bool saveFailed;
- Integration::ResourceId saveFailedId;
- Integration::ResourceFailure saveFailure;
};
struct LoadFileResult
virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
/**
- * @copydoc PlatformAbstraction::SaveResource()
- */
- virtual void SaveResource(const Integration::ResourceRequest& request);
-
- /**
* @copydoc PlatformAbstraction::CancelLoad()
*/
virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
SuspendFunc,
ResumeFunc,
LoadResourceFunc,
- SaveResourceFunc,
SaveFileFunc,
LoadFileFunc,
CancelLoadFunc,
void SetResourceLoadFailed(Integration::ResourceId id,
Integration::ResourceFailure failure);
- void SetResourceSaved(Integration::ResourceId savedId,
- Integration::ResourceTypeId savedType);
-
- void SetResourceSaveFailed(Integration::ResourceId id,
- Integration::ResourceFailure failure);
-
Integration::ResourceRequest* GetRequest();
void DiscardRequest();
virtual ResourcePointer LoadResourceSynchronously( const ResourceType& resourceType, const std::string& resourcePath ) = 0;
/**
- * Request that a resource be saved to the native filesystem.
- * This is an asynchronous request.
- */
- virtual void SaveResource(const ResourceRequest& request) = 0;
-
- /**
* Cancel an ongoing LoadResource() request.
* Multi-threading note: this method will be called from the main thread only i.e. not
* from within the Core::Render() method.
virtual void LoadResponse(ResourceId id, ResourceTypeId type, ResourcePointer resource, LoadStatus status) = 0;
/**
- * Provide the results of a resource saving operation.
- * @param[in] id The unique ID of the resource.
- * This should match an ID previously passed into PlatformAbstraction::SaveResource().
- * @param[in] type The type of the resource.
- */
- virtual void SaveComplete(ResourceId id, ResourceTypeId type) = 0;
-
- /**
* Report that a resource loading operation has failed.
* @param[in] id The unique ID of the load request.
* This should match an ID previously passed into PlatformAbstraction::LoadResource().
* @param[in] failure An error code, used to determine why the load failed.
*/
virtual void LoadFailed(ResourceId id, ResourceFailure failure) = 0;
-
- /**
- * Report that a resource saving operation has failed.
- * @param[in] id The unique ID of the save request.
- * This should match an ID previously passed into PlatformAbstraction::LoadResource().
- * @param[in] failure An error code, used to determine why the save failed.
- */
- virtual void SaveFailed(ResourceId id, ResourceFailure failure) = 0;
};
mUploaded.Emit( Dali::Image( this ) );
}
-void Image::ResourceSavingSucceeded( const ResourceTicket& ticket )
-{
- // do nothing
-}
-
-void Image::ResourceSavingFailed( const ResourceTicket& ticket )
-{
- // do nothing
-}
-
unsigned int Image::GetWidth() const
{
return mWidth;
*/
virtual void ResourceUploaded(const ResourceTicket& ticket);
- /**
- * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingSucceeded()
- */
- virtual void ResourceSavingSucceeded( const ResourceTicket& ticket );
-
- /**
- * @copydoc Dali::Internal::ResourceTicketObserver::ResourceSavingFailed()
- */
- virtual void ResourceSavingFailed( const ResourceTicket& ticket );
-
public:
/**
return resourceExists;
}
-void ResourceClient::SaveResource( ResourceTicketPtr ticket, const std::string& url )
-{
- DALI_ASSERT_DEBUG( ticket );
-
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: SaveResource(Id: %u, path:%s)\n", ticket->GetId(), url.c_str());
-
- const ResourceTypePath * const typePathPtr = &ticket->GetTypePath();
- if( typePathPtr )
- {
- if( 0 != url.length() )
- {
- ResourceTypePath typePath( *(typePathPtr->type), url );
- RequestSaveResourceMessage( mEventThreadServices, mResourceManager, ticket->GetId(), typePath );
- }
- else
- {
- ResourceTypePath typePath( *typePathPtr );
- RequestSaveResourceMessage( mEventThreadServices, mResourceManager, ticket->GetId(), typePath );
- }
- }
-}
-
ResourceTicketPtr ResourceClient::RequestResourceTicket( ResourceId id )
{
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: RequestResourceTicket(Id: %u)\n", id);
}
}
-void ResourceClient::NotifySaveRequested( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySaveRequested(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- SaveResource( ticket, "" );
- }
-}
-
-
void ResourceClient::NotifyLoading( ResourceId id )
{
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifyLoading(id:%u)\n", id);
}
}
-void ResourceClient::NotifySavingSucceeded( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySavingSucceeded(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->SavingSucceeded();
- }
-}
-
-void ResourceClient::NotifySavingFailed( ResourceId id )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: NotifySavingFailed(id:%u)\n", id);
-
- TicketContainerIter ticketIter = mImpl->mTickets.find(id);
- if(ticketIter != mImpl->mTickets.end())
- {
- ResourceTicket* ticket = ticketIter->second;
- ticket->SavingFailed();
- }
-}
-
void ResourceClient::UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ) ///!< Issue #AHC01
{
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceClient: UpdateImageTicket(id:%u)\n", id);
bool ReloadResource( ResourceId id, bool resetFinishedStatus = false, Integration::LoadResourcePriority priority = Integration::LoadPriorityNormal );
/**
- * Save a resource to the given url.
- * If the resource type is saveable (model), then the ticket observer will get
- * notified with ResourceSavingSucceeded() or ResourceSavingFailed(), otherwise there
- * will be no response.
- * @param[in] ticket The ticket of the resource to save
- * @param[in] url The url to save the resource to.
- */
- void SaveResource( ResourceTicketPtr ticket, const std::string& url );
-
- /**
* Get the ticket for the associated resource ID.
* If no ticket can be found for this resource, then this returns
* NULL to indicate the resource doesn't exist.
void NotifyUploaded( ResourceId id );
/**
- * Notify client that the resource has been updated and requires saving.
- * @param[in] id The resource id of the updated resource
- */
- void NotifySaveRequested( ResourceId id );
-
- /**
* Notify associated ticket observers that the resource is loading.
* @param[in] id The resource id of the loading resource
*/
*/
void NotifyLoadingFailed( ResourceId id );
- /**
- * Notify associated ticket observers that the resource has saved successfully
- * @param[in] id The resource id of the saved resource
- */
- void NotifySavingSucceeded( ResourceId id );
-
- /**
- * Notify associated ticket observers that the resource save failed
- * @param[in] id The resource id of the failed resource
- */
- void NotifySavingFailed( ResourceId id );
-
/**
* Finds ImageTicket which belongs to resource identified by id and updates the cached
* attributes with a new set which contains the actual width and height of the loaded
return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyUploaded, id );
}
-inline MessageBase* SaveResourceMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifySaveRequested, id );
-}
-
inline MessageBase* LoadingMessage( ResourceClient& client, ResourceId id )
{
return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyLoading, id );
return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifyLoadingFailed, id );
}
-inline MessageBase* SavingSucceededMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifySavingSucceeded, id );
-}
-
-inline MessageBase* SavingFailedMessage( ResourceClient& client, ResourceId id )
-{
- return new MessageValue1< ResourceClient, ResourceId >( &client, &ResourceClient::NotifySavingFailed, id );
-}
-
} // namespace Internal
} // namespace Dali
* @param[in] ticket The ticket for this resource.
*/
virtual void ResourceUploaded( const ResourceTicket& ticket ) = 0;
-
- /**
- * Called when a resource is saved successfully.
- * @param[in] ticket The ticket for this resource.
- */
- virtual void ResourceSavingSucceeded( const ResourceTicket& ticket ) = 0;
-
- /**
- * Called when a resource fails to save.
- * @param[in] ticket The ticket for this resource.
- */
- virtual void ResourceSavingFailed( const ResourceTicket& ticket ) = 0;
};
} // namespace Internal
mObservers.erase( endIter, mObservers.end() );
}
-void ResourceTicket::SavingSucceeded()
-{
- // Using array operator as the call back out to application code might call back in
- // and corrupt the mObservers list. Presumption is the operator gets the current address
- // and adds an offset so a push_back() triggered reallocation should still work.
- size_t count = mObservers.size();
- for(size_t i = 0; i < count; i++)
- {
- if( mObservers[i] != NULL)
- {
- mObservers[i]->ResourceSavingSucceeded(*this);
- }
- }
-
- // Move NULL pointers to the end...
- ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
- // ...and remove them
- mObservers.erase( endIter, mObservers.end() );
-}
-
-void ResourceTicket::SavingFailed()
-{
- // Using array operator as the call back out to application code might call back in
- // and corrupt the mObservers list. Presumption is the operator gets the current address
- // and adds an offset so a push_back() triggered reallocation should still work.
- size_t count = mObservers.size();
- for(size_t i = 0; i < count; i++)
- {
- if( mObservers[i] != NULL)
- {
- mObservers[i]->ResourceSavingFailed(*this);
- }
- }
-
- // Move NULL pointers to the end...
- ObserverIter endIter = remove_if( mObservers.begin(), mObservers.end(), isNULL );
-
- // ...and remove them
- mObservers.erase( endIter, mObservers.end() );
-}
-
void ResourceTicket::StopLifetimeObservation()
{
mLifetimeObserver = NULL;
void Uploaded();
/**
- * Called when a resource is saved successfully.
- * The ResourceTicketObservers will be notified.
- */
- void SavingSucceeded();
-
- /**
- * Called when a resource fails to save.
- * The ResourceTicketObservers will be notified.
- */
- void SavingFailed();
-
- /**
* Called when the ResourceTicketLifetimeObserver is being destroyed.
* This method should only be called during destruction of the Dali core.
*/
enum PostProcess
{
UPLOADED,
- SAVE,
DELETED
};
LiveRequestContainer newFailedRequests;
LiveRequestContainer oldFailedRequests;
DeadRequestContainer deadRequests;
- LiveRequestContainer saveRequests; ///< copy of id's being saved (must also be in newCompleteRequests or oldCompleteRequests)
- LiveRequestContainer completeSaveRequests; ///< successful save ids are moved from saveRequests to here
/**
* This is the resource cache. It's filled/emptied from within Core::Update()
SendToClient( UploadedMessage( *mImpl->mResourceClient, ppRequest.id ) );
break;
}
- case ResourcePostProcessRequest::SAVE:
- {
- SendToClient( SaveResourceMessage( *mImpl->mResourceClient, ppRequest.id ) );
- break;
-
- }
case ResourcePostProcessRequest::DELETED:
{
// TextureObservers handled in TextureCache
workTodo |= !mImpl->newFailedRequests.empty();
// check if there's something still loading
workTodo |= !mImpl->loadingRequests.empty();
- workTodo |= !mImpl->saveRequests.empty();
return workTodo;
}
}
}
-void ResourceManager::HandleSaveResourceRequest( ResourceId id, const ResourceTypePath& typePath )
-{
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleSaveResourceRequest(id:%u, path:%s)\n", id, typePath.path.c_str());
-
- bool resourceFound = false;
-
- // ID must be in the complete sets
- LiveRequestIter iter = mImpl->newCompleteRequests.find(id);
- if (iter != mImpl->newCompleteRequests.end())
- {
- resourceFound = true;
- }
- else
- {
- LiveRequestIter iter = mImpl->oldCompleteRequests.find(id);
- if (iter != mImpl->oldCompleteRequests.end())
- {
- resourceFound = true;
- }
- }
-
- if( resourceFound )
- {
- ResourcePointer resource;
- DALI_ASSERT_DEBUG( typePath.type != NULL );
-
- switch( typePath.type->id )
- {
- case ResourceBitmap:
- {
- break;
- }
- case ResourceNativeImage:
- {
- break;
- }
- case ResourceTargetImage:
- {
- break;
- }
-
- }
-
- if( resource ) // i.e. if it's a saveable resource
- {
- mImpl->saveRequests.insert(id);
-
- ResourceRequest request(id, *typePath.type, typePath.path, resource);
- mImpl->mPlatformAbstraction.SaveResource(request);
- }
- }
-}
-
void ResourceManager::HandleDiscardResourceRequest( ResourceId deadId, ResourceTypeId typeId )
{
bool wasComplete = false;
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: HandleDiscardResourceRequest(id:%u)\n", deadId);
- // remove copies of the deadId from completed/failed saving sets
- RemoveId(mImpl->completeSaveRequests, deadId);
-
// Search for the ID in one of the live containers
// IDs are only briefly held in the new-completed or failed containers; check those last
// Try removing from the old-completed requests
}
}
-void ResourceManager::SaveComplete(ResourceId id, ResourceTypeId type)
-{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: SaveComplete(id:%u)\n", id);
-
- // ID must be in the saving set
- LiveRequestIter iter = mImpl->saveRequests.find(id);
-
- if (iter != mImpl->saveRequests.end())
- {
- // Remove from the saving set
- mImpl->saveRequests.erase(iter);
-
- // If resource has not been discarded..
- if( mImpl->deadRequests.find(id) == mImpl->deadRequests.end() )
- {
- SendToClient( SavingSucceededMessage( *mImpl->mResourceClient, id ) );
- }
-
- mImpl->cacheUpdated = true;
- }
-}
-
void ResourceManager::LoadFailed(ResourceId id, ResourceFailure failure)
{
DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: LoadFailed(id:%u)\n", id);
}
}
-void ResourceManager::SaveFailed(ResourceId id, ResourceFailure failure)
-{
- DALI_ASSERT_DEBUG( mImpl->mResourceClient != NULL );
- DALI_LOG_INFO(Debug::Filter::gResource, Debug::General, "ResourceManager: SaveFailed(id:%u)\n", id);
-
- // ID must be in the saving set
- LiveRequestIter iter = mImpl->saveRequests.find(id);
-
- if (iter != mImpl->saveRequests.end())
- {
- // Remove from the saving set
- mImpl->saveRequests.erase(iter);
-
- // If resource has not been discarded..
-
- if( mImpl->deadRequests.find(id) == mImpl->deadRequests.end() )
- {
- SendToClient( SavingFailedMessage( *mImpl->mResourceClient, id ) );
- }
-
- mImpl->cacheUpdated = true;
- }
-}
-
/********************************************************************************
********************************* Private Methods *****************************
********************************************************************************/
{
for (DeadRequestIter iter = mImpl->deadRequests.begin(); iter != mImpl->deadRequests.end(); )
{
- // Delay destroying ids in saveRequests
- if( mImpl->saveRequests.find(iter->first) != mImpl->saveRequests.end())
- {
- ++iter;
- continue;
- }
-
- /**
- * We should find a resource of the correct type, and move it to the DiscardQueue.
- */
- switch (iter->second)
- {
- case ResourceBitmap:
- case ResourceNativeImage:
- case ResourceTargetImage:
- break;
- }
-
// Erase the item and increment the iterator
mImpl->deadRequests.erase(iter++);
}
void HandleReloadResourceRequest( ResourceId id, const ResourceTypePath& typePath, Integration::LoadResourcePriority priority, bool resetFinishedStatus );
/**
- * Save a resource to the given url
- * @param[in] id The resource id
- * @param[in] typePath The type & path of the resource
- */
- void HandleSaveResourceRequest( ResourceId id, const ResourceTypePath& typePath );
-
- /**
* Resource ticket has been discarded, throw away the actual resource
*/
void HandleDiscardResourceRequest( ResourceId id, Integration::ResourceTypeId typeId );
virtual void LoadResponse(ResourceId id, Integration::ResourceTypeId type, Integration::ResourcePointer resource, Integration::LoadStatus loadStatus);
/**
- * @copydoc Integration::ResourceCache::SaveComplete
- */
- virtual void SaveComplete(ResourceId id, Integration::ResourceTypeId type);
-
- /**
* @copydoc Integration::ResourceCache::LoadFailed
*/
virtual void LoadFailed(ResourceId id, Integration::ResourceFailure failure);
- /**
- * @copydoc Integration::ResourceCache::SaveFailed
- */
- virtual void SaveFailed(ResourceId id, Integration::ResourceFailure failure);
-
/********************************************************************************
********************************* Private Methods *****************************
********************************************************************************/
new (slot) LocalType( &manager, &ResourceManager::HandleReloadResourceRequest, id, typePath, priority, resetFinishedStatus );
}
-inline void RequestSaveResourceMessage( EventThreadServices& eventThreadServices,
- ResourceManager& manager,
- ResourceId id,
- const ResourceTypePath& typePath )
-{
- typedef MessageValue2< ResourceManager, ResourceId, ResourceTypePath > LocalType;
-
- // Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
- // Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &ResourceManager::HandleSaveResourceRequest, id, typePath );
-}
-
inline void RequestDiscardResourceMessage( EventThreadServices& eventThreadServices,
ResourceManager& manager,
ResourceId id,