A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove spurious XBT_PUBLIC
[simgrid.git]
/
include
/
xbt
/
config.hpp
diff --git
a/include/xbt/config.hpp
b/include/xbt/config.hpp
index
af350a5
..
ecdb613
100644
(file)
--- a/
include/xbt/config.hpp
+++ b/
include/xbt/config.hpp
@@
-21,9
+21,9
@@
namespace simgrid {
namespace config {
namespace simgrid {
namespace config {
-
bool
parseBool(const char* value);
-
double
parseDouble(const char* value);
-
long int
parseLong(const char* value);
+
XBT_PUBLIC(bool)
parseBool(const char* value);
+
XBT_PUBLIC(double)
parseDouble(const char* value);
+
XBT_PUBLIC(long int)
parseLong(const char* value);
template<class T> struct parse_option {
static inline T parse(const char* value)
template<class T> struct parse_option {
static inline T parse(const char* value)
@@
-98,6
+98,14
@@
inline std::string to_string(std::string&& value)
XBT_PUBLIC(void) declareFlag(const char* name, const char* description,
std::function<void(const char* value)> callback);
XBT_PUBLIC(void) declareFlag(const char* name, const char* description,
std::function<void(const char* value)> callback);
+template<class T, class F>
+void declareFlag(const char* name, const char* description, F callback)
+{
+ declareFlag(name, description, [callback](const char* value) {
+ callback(parse<T>(value));
+ });
+}
+
/** Bind a variable to configuration flag
*
* @param value Bound variable
/** Bind a variable to configuration flag
*
* @param value Bound variable