Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
CpuCas01 in C++
[simgrid.git] / src / surf / network.hpp
1 #include "surf.hpp"
2 #include "xbt/fifo.h"
3
4 #ifndef SURF_MODEL_NETWORK_H_
5 #define SURF_MODEL_NETWORK_H_
6
7 /***********
8  * Classes *
9  ***********/
10 class NetworkModel;
11 typedef NetworkModel *NetworkModelPtr;
12
13 class NetworkCm02Link;
14 typedef NetworkCm02Link *NetworkCm02LinkPtr;
15
16 class NetworkCm02Action;
17 typedef NetworkCm02Action *NetworkCm02ActionPtr;
18
19 class NetworkCm02ActionLmm;
20 typedef NetworkCm02ActionLmm *NetworkCm02ActionLmmPtr;
21
22 /*********
23  * Model *
24  *********/
25 class NetworkModel : public Model {
26 public:
27   NetworkModel(string name) : Model(name) {};
28   NetworkCm02LinkPtr createResource(string name);
29   void updateActionsStateLazy(double now, double delta);
30   void updateActionsStateFull(double now, double delta);  
31   void gapRemove(ActionLmmPtr action);
32
33   virtual void addTraces() =0;
34 };
35
36 /************
37  * Resource *
38  ************/
39 class NetworkCm02Link : public Resource {
40 public:
41   NetworkCm02Link(NetworkModelPtr model, const char* name, xbt_dict_t properties) : Resource(model, name, properties) {};
42
43   /* Using this object with the public part of
44     model does not make sense */
45   double lat_current;
46   tmgr_trace_event_t lat_event;
47 };
48
49 /**********
50  * Action *
51  **********/
52 class NetworkCm02Action : virtual public Action {
53 public:
54   NetworkCm02Action(ModelPtr model, double cost, bool failed): Action(model, cost, failed) {};
55   double m_latency;
56   double m_latCurrent;
57   double m_weight;
58   double m_rate;
59   const char* p_senderLinkName;
60   double m_senderGap;
61   double m_senderSize;
62   xbt_fifo_item_t p_senderFifoItem;
63 #ifdef HAVE_LATENCY_BOUND_TRACKING
64   int m_latencyLimited;
65 #endif
66
67 };
68
69 class NetworkCm02ActionLmm : public ActionLmm, public NetworkCm02Action {
70 public:
71   NetworkCm02ActionLmm(ModelPtr model, double cost, bool failed): ActionLmm(model, cost, failed), NetworkCm02Action(model, cost, failed) {};
72   void updateRemainingLazy(double now);
73 };
74
75 #endif /* SURF_MODEL_NETWORK_H_ */