6 #include "IResourceObserver.h"
9 #include "CallbackCollection.h"
16 template<
typename TResourceType>
21 typedef typename BaseType::CallbackParamType CallbackParamType;
25 void RegisterAddedToSceneGraphCallback(
CallbackType& callback)
27 m_addedToSceneGraphCallbacks.AddCallback(callback);
30 void UnregisterAddedToSceneGraphCallback(
CallbackType& callback)
32 m_addedToSceneGraphCallbacks.RemoveCallback(callback);
35 void RegisterRemovedFromSceneGraphCallback(
CallbackType& callback)
37 m_removedFromSceneGraphCallbacks.AddCallback(callback);
40 void UnregisterRemovedFromSceneGraphCallback(
CallbackType& callback)
42 m_removedFromSceneGraphCallbacks.RemoveCallback(callback);
45 void RegisterResourceDeletedCallback(
CallbackType& callback)
47 m_resourceDeletedCallbacks.AddCallback(callback);
50 void UnregisterResourceDeletedCallback(
CallbackType& callback)
52 m_resourceDeletedCallbacks.RemoveCallback(callback);
55 void NotifyAddedToSceneGraph(CallbackParamType& resource)
57 m_addedToSceneGraphCallbacks.ExecuteCallbacks(resource);
60 void NotifyRemovedFromSceneGraph(CallbackParamType& resource)
62 m_removedFromSceneGraphCallbacks.ExecuteCallbacks(resource);
65 void NotifyResourceDeleted(CallbackParamType& resource)
67 m_resourceDeletedCallbacks.ExecuteCallbacks(resource);