PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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