Data.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Copyright (c) 2006-2014 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #ifndef LOVE_DATA_H
  21. #define LOVE_DATA_H
  22. // LOVE
  23. #include "config.h"
  24. #include "Object.h"
  25. // C
  26. #include <stddef.h>
  27. namespace love
  28. {
  29. /**
  30. * This class is a simple abstraction over all objects which contain data.
  31. **/
  32. class Data : public Object
  33. {
  34. public:
  35. /**
  36. * Destructor.
  37. **/
  38. virtual ~Data() {}
  39. /**
  40. * Gets a pointer to the data. This pointer will obviously not
  41. * be valid if the Data object is destroyed.
  42. **/
  43. virtual void *getData() const = 0;
  44. /**
  45. * Gets the size of the Data in bytes.
  46. **/
  47. virtual size_t getSize() const = 0;
  48. }; // Data
  49. } // love
  50. #endif // LOVE_DATA_H