framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
common_macros.hpp
Go to the documentation of this file.
1 // Copyright (C) 2012 iwg molw5
2 // For conditions of distribution and use, see copyright notice in COPYING
3 
13 #pragma once
14 
18 
19 #ifndef FRAMEWORK_NO_BOOST
20  // Name macro definitions and helpers
21  #ifndef FRAMEWORK_SERIALIZABLE_NAME_LENGTH
22 
26  #define FRAMEWORK_SERIALIZABLE_NAME_LENGTH 100
27  #endif
28 
29  #ifndef FRAMEWORK_SERIALIZABLE_NAME
30 
33  #define FRAMEWORK_SERIALIZABLE_NAME(s) \
34  ::framework::make_type_string <EXPAND_STRING_N(s, FRAMEWORK_SERIALIZABLE_NAME_LENGTH)>
35  #else
36  #error "FRAMEWORK_SERIALIZABLE_NAME macro already defined";
37  #endif
38 #else
39  #define FRAMEWORK_SERIALIZABLE_NAME(s) \
40  ::framework::make_type_string <EXPAND_STRING(s)>
41 #endif
42 
46 #ifndef FRAMEWORK_SERIALIZABLE_NAME_MACRO_DISABLE
47  #ifndef NAME
48  #define NAME(s) FRAMEWORK_SERIALIZABLE_NAME(s)
49  #else
50  #error "NAME macro already defined - FRAMEWORK_SERIALIZABLE_NAME_MACRO_DISABLE suppresses this definition";
51  #endif
52 #endif
53 
54 #ifndef DEFINE_BASE_TEMPLATE
55 
65  #define DEFINE_BASE_TEMPLATE(derived) \
66  template <typename T> \
67  using base = ::framework::serializable::object_base <derived, T>
68 #else
69  #error "DEFINE_BASE_TEMPLATE macro already defined";
70 #endif