48 #include "detail/skelclDll.h"
68 Source(
const char* source);
73 Source(
const std::string& source);
103 operator std::string()
const;
110 void append(
const std::string& source);
122 class SKELCL_DLL CommonDefinitions {
124 enum Level :
unsigned int {
127 GENERATED_DEFINITION,
131 static CommonDefinitions& instance();
133 static void append(
const std::string& source, Level level);
135 static Source getSource();
142 CommonDefinitions(
const CommonDefinitions&);
143 CommonDefinitions& operator=(
const CommonDefinitions&) ;
145 std::vector<Source> _sources;
148 class SKELCL_DLL RegisterCommonDefinition {
150 RegisterCommonDefinition(
const char* definition,
151 CommonDefinitions::Level level
152 = CommonDefinitions::Level::USER_DEFINITION);
155 class RegisterCommonMacroDefinition {
157 template <
typename T>
158 RegisterCommonMacroDefinition(
const char* name,
161 std::stringstream ss;
162 ss <<
"#define " << name <<
" " << value;
163 CommonDefinitions::append(ss.str(),
164 CommonDefinitions::Level::USER_DEFINITION);
This class is a unified wrapper for defining source code in SkelCL.