Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill useless typedefs routing_NetPoint and sg_netpoint_t.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 3 Apr 2018 12:58:34 +0000 (14:58 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 3 Apr 2018 13:01:34 +0000 (15:01 +0200)
include/simgrid/forward.h
include/simgrid/kernel/routing/NetPoint.hpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.hpp
src/kernel/routing/FloydZone.cpp
src/s4u/s4u_netzone.cpp
src/surf/xml/platf_private.hpp

index 0b77f99..4f75329 100644 (file)
@@ -91,7 +91,6 @@ typedef simgrid::s4u::Storage s4u_Storage;
 typedef simgrid::s4u::NetZone s4u_NetZone;
 typedef simgrid::s4u::VirtualMachine s4u_VM;
 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
-typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
 typedef simgrid::trace_mgr::trace tmgr_Trace;
 
 typedef simgrid::kernel::context::Context* smx_context_t;
@@ -113,7 +112,6 @@ typedef struct s4u_Storage s4u_Storage;
 typedef struct s4u_NetZone s4u_NetZone;
 typedef struct s4u_VM s4u_VM;
 typedef struct kernel_Activity* smx_activity_t;
-typedef struct routing_NetPoint routing_NetPoint;
 typedef struct Trace tmgr_Trace;
 
 typedef struct s_smx_context* smx_context_t;
@@ -132,8 +130,6 @@ typedef s4u_File* sg_file_t;
 typedef s4u_VM* sg_vm_t;
 typedef s4u_Actor* sg_actor_t;
 
-typedef routing_NetPoint* sg_netpoint_t;
-
 typedef tmgr_Trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
 
 typedef struct s_smx_simcall* smx_simcall_t;
index cfcd311..94c0dd3 100644 (file)
@@ -54,6 +54,6 @@ private:
 } // namespace kernel
 } // namespace simgrid
 
-XBT_PUBLIC sg_netpoint_t sg_netpoint_by_name_or_null(const char* name);
+XBT_PUBLIC simgrid::kernel::routing::NetPoint* sg_netpoint_by_name_or_null(const char* name);
 
 #endif /* KERNEL_ROUTING_NETPOINT_HPP_ */
index 7e67512..c5ff45c 100644 (file)
@@ -297,11 +297,11 @@ static void instr_user_variable(double time, const char* resource, const char* v
 static void instr_user_srcdst_variable(double time, const char *src, const char *dst, const char *variable,
                               const char *father_type, double value, InstrUserVariable what)
 {
-  sg_netpoint_t src_elm = sg_netpoint_by_name_or_null(src);
+  simgrid::kernel::routing::NetPoint* src_elm = sg_netpoint_by_name_or_null(src);
   if (not src_elm)
     xbt_die("Element '%s' not found!",src);
 
-  sg_netpoint_t dst_elm = sg_netpoint_by_name_or_null(dst);
+  simgrid::kernel::routing::NetPoint* dst_elm = sg_netpoint_by_name_or_null(dst);
   if (not dst_elm)
     xbt_die("Element '%s' not found!",dst);
 
index cada386..0106898 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -26,7 +26,7 @@ public:
   Type* type_; /* Type of this container */
   Container* father_;
   std::map<std::string, Container*> children_;
-  sg_netpoint_t netpoint_ = nullptr;
+  kernel::routing::NetPoint* netpoint_ = nullptr;
 
   static Container* byNameOrNull(std::string name);
   static Container* byName(std::string name);
index c6ace47..f1b25be 100644 (file)
@@ -66,7 +66,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
     route->gw_dst = route_stack.front()->gw_dst;
   }
 
-  sg_netpoint_t prev_dst_gw = nullptr;
+  NetPoint* prev_dst_gw = nullptr;
   while (not route_stack.empty()) {
     RouteCreationArgs* e_route = route_stack.back();
     route_stack.pop_back();
@@ -85,8 +85,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
   }
 }
 
-void FloydZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
-                          kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
+void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                           std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
 {
   /* set the size of table routing */
index f15347b..09a00f4 100644 (file)
@@ -104,9 +104,9 @@ int NetZone::addComponent(kernel::routing::NetPoint* elm)
   return vertices_.size() - 1; // The rank of the newly created object
 }
 
-void NetZone::add_route(sg_netpoint_t /*src*/, sg_netpoint_t /*dst*/, sg_netpoint_t /*gw_src*/,
-                        sg_netpoint_t /*gw_dst*/, std::vector<simgrid::surf::LinkImpl*>& /*link_list*/,
-                        bool /*symmetrical*/)
+void NetZone::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing::NetPoint* /*dst*/,
+                        kernel::routing::NetPoint* /*gw_src*/, kernel::routing::NetPoint* /*gw_dst*/,
+                        std::vector<simgrid::surf::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
 {
   xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str());
 }
index 39b93d2..2004447 100644 (file)
@@ -73,11 +73,11 @@ public:
 
 class RouteCreationArgs {
 public:
-  bool symmetrical     = false;
-  sg_netpoint_t src    = nullptr;
-  sg_netpoint_t dst    = nullptr;
-  sg_netpoint_t gw_src = nullptr;
-  sg_netpoint_t gw_dst = nullptr;
+  bool symmetrical = false;
+  NetPoint* src    = nullptr;
+  NetPoint* dst    = nullptr;
+  NetPoint* gw_src = nullptr;
+  NetPoint* gw_dst = nullptr;
   std::vector<simgrid::surf::LinkImpl*> link_list;
 };