Files
geant4/source/analysis/g4tools/include/tools/S_STRING
T
2016-06-10 11:51:14 +02:00

54 lines
1.3 KiB
Plaintext

// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef tools_S_STRING
#define tools_S_STRING
// a few place in which a cpp macro help the readability.
#define TOOLS_CLASS_STRING(a_name)\
static const std::string& s_##a_name() {\
static const std::string s_v(#a_name);\
return s_v;\
}
#define TOOLS_CLASS_STRING_VALUE(a_name,a_value)\
static const std::string& s_##a_name() {\
static const std::string s_v(#a_value);\
return s_v;\
}
#define TOOLS_GLOBAL_STRING(a_name)\
inline const std::string& s_##a_name() {\
static const std::string s_v(#a_name);\
return s_v;\
}
#define TOOLS_GLOBAL_ARG(a_name)\
inline const std::string& s_##a_name() {\
static const std::string s_v(std::string("-")+std::string(#a_name));\
return s_v;\
}
#define TOOLS_SCLASS(a_name)\
static const std::string& s_class() {\
static const std::string s_v(#a_name);\
return s_v;\
}\
static void check_class_name() {a_name::s_class();}
#define TOOLS_T_SCLASS(a_T,a_name)\
static const std::string& s_class() {\
static const std::string s_v(#a_name);\
return s_v;\
}\
static void check_class_name() {a_name<a_T>::s_class();}
#define TOOLS_SCLASS_NO_CHECK(a_name)\
static const std::string& s_class() {\
static const std::string s_v(#a_name);\
return s_v;\
}
#endif