/include/nebu/topology/physicalLocalStoreFactory.h

https://github.com/deltaforge/nebu-common-cpp · C Header · 51 lines · 24 code · 12 blank · 15 comment · 0 complexity · 62ea80cd4f00abf162a48d0db85d9230 MD5 · raw file

  1. #ifndef NEBU_PHYSICALLOCALSTOREFACTORY_H_
  2. #define NEBU_PHYSICALLOCALSTOREFACTORY_H_
  3. #include "tinyxml2.h"
  4. #include "nebu/topology/physicalLocalStore.h"
  5. namespace nebu
  6. {
  7. namespace common
  8. {
  9. /**Creates a LocalStore from xml.*/
  10. class PhysicalLocalStoreFactory
  11. {
  12. public:
  13. static const std::string ROOT_NAME;
  14. static const std::string ATTR_ID;
  15. /** Simple default (empty) constructor. */
  16. PhysicalLocalStoreFactory() { };
  17. /** Simple default (empty) destructor. */
  18. virtual ~PhysicalLocalStoreFactory() { };
  19. /** Parses a PhysicalLocalStore from the xml.
  20. * @param[in] elem to parse.
  21. * @return a newly created PhysicalLocalStore.
  22. */
  23. virtual Traits<PhysicalLocalStore>::Ptr parseXML(const tinyxml2::XMLElement *elem) const;
  24. /** Gets an instance of this class.
  25. * Creates one if none has been found previously.
  26. * @return an instance of this class.
  27. */
  28. static std::shared_ptr<PhysicalLocalStoreFactory> getInstance();
  29. /** Set an instance of this class to return with getInstance().
  30. * Especially usefull for mocking.
  31. * @param[in] instance to set.
  32. */
  33. static void setInstance(std::shared_ptr<PhysicalLocalStoreFactory> instance);
  34. private:
  35. static std::shared_ptr<PhysicalLocalStoreFactory> instance;
  36. };
  37. }
  38. }
  39. #endif