CmResource.h 1002 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmIReflectable.h"
  4. #include "CmCoreObject.h"
  5. namespace CamelotFramework
  6. {
  7. /**
  8. * @brief Base class for all resources used in the engine.
  9. */
  10. class CM_EXPORT Resource : public IReflectable, public CoreObject
  11. {
  12. public:
  13. Resource(bool requiresGpuInitialization = true);
  14. virtual ~Resource() {};
  15. const String& getUUID() const { return mUUID; }
  16. /**
  17. * @brief Creates a new resource handle. Should only be called by internal methods.
  18. */
  19. static HResource _createResourceHandle(ResourcePtr obj);
  20. protected:
  21. friend class Resources;
  22. String mUUID;
  23. UINT32 mSize;
  24. /************************************************************************/
  25. /* SERIALIZATION */
  26. /************************************************************************/
  27. public:
  28. friend class ResourceRTTI;
  29. static RTTITypeBase* getRTTIStatic();
  30. virtual RTTITypeBase* getRTTI() const;
  31. };
  32. }