Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to fix some compilation erros
[simgrid.git] / src / surf / network_constant.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 NETWORK_CONSTANT_HPP_
8 #define NETWORK_CONSTANT_HPP_
9
10 #include <xbt/base.h>
11
12 #include "network_interface.hpp"
13
14 /***********
15  * Classes *
16  ***********/
17 class XBT_PRIVATE NetworkConstantModel;
18 class XBT_PRIVATE NetworkConstantAction;
19
20 /*********
21  * Model *
22  *********/
23 class NetworkConstantModel : public NetworkModel {
24 public:
25   NetworkConstantModel()  : NetworkModel() { };
26   ~NetworkConstantModel() { }
27
28   Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
29   double shareResources(double now);
30   void updateActionsState(double now, double delta);
31   bool shareResourcesIsIdempotent() {return true;}
32
33   Link* createLink(const char *name,
34                            double bw_initial,
35                                    tmgr_trace_t bw_trace,
36                                    double lat_initial,
37                                    tmgr_trace_t lat_trace,
38                                    e_surf_resource_state_t state_initial,
39                                    tmgr_trace_t state_trace,
40                                    e_surf_link_sharing_policy_t policy,
41                                    xbt_dict_t properties)                  { DIE_IMPOSSIBLE; }
42   void addTraces()                                         { DIE_IMPOSSIBLE; }
43   xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst) { DIE_IMPOSSIBLE; }
44 };
45
46 /**********
47  * Action *
48  **********/
49 class NetworkConstantAction : public NetworkAction {
50 public:
51   NetworkConstantAction(NetworkConstantModel *model_, double size, double latency)
52   : NetworkAction(model_, size, false)
53   , m_latInit(latency)
54   {
55         m_latency = latency;
56         if (m_latency <= 0.0) {
57           p_stateSet = getModel()->getDoneActionSet();
58           p_stateSet->push_back(*this);
59         }
60         p_variable = NULL;
61   };
62   int unref();
63   void cancel();
64   void setCategory(const char *category);
65   void suspend();
66   void resume();
67   bool isSuspended();
68   double m_latInit;
69   int m_suspended;
70 };
71
72 #endif /* NETWORK_CONSTANT_HPP_ */