X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/de74e33ac31948d22f805fed0807be831cb8fdbd..83ff63f9a846dd01995a4bbb8979d2fa909ed34b:/src/surf/network.hpp diff --git a/src/surf/network.hpp b/src/surf/network.hpp new file mode 100644 index 0000000000..aa21a7efe1 --- /dev/null +++ b/src/surf/network.hpp @@ -0,0 +1,75 @@ +#include "surf.hpp" +#include "xbt/fifo.h" + +#ifndef SURF_MODEL_NETWORK_H_ +#define SURF_MODEL_NETWORK_H_ + +/*********** + * Classes * + ***********/ +class NetworkModel; +typedef NetworkModel *NetworkModelPtr; + +class NetworkCm02Link; +typedef NetworkCm02Link *NetworkCm02LinkPtr; + +class NetworkCm02Action; +typedef NetworkCm02Action *NetworkCm02ActionPtr; + +class NetworkCm02ActionLmm; +typedef NetworkCm02ActionLmm *NetworkCm02ActionLmmPtr; + +/********* + * Model * + *********/ +class NetworkModel : public Model { +public: + NetworkModel(string name) : Model(name) {}; + NetworkCm02LinkPtr createResource(string name); + void updateActionsStateLazy(double now, double delta); + void updateActionsStateFull(double now, double delta); + void gapRemove(ActionLmmPtr action); + + virtual void addTraces() =0; +}; + +/************ + * Resource * + ************/ +class NetworkCm02Link : public Resource { +public: + NetworkCm02Link(NetworkModelPtr model, const char* name, xbt_dict_t properties) : Resource(model, name, properties) {}; + + /* Using this object with the public part of + model does not make sense */ + double lat_current; + tmgr_trace_event_t lat_event; +}; + +/********** + * Action * + **********/ +class NetworkCm02Action : virtual public Action { +public: + NetworkCm02Action(ModelPtr model, double cost, bool failed): Action(model, cost, failed) {}; + double m_latency; + double m_latCurrent; + double m_weight; + double m_rate; + const char* p_senderLinkName; + double m_senderGap; + double m_senderSize; + xbt_fifo_item_t p_senderFifoItem; +#ifdef HAVE_LATENCY_BOUND_TRACKING + int m_latencyLimited; +#endif + +}; + +class NetworkCm02ActionLmm : public ActionLmm, public NetworkCm02Action { +public: + NetworkCm02ActionLmm(ModelPtr model, double cost, bool failed): ActionLmm(model, cost, failed), NetworkCm02Action(model, cost, failed) {}; + void updateRemainingLazy(double now); +}; + +#endif /* SURF_MODEL_NETWORK_H_ */