1 /* Copyright (c) 2015. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SRC_SURF_PROPERTYHOLDER_HPP_
7 #define SRC_SURF_PROPERTYHOLDER_HPP_
8 #include <unordered_map>
13 /** @brief a PropertyHolder can be given a set of textual properties
15 * Common PropertyHolders are elements of the platform file, such as Host, Link or Storage.
17 class PropertyHolder { // DO NOT DERIVE THIS CLASS, or the diamond inheritance mayhem will get you
20 explicit PropertyHolder();
23 const char *getProperty(const char*id);
24 void setProperty(const char*id, const char*value);
26 /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
27 * But some user API expose this call so removing it is not so easy.
29 std::unordered_map<std::string, std::string>* getProperties();
32 std::unordered_map<std::string, std::string>* properties_ = nullptr;
35 } /* namespace surf */
36 } /* namespace simgrid */
38 #endif /* SRC_SURF_PROPERTYHOLDER_HPP_ */