Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill models getName() call sites.
[simgrid.git] / src / surf / network_ns3.hpp
1 /* Copyright (c) 2004-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "network_interface.hpp"
8 #include "surf/ns3/ns3_interface.h"
9
10 #ifndef NETWORK_NS3_HPP_
11 #define NETWORK_NS3_HPP_
12
13 /***********
14  * Classes *
15  ***********/
16 class NetworkNS3Model;
17 class NetworkNS3Action;
18
19 /*********
20  * Tools *
21  *********/
22
23 void net_define_callbacks(void);
24
25 /*********
26  * Model *
27  *********/
28
29 class NetworkNS3Model : public NetworkModel {
30 public:
31   NetworkNS3Model();
32
33   ~NetworkNS3Model();
34   Link* createLink(const char *name,
35                                          double bw_initial,
36                                          tmgr_trace_t bw_trace,
37                                          double lat_initial,
38                                          tmgr_trace_t lat_trace,
39                                          e_surf_resource_state_t state_initial,
40                                          tmgr_trace_t state_trace,
41                                          e_surf_link_sharing_policy_t policy,
42                                          xbt_dict_t properties);
43   xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst);
44   Action *communicate(RoutingEdge *src, RoutingEdge *dst,
45                                            double size, double rate);
46   double shareResources(double now);
47   void updateActionsState(double now, double delta);
48   void addTraces(){DIE_IMPOSSIBLE;}
49   bool shareResourcesIsIdempotent() {return false;}
50 };
51
52 /************
53  * Resource *
54  ************/
55 class NetworkNS3Link : public Link {
56 public:
57   NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props,
58                          double bw_initial, double lat_initial);
59   ~NetworkNS3Link();
60
61   void updateState(tmgr_trace_event_t event_type, double value, double date);
62   double getLatency(){THROW_UNIMPLEMENTED;}
63   double getBandwidth(){THROW_UNIMPLEMENTED;}
64   void updateBandwidth(double value, double date=surf_get_clock()){THROW_UNIMPLEMENTED;}
65   void updateLatency(double value, double date=surf_get_clock()){THROW_UNIMPLEMENTED;}
66
67 //private:
68  char *p_id;
69  char *p_lat;
70  char *p_bdw;
71  int m_created;
72 };
73
74 /**********
75  * Action *
76  **********/
77 class NetworkNS3Action : public NetworkAction {
78 public:
79   NetworkNS3Action(Model *model, double cost, bool failed);
80
81 #ifdef HAVE_LATENCY_BOUND_TRACKING
82   int getLatencyLimited();
83 #endif
84
85 bool isSuspended();
86 int unref();
87 void suspend();
88 void resume();
89
90 //private:
91   double m_lastSent;
92   RoutingEdge *p_srcElm;
93   RoutingEdge *p_dstElm;
94 };
95
96
97 #endif /* NETWORK_NS3_HPP_ */