Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some #include fixes
[simgrid.git] / src / surf / network_cm02.hpp
1 /* Copyright (c) 2013-2015. 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 #ifndef SURF_NETWORK_CM02_HPP_
8 #define SURF_NETWORK_CM02_HPP_
9
10 #include <xbt/base.h>
11
12 #include "network_interface.hpp"
13 #include "xbt/fifo.h"
14 #include "xbt/graph.h"
15
16
17
18 /***********
19  * Classes *
20  ***********/
21
22 namespace simgrid {
23   namespace surf {
24
25     class XBT_PRIVATE NetworkCm02Model;
26     class XBT_PRIVATE NetworkCm02Action;
27     class XBT_PRIVATE NetworkSmpiModel;
28
29   }
30 }
31
32 /*********
33  * Model *
34  *********/
35
36 namespace simgrid {
37   namespace surf {
38
39     class NetworkCm02Model : public NetworkModel {
40     public:
41       NetworkCm02Model();
42       ~NetworkCm02Model();
43       Link* createLink(const char *name, double bandwidth,  double latency, e_surf_link_sharing_policy_t policy,
44           xbt_dict_t properties) override;
45       void updateActionsStateLazy(double now, double delta) override;
46       void updateActionsStateFull(double now, double delta) override;
47       Action *communicate(routing::NetCard *src, routing::NetCard *dst, double size, double rate) override;
48       bool next_occuring_event_isIdempotent() override;
49       virtual void gapAppend(double size, const Link* link, NetworkAction* action);
50     protected:
51       bool haveGap_ = false;
52     };
53
54     /************
55      * Resource *
56      ************/
57
58     class NetworkCm02Link : public Link {
59     public:
60       NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
61           double bandwidth, double latency, e_surf_link_sharing_policy_t policy,
62           lmm_system_t system);
63       ~NetworkCm02Link() override;
64       void apply_event(tmgr_trace_iterator_t event, double value) override;
65       void updateBandwidth(double value) override;
66       void updateLatency(double value) override;
67       virtual void gapAppend(double size, const Link* link, NetworkAction* action);
68     };
69
70
71     /**********
72      * Action *
73      **********/
74     class NetworkCm02Action : public NetworkAction {
75       friend Action *NetworkCm02Model::communicate(routing::NetCard *src, routing::NetCard *dst, double size, double rate);
76       friend NetworkSmpiModel;
77     public:
78       NetworkCm02Action(Model *model, double cost, bool failed)
79       : NetworkAction(model, cost, failed) {};
80       ~NetworkCm02Action() override;
81       void updateRemainingLazy(double now) override;
82     protected:
83       double senderGap_;
84     };
85
86   }
87 }
88
89 #endif /* SURF_NETWORK_CM02_HPP_ */