friend vm::VMModel; // Use the pimpl_cpu to compute the VM sharing
friend vm::VirtualMachineImpl; // creates the the pimpl_cpu
friend kernel::routing::NetZoneImpl;
+ friend surf::HostImpl; // call destructor from private implementation
+
+ // The private implementation, that never changes
+ surf::HostImpl* const pimpl_;
public:
- explicit Host(const std::string& name);
+ explicit Host(surf::HostImpl* pimpl) : pimpl_(pimpl) {}
protected:
virtual ~Host(); // Call destroy() instead of manually deleting it.
static Host* current();
/** Retrieves the name of that host as a C++ string */
- xbt::string const& get_name() const { return name_; }
+ xbt::string const& get_name() const;
/** Retrieves the name of that host as a C string */
- const char* get_cname() const { return name_.c_str(); }
+ const char* get_cname() const;
kernel::routing::NetPoint* get_netpoint() const { return pimpl_netpoint_; }
/** Block the calling actor on an execution located on the called host (with explicit priority) */
void execute(double flops, double priority) const;
+ surf::HostImpl* get_impl() const { return pimpl_; }
private:
- xbt::string name_{"noname"};
kernel::routing::NetPoint* pimpl_netpoint_ = nullptr;
public:
#ifndef DOXYGEN
/** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
kernel::resource::Cpu* pimpl_cpu = nullptr;
- // TODO, this could be a unique_ptr
- surf::HostImpl* pimpl_ = nullptr;
#endif
};
} // namespace s4u