BsProjectLibraryEntries.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "Library/BsProjectLibrary.h"
  6. #include "Reflection/BsIReflectable.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Library-Internal
  10. * @{
  11. */
  12. /**
  13. * Contains a list of entries used by the ProjectLibrary. Used primarily for serialization purposes (persisting
  14. * ProjectLibrary state between application runs).
  15. */
  16. class ProjectLibraryEntries : public IReflectable
  17. {
  18. struct ConstructPrivately { };
  19. public:
  20. explicit ProjectLibraryEntries(const ConstructPrivately& dummy);
  21. ProjectLibraryEntries(const USPtr<ProjectLibrary::DirectoryEntry>& rootEntry);
  22. /**
  23. * Creates new project library entries based on a ProjectLibrary root directory entry.
  24. *
  25. * @param[in] rootEntry Root directory entry in ProjectLibrary.
  26. */
  27. static SPtr<ProjectLibraryEntries> create(const USPtr<ProjectLibrary::DirectoryEntry>& rootEntry);
  28. /** Returns the root directory entry that references the entire entry hierarchy. */
  29. const USPtr<ProjectLibrary::DirectoryEntry>& getRootEntry() const { return mRootEntry; }
  30. private:
  31. USPtr<ProjectLibrary::DirectoryEntry> mRootEntry;
  32. /************************************************************************/
  33. /* SERIALIZATION */
  34. /************************************************************************/
  35. /** Creates new empty project library entries object. Used for serialization purposes. */
  36. static SPtr<ProjectLibraryEntries> createEmpty();
  37. public:
  38. friend class ProjectLibraryEntriesRTTI;
  39. static RTTITypeBase* getRTTIStatic();
  40. RTTITypeBase* getRTTI() const override;
  41. };
  42. /** @} */
  43. }