A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[surf] new (abstract) class: PropertyHolder, with only one purpose
[simgrid.git]
/
src
/
surf
/
host_interface.hpp
diff --git
a/src/surf/host_interface.hpp
b/src/surf/host_interface.hpp
index
e0ec337
..
2ae6d5d
100644
(file)
--- a/
src/surf/host_interface.hpp
+++ b/
src/surf/host_interface.hpp
@@
-8,6
+8,7
@@
#include "storage_interface.hpp"
#include "cpu_interface.hpp"
#include "network_interface.hpp"
#include "storage_interface.hpp"
#include "cpu_interface.hpp"
#include "network_interface.hpp"
+#include "src/surf/PropertyHolder.hpp"
#include <xbt/base.h>
#include <xbt/base.h>
@@
-74,7
+75,7
@@
public:
HostModel() : Model() {}
~HostModel() {}
HostModel() : Model() {}
~HostModel() {}
- virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu)=0;
+ virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu
, xbt_dict_t props
)=0;
void addTraces(){DIE_IMPOSSIBLE;}
virtual void adjustWeightOfDummyCpuActions();
void addTraces(){DIE_IMPOSSIBLE;}
virtual void adjustWeightOfDummyCpuActions();
@@
-94,8
+95,10
@@
public:
* @brief SURF Host interface class
* @details An host represents a machine with a aggregation of a Cpu, a Link and a Storage
*/
* @brief SURF Host interface class
* @details An host represents a machine with a aggregation of a Cpu, a Link and a Storage
*/
-class Host : public simgrid::surf::Resource {
+class Host : public simgrid::surf::Resource
, public simgrid::surf::PropertyHolder
{
public:
public:
+ static simgrid::xbt::FacetLevel<simgrid::Host, Host> LEVEL;
+ static void init();
/**
* @brief Host constructor
*
/**
* @brief Host constructor
*
@@
-125,17
+128,11
@@
public:
Cpu *cpu);
/** @brief Host destructor */
Cpu *cpu);
/** @brief Host destructor */
- ~
Host();
+ ~Host();
+ void attach(simgrid::Host* host);
void setState(e_surf_resource_state_t state);
void setState(e_surf_resource_state_t state);
- /**
- * @brief Get the properties of the current Host
- *
- * @return The properties of the current Host
- */
- xbt_dict_t getProperties();
-
/**
* @brief Execute some quantity of computation
*
/**
* @brief Execute some quantity of computation
*
@@
-265,6
+262,7
@@
public:
xbt_dynar_t p_storage;
RoutingEdge *p_netElm;
Cpu *p_cpu;
xbt_dynar_t p_storage;
RoutingEdge *p_netElm;
Cpu *p_cpu;
+ simgrid::Host* p_host = nullptr;
/** @brief Get the list of virtual machines on the current Host */
xbt_dynar_t getVms();
/** @brief Get the list of virtual machines on the current Host */
xbt_dynar_t getVms();
@@
-275,6
+273,7
@@
public:
void getParams(vm_params_t params);
/** @brief Sets the params of that VM/PM */
void setParams(vm_params_t params);
void getParams(vm_params_t params);
/** @brief Sets the params of that VM/PM */
void setParams(vm_params_t params);
+ simgrid::Host* getHost() { return p_host; }
private:
s_vm_params_t p_params;
};
private:
s_vm_params_t p_params;
};