Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Delegated constructors are a c++11 feature, avoid them.
[simgrid.git] / src / surf / network.hpp
index 6b4ab46..62ae4e4 100644 (file)
@@ -29,16 +29,25 @@ typedef NetworkCm02ActionLmm *NetworkCm02ActionLmmPtr;
  *********/
 extern NetworkCm02ModelPtr surf_network_model;
 
-
+void net_define_callbacks(void);
 
 /*********
  * Model *
  *********/
 class NetworkCm02Model : public Model {
+private:
+  void initialize();
 public:
-  NetworkCm02Model(int i) : Model("network") {};//FIXME: add network clean interface
-  NetworkCm02Model(string name);
-  NetworkCm02Model();
+  NetworkCm02Model(int i) : Model("network") {
+       f_networkSolve = lmm_solve;
+       m_haveGap = false;
+  };//FIXME: add network clean interface
+  NetworkCm02Model(string name) : Model(name) {
+    this->initialize();
+  }
+  NetworkCm02Model() : Model("network") {
+    this->initialize();
+  }
   //FIXME:NetworkCm02LinkPtr createResource(string name);
   NetworkCm02LinkLmmPtr createResource(const char *name,
                                    double bw_initial,
@@ -51,15 +60,15 @@ public:
                                    xbt_dict_t properties);
   void updateActionsStateLazy(double now, double delta);
   virtual void gapAppend(double size, const NetworkCm02LinkLmmPtr link, NetworkCm02ActionLmmPtr action) {};
-  NetworkCm02ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
+  virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
                                           double size, double rate);
   xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays
   //FIXME: virtual void addTraces() =0;
-  void (*f_networkSolve)(lmm_system_t) = lmm_solve;
-  double latencyFactor(double size);
-  double bandwidthFactor(double size);
-  double bandwidthConstraint(double rate, double bound, double size);
-  bool m_haveGap = false;
+  void (*f_networkSolve)(lmm_system_t);
+  virtual double latencyFactor(double size);
+  virtual double bandwidthFactor(double size);
+  virtual double bandwidthConstraint(double rate, double bound, double size);
+  bool m_haveGap;
 };
 
 /************