/include/nebu-app-framework/topologyWriter.h

https://github.com/deltaforge/nebu-app-framework-cpp · C Header · 47 lines · 26 code · 10 blank · 11 comment · 0 complexity · b2a79217ad0c73819000281eced9f886 MD5 · raw file

  1. #ifndef NEBUAPPFRAMEWORK_TOPOLOGYWRITER_H_
  2. #define NEBUAPPFRAMEWORK_TOPOLOGYWRITER_H_
  3. #include "nebu/topology/physicalRoot.h"
  4. #include "nebu/virtualMachine.h"
  5. #include <vector>
  6. namespace nebu
  7. {
  8. namespace app
  9. {
  10. namespace framework
  11. {
  12. /** Utility class used to output the topology to a file. */
  13. class TopologyWriter
  14. {
  15. public:
  16. /** Empty constructor. */
  17. TopologyWriter() { }
  18. /** Empty destructor provided for inheritance. */
  19. virtual ~TopologyWriter() { }
  20. /** Writes a mapping from hostname to physical location to a file.
  21. * Uses the filename specified through \link setFilename(const std::string &) setFilename \endlink
  22. * @param[in] topology the physical topology hosting the virtualised application.
  23. * @param[in] vms a vector of VirtualMachines to map to the topology.
  24. */
  25. virtual void write(std::shared_ptr<nebu::common::PhysicalRoot> topology,
  26. std::vector<std::shared_ptr<nebu::common::VirtualMachine>> vms);
  27. /** Sets a filename for use by the writer.
  28. * @param filename the filename to set.
  29. */
  30. virtual void setFilename(const std::string &filename);
  31. protected:
  32. std::string filename;
  33. };
  34. }
  35. }
  36. }
  37. #endif