Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / include / smpi_info.hpp
1 /* Copyright (c) 2009-2010, 2012-2017. 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 SMPI_INFO_HPP
8 #define SMPI_INFO_HPP
9
10 #include "smpi/smpi.h"
11 #include "smpi_f2c.hpp"
12 #include <string>
13 #include <unordered_map>
14
15 namespace simgrid{
16 namespace smpi{
17
18 class Info : public F2C{
19   private:
20     std::unordered_map<std::string, std::string> map_;
21     int refcount_ = 1;
22
23   public:
24     Info() = default;
25     explicit Info(Info* orig);
26     ~Info() = default;
27     void ref();
28     static void unref(MPI_Info info);
29     void set(char *key, char *value);
30     int get(char *key,int valuelen, char *value, int *flag);
31     int remove(char* key);
32     int get_nkeys(int *nkeys);
33     int get_nthkey(int n, char *key);
34     int get_valuelen(char *key, int *valuelen, int *flag);
35     static Info* f2c(int id);
36 };
37
38 }
39 }
40
41 #endif