1 /* Copyright (c) 2013-2015. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #ifndef NETWORK_CONSTANT_HPP_
8 #define NETWORK_CONSTANT_HPP_
12 #include "network_interface.hpp"
21 class XBT_PRIVATE NetworkConstantModel;
22 class XBT_PRIVATE NetworkConstantAction;
27 class NetworkConstantModel : public NetworkModel {
29 NetworkConstantModel() : NetworkModel() { };
30 ~NetworkConstantModel() { }
32 Action *communicate(NetCard *src, NetCard *dst, double size, double rate);
33 double shareResources(double now);
34 void updateActionsState(double now, double delta);
35 bool shareResourcesIsIdempotent() {return true;}
37 Link* createLink(const char *name,
39 tmgr_trace_t bw_trace,
41 tmgr_trace_t lat_trace,
42 e_surf_resource_state_t state_initial,
43 tmgr_trace_t state_trace,
44 e_surf_link_sharing_policy_t policy,
45 xbt_dict_t properties) { DIE_IMPOSSIBLE; }
46 void addTraces() { DIE_IMPOSSIBLE; }
47 xbt_dynar_t getRoute(NetCard *src, NetCard *dst) { DIE_IMPOSSIBLE; }
53 class NetworkConstantAction : public NetworkAction {
55 NetworkConstantAction(NetworkConstantModel *model_, double size, double latency)
56 : NetworkAction(model_, size, false)
60 if (m_latency <= 0.0) {
61 p_stateSet = getModel()->getDoneActionSet();
62 p_stateSet->push_back(*this);
68 void setCategory(const char *category);
79 #endif /* NETWORK_CONSTANT_HPP_ */