Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / smpi / include / smpi_info.hpp
1 /* Copyright (c) 2009-2020. 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 <map>
14
15 namespace simgrid{
16 namespace smpi{
17
18 class Info : public F2C{
19   std::map<std::string, std::string> map_;
20   int refcount_ = 1;
21
22 public:
23   Info() = default;
24   explicit Info(const Info* orig) : map_(orig->map_) {}
25   ~Info() = default;
26   void ref();
27   static void unref(MPI_Info info);
28   void set(const char* key, const char* value) { map_[key] = value; }
29   int get(const char* key, int valuelen, char* value, int* flag);
30   int remove(const char* key);
31   int get_nkeys(int* nkeys);
32   int get_nthkey(int n, char* key);
33   int get_valuelen(const char* key, int* valuelen, int* flag);
34   static Info* f2c(int id);
35 };
36
37 }
38 }
39
40 #endif