Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
/me also hates void* pointers
[simgrid.git] / src / surf / surf_private.h
index 42ec82a..ad8bde9 100644 (file)
@@ -13,6 +13,7 @@
 #include "surf/surfxml_parse_private.h"
 #include "surf/random_mgr.h"
 #include "instr/instr_private.h"
+#include "surf/surfxml_parse_values.h"
 
 #define NO_MAX_DURATION -1.0
 
@@ -100,11 +101,12 @@ typedef struct s_onelink {
 /**
  * Routing logic
  */
+typedef struct s_routing_component *routing_component_t;
 
 typedef struct s_model_type {
   const char *name;
   const char *desc;
-  void *(*create) ();
+  routing_component_t (*create) ();
   void (*load) ();
   void (*unload) ();
   void (*end) ();
@@ -137,7 +139,7 @@ typedef struct s_route_extended {
 
 /* This enum used in the routing structure helps knowing in which situation we are. */
 typedef enum {
-  SURF_ROUTING_NULL = 0,   /**< Indefined type                                   */
+  SURF_ROUTING_NULL = 0,   /**< Undefined type                                   */
   SURF_ROUTING_BASE,       /**< Base case: use simple link lists for routing     */
   SURF_ROUTING_RECURSIVE   /**< Recursive case: also return gateway informations */
 } e_surf_routing_hierarchy_t;
@@ -182,12 +184,14 @@ struct s_routing_global {
   routing_component_t root;
   void *loopback;
   size_t size_of_link;
-   xbt_dynar_t(*get_route) (const char *src, const char *dst);
-   xbt_dynar_t(*get_route_no_cleanup) (const char *src, const char *dst);
-   xbt_dynar_t(*get_onelink_routes) (void);
-   double (*get_latency) (const char *src, const char *dst);
-   e_surf_network_element_type_t(*get_network_element_type) (const char
-                                                             *name);
+  xbt_dynar_t(*get_route) (const char *src, const char *dst);
+  xbt_dynar_t(*get_route_or_null) (const char *src, const char *dst);
+  xbt_dynar_t(*get_route_no_cleanup) (const char *src, const char *dst);
+  xbt_dynar_t(*get_onelink_routes) (void);
+  double (*get_latency) (const char *src, const char *dst);
+  void (*get_route_latency)(const char *src, const char *dst,
+                            xbt_dynar_t *route, double *latency, int cleanup);
+  e_surf_network_element_type_t(*get_network_element_type) (const char *name);
   void (*finalize) (void);
   xbt_dynar_t last_route;
 };
@@ -199,7 +203,7 @@ XBT_PUBLIC(void) routing_parse_Scluster(void);       /* cluster bypass */
 /**
  * Resource protected methods
  */
-xbt_dict_t surf_resource_properties(const void *resource);
+static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource);
 
 XBT_PUBLIC(void) surfxml_bufferstack_push(int new);
 XBT_PUBLIC(void) surfxml_bufferstack_pop(int new);