Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Channel: the S4U name of msg_mailbox_t
[simgrid.git] / include / simgrid / s4u / channel.hpp
1 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_S4U_CHANNEL_HPP
7 #define SIMGRID_S4U_CHANNEL_HPP
8
9 #include <boost/unordered_map.hpp>
10
11 #include "simgrid/s4u/process.hpp"
12
13 namespace simgrid {
14 namespace s4u {
15
16 /** @brief Channel
17  *
18  * Rendez-vous point for network communications, similar to URLs on which you could post and retrieve data.
19  * They are not network locations (you can post and retrieve on a given mailbox from anywhere on the network).
20  */
21 class Channel {
22         friend Process;
23
24 private:
25         Channel(const char*name, smx_rdv_t inferior);
26 public:
27         ~Channel();
28         
29 protected:
30         smx_rdv_t getInferior() { return p_inferior; }
31
32 public:
33         /** Retrieve the channel associated to the given string */
34         static Channel *byName(const char *name);
35
36 private:
37         std::string p_name;
38         smx_rdv_t p_inferior;
39         static boost::unordered_map<std::string, Channel *> *channels;
40 };
41 }} // namespace simgrid::s4u
42
43 #endif /* SIMGRID_S4U_CHANNEL_HPP */