BsResource.h 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsIReflectable.h"
  4. #include "BsCoreObject.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Base class for all resources.
  9. */
  10. class BS_CORE_EXPORT Resource : public IReflectable, public CoreObject
  11. {
  12. public:
  13. Resource(bool requiresGpuInitialization = true);
  14. virtual ~Resource() {};
  15. /**
  16. * @brief Returns the name of the resource.
  17. */
  18. const String& getName() const { return mName; }
  19. /**
  20. * @brief Sets the name of the resource.
  21. */
  22. void setName(const String& name) { mName = name; }
  23. protected:
  24. friend class Resources;
  25. UINT32 mSize;
  26. String mName;
  27. /************************************************************************/
  28. /* SERIALIZATION */
  29. /************************************************************************/
  30. public:
  31. friend class ResourceRTTI;
  32. static RTTITypeBase* getRTTIStatic();
  33. virtual RTTITypeBase* getRTTI() const;
  34. };
  35. }