Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
NS3: move the content of Model::communicate into Action constructor
[simgrid.git] / src / surf / surf_interface.hpp
index 12379ff..66ed71d 100644 (file)
@@ -374,7 +374,7 @@ namespace surf {
 
 /** @ingroup SURF_interface
  * @brief SURF resource interface class
- * @details A resource represent an element of a component (e.g.: a link for the network)
+ * @details This is the ancestor class of every resources in SimGrid, such as links, CPU or storage
  */
 XBT_PUBLIC_CLASS Resource {
 public:
@@ -395,24 +395,13 @@ public:
    */
   Resource(Model *model, const char *name, lmm_constraint_t constraint);
 
-  Resource(Model *model, const char *name, lmm_constraint_t constraint, int initiallyOn);
-
-  /**
-   * @brief Resource constructor
-   *
-   * @param model Model associated to this Resource
-   * @param name The name of the Resource
-   * @param initiallyOn the initial state of the Resource
-   */
-  Resource(Model *model, const char *name, int initiallyOn);
-
   virtual ~Resource();
 
   /** @brief Get the Model of the current Resource */
-  Model *getModel() const ;
+  Model *getModel() const;
 
   /** @brief Get the name of the current Resource */
-  const char *getName() const ;
+  const char *getName() const;
 
   bool operator==(const Resource &other) const;
 
@@ -428,9 +417,9 @@ public:
   virtual bool isUsed()=0;
 
   /** @brief Check if the current Resource is active */
-  virtual bool isOn();
+  virtual bool isOn() const;
   /** @brief Check if the current Resource is shut down */
-  virtual bool isOff();
+  virtual bool isOff() const;
   /** @brief Turn on the current Resource */
   virtual void turnOn();
   /** @brief Turn off the current Resource */
@@ -439,11 +428,11 @@ public:
 private:
   const char *name_;
   Model *model_;
-  bool isOn_;
+  bool isOn_ = true;
 
 public: /* LMM */
   /** @brief Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) */
-  lmm_constraint_t getConstraint();
+  lmm_constraint_t getConstraint() const;
 protected:
   lmm_constraint_t constraint_ = nullptr;
 };