X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d140762b2b9c8746cdd3b0680a7167867ba0ad9..9b5c287fbf93c2ae7c3d18c8584647ef9920fe87:/src/smpi/include/smpi_info.hpp diff --git a/src/smpi/include/smpi_info.hpp b/src/smpi/include/smpi_info.hpp index c8f049be73..1fb206ab03 100644 --- a/src/smpi/include/smpi_info.hpp +++ b/src/smpi/include/smpi_info.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2012-2017. The SimGrid Team. +/* Copyright (c) 2009-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,30 +7,31 @@ #ifndef SMPI_INFO_HPP #define SMPI_INFO_HPP -#include "smpi_f2c.hpp" #include "smpi/smpi.h" -#include "xbt/dict.h" +#include "smpi_f2c.hpp" +#include +#include namespace simgrid{ namespace smpi{ class Info : public F2C{ - private: - xbt_dict_t dict_; - int refcount_; - public: - explicit Info(); - explicit Info(Info* orig); - ~Info(); - void ref(); - static void unref(MPI_Info info); - void set(char *key, char *value); - int get(char *key,int valuelen, char *value, int *flag); - int remove(char* key); - int get_nkeys(int *nkeys); - int get_nthkey(int n, char *key); - int get_valuelen(char *key, int *valuelen, int *flag); - static Info* f2c(int id); + std::map map_; + int refcount_ = 1; + +public: + Info() = default; + explicit Info(Info* orig) : map_(orig->map_) {} + ~Info() = default; + void ref(); + static void unref(MPI_Info info); + void set(const char* key, const char* value) { map_[key] = value; } + int get(const char* key, int valuelen, char* value, int* flag); + int remove(const char* key); + int get_nkeys(int* nkeys); + int get_nthkey(int n, char* key); + int get_valuelen(const char* key, int* valuelen, int* flag); + static Info* f2c(int id); }; }