#include "ns3/core-module.h"
#include "ns3/node.h"
-#include "ns3/ns3_simulator.h"
#include "network_ns3.hpp"
+#include "ns3/ns3_simulator.hpp"
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
#include "src/kernel/routing/NetPoint.hpp"
#include "simgrid/s4u/Engine.hpp"
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
NetPointNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetPointNs3>();
- flowFromSock = xbt_dict_new_homogeneous([](void* p) { delete (SgFlow*)p; });
+ flowFromSock = xbt_dict_new_homogeneous([](void* p) { delete static_cast<SgFlow*>(p); });
ns3_initialize(ns3_tcp_model.get().c_str());
simgrid::kernel::routing::NetPoint::onCreation.connect([](simgrid::kernel::routing::NetPoint* pt) {
xbt_dict_free(&flowFromSock);
}
-LinkImpl* NetworkNS3Model::createLink(const char* name, double bandwidth, double latency,
+LinkImpl* NetworkNS3Model::createLink(const std::string& name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
{
return new LinkNS3(this, name, bandwidth, latency);
if(sgFlow->finished_){
xbt_dynar_push(socket_to_destroy,&ns3Socket);
XBT_DEBUG("Destroy socket %p of action %p", ns3Socket, action);
- action->finish();
- action->setState(Action::State::done);
+ action->finish(Action::State::done);
}
}
xbt_dynar_pop(socket_to_destroy,&ns3Socket);
if (XBT_LOG_ISENABLED(ns3, xbt_log_priority_debug)) {
- SgFlow *flow = (SgFlow*)xbt_dict_get (flowFromSock, ns3Socket);
+ SgFlow* flow = static_cast<SgFlow*>(xbt_dict_get(flowFromSock, ns3Socket));
XBT_DEBUG ("Removing socket %p of action %p", ns3Socket, flow->action_);
}
xbt_dict_remove(flowFromSock, ns3Socket);
* Resource *
************/
-LinkNS3::LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency)
+LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency)
: LinkImpl(model, name, nullptr)
{
bandwidth_.peak = bandwidth;