This header defines the WISP_STRUCT generative macro. More...
#include <boost/preprocessor/punctuation/comma_if.hpp>#include <boost/preprocessor/control/expr_iif.hpp>#include <boost/preprocessor/comparison/equal.hpp>#include <boost/preprocessor/comparison/less_equal.hpp>#include <boost/preprocessor/comparison/greater_equal.hpp>#include <boost/preprocessor/seq.hpp>#include <boost/preprocessor/array/elem.hpp>#include <boost/preprocessor/array/push_front.hpp>#include <boost/preprocessor/stringize.hpp>#include <boost/call_traits.hpp>#include <ssrc/wisp-packages.h>

Go to the source code of this file.
Classes |
|
| struct | utility::wisp_struct |
Namespaces |
|
| namespace | utility |
|
The utility namespace contains utility classes. |
|
Defines |
|
| #define | __WISP_STRUCT_MEMBER(r, data, arg) BOOST_PP_TUPLE_ELEM(2, 0, arg) BOOST_PP_TUPLE_ELEM(2, 1, arg); |
| #define | __WISP_STRUCT_DEFAULT_INIT_MEMBER(r, data, i, arg) BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2, 1, arg)() |
| #define | __WISP_STRUCT_INIT_MEMBER(r, data, i, arg) BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2, 1, arg)(BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
| #define | __WISP_STRUCT_PARAM(r, in_template, i, arg) BOOST_PP_COMMA_IF(i) BOOST_PP_EXPR_IIF(in_template, typename) boost::call_traits<BOOST_PP_TUPLE_ELEM(2, 0, arg)>::param_type BOOST_PP_TUPLE_ELEM(2, 1, arg) |
| #define | __WISP_STRUCT_PARAM_INIT(r, init, i, arg) BOOST_PP_COMMA_IF(i) BOOST_PP_EXPR_IIF(BOOST_PP_ARRAY_ELEM(0, init), typename) boost::call_traits<BOOST_PP_TUPLE_ELEM(2, 0, arg)>::param_type BOOST_PP_TUPLE_ELEM(2, 1, arg) BOOST_PP_EXPR_IIF(BOOST_PP_GREATER_EQUAL(i, BOOST_PP_ARRAY_ELEM(1, init)), = BOOST_PP_ARRAY_ELEM(BOOST_PP_SUB(BOOST_PP_ADD(i, 2), BOOST_PP_ARRAY_ELEM(1, init)), init)) |
| #define | __WISP_STRUCT_SERIALIZE(r, data, arg) & BOOST_PP_TUPLE_ELEM(2, 1, arg) |
| #define | __WISP_STRUCT_SERIALIZE_MEMBERS(members) |
| #define | __WISP_STRUCT_EQOP_TEST(r, data, i, arg) BOOST_PP_EXPR_IF(i, &&) (o1.BOOST_PP_TUPLE_ELEM(2, 1, arg) == o2.BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
| #define | __WISP_STRUCT_EQOP(name, seq) |
| #define | __WISP_STRUCT_VISIT_MEMBERS(r, v, arg) (BOOST_PP_STRINGIZE(BOOST_PP_TUPLE_ELEM(2, 1, arg)), BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
| #define | __WISP_STRUCT_VISIT(members) |
| #define | __WISP_STRUCT(in_template, name, members) |
| #define | __WISP_STRUCT_WITH_INIT(in_template, name, members, initializers) |
| #define | WISP_STRUCT(name, members) struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT(0, name, members) } |
| #define | WISP_STRUCT_T(name, members) struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT(1, name, members) } |
| #define | WISP_STRUCT_WITH_INIT(name, members, initializers) struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT_WITH_INIT(0, name, members, BOOST_PP_SEQ_TO_ARRAY(initializers)) } |
| #define | WISP_STRUCT_WITH_INIT_T(name, members, initializers) struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT_WITH_INIT(1, name, members, BOOST_PP_SEQ_TO_ARRAY(initializers)) } |
Detailed Description
This header defines the WISP_STRUCT generative macro.
Definition in file wisp_struct.h.
Define Documentation
| #define __WISP_STRUCT | ( | in_template, | |
| name, | |||
| members | |||
| ) |
BOOST_PP_SEQ_FOR_EACH(__WISP_STRUCT_MEMBER, _, members) \ name() : \ BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_DEFAULT_INIT_MEMBER, _, members) { } \ explicit name(BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_PARAM, in_template, members)) : \ BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_INIT_MEMBER, _, members) { } \ __WISP_STRUCT_SERIALIZE_MEMBERS(members) \ __WISP_STRUCT_EQOP(name, members) \ __WISP_STRUCT_VISIT(members)
Definition at line 110 of file wisp_struct.h.
| #define __WISP_STRUCT_DEFAULT_INIT_MEMBER | ( | r, | |
| data, | |||
| i, | |||
| arg | |||
| ) | BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2, 1, arg)() |
Definition at line 52 of file wisp_struct.h.
| #define __WISP_STRUCT_EQOP | ( | name, | |
| seq | |||
| ) |
friend bool operator==(const name & o1, const name & o2) { \ return (BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_EQOP_TEST, _, seq)); \ }
Definition at line 77 of file wisp_struct.h.
| #define __WISP_STRUCT_EQOP_TEST | ( | r, | |
| data, | |||
| i, | |||
| arg | |||
| ) | BOOST_PP_EXPR_IF(i, &&) (o1.BOOST_PP_TUPLE_ELEM(2, 1, arg) == o2.BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
Definition at line 74 of file wisp_struct.h.
| #define __WISP_STRUCT_INIT_MEMBER | ( | r, | |
| data, | |||
| i, | |||
| arg | |||
| ) | BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2, 1, arg)(BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
Definition at line 55 of file wisp_struct.h.
| #define __WISP_STRUCT_MEMBER | ( | r, | |
| data, | |||
| arg | |||
| ) | BOOST_PP_TUPLE_ELEM(2, 0, arg) BOOST_PP_TUPLE_ELEM(2, 1, arg); |
Definition at line 49 of file wisp_struct.h.
| #define __WISP_STRUCT_PARAM | ( | r, | |
| in_template, | |||
| i, | |||
| arg | |||
| ) | BOOST_PP_COMMA_IF(i) BOOST_PP_EXPR_IIF(in_template, typename) boost::call_traits<BOOST_PP_TUPLE_ELEM(2, 0, arg)>::param_type BOOST_PP_TUPLE_ELEM(2, 1, arg) |
Definition at line 58 of file wisp_struct.h.
| #define __WISP_STRUCT_PARAM_INIT | ( | r, | |
| init, | |||
| i, | |||
| arg | |||
| ) | BOOST_PP_COMMA_IF(i) BOOST_PP_EXPR_IIF(BOOST_PP_ARRAY_ELEM(0, init), typename) boost::call_traits<BOOST_PP_TUPLE_ELEM(2, 0, arg)>::param_type BOOST_PP_TUPLE_ELEM(2, 1, arg) BOOST_PP_EXPR_IIF(BOOST_PP_GREATER_EQUAL(i, BOOST_PP_ARRAY_ELEM(1, init)), = BOOST_PP_ARRAY_ELEM(BOOST_PP_SUB(BOOST_PP_ADD(i, 2), BOOST_PP_ARRAY_ELEM(1, init)), init)) |
Definition at line 61 of file wisp_struct.h.
| #define __WISP_STRUCT_SERIALIZE | ( | r, | |
| data, | |||
| arg | |||
| ) | & BOOST_PP_TUPLE_ELEM(2, 1, arg) |
Definition at line 64 of file wisp_struct.h.
| #define __WISP_STRUCT_SERIALIZE_MEMBERS | ( | members | ) |
template<class Archive> \ void serialize(Archive & ar, const unsigned int) { \ ar BOOST_PP_SEQ_FOR_EACH(__WISP_STRUCT_SERIALIZE, _, members); \ } \
Definition at line 67 of file wisp_struct.h.
| #define __WISP_STRUCT_VISIT | ( | members | ) |
template<typename Visitor> \ void visit(Visitor && visitor) { \ visitor BOOST_PP_SEQ_FOR_EACH(__WISP_STRUCT_VISIT_MEMBERS, visitor, members); \ } \ template<typename Visitor> \ void visit(Visitor && visitor) const { \ visitor BOOST_PP_SEQ_FOR_EACH(__WISP_STRUCT_VISIT_MEMBERS, visitor, members); \ }
Definition at line 94 of file wisp_struct.h.
| #define __WISP_STRUCT_VISIT_MEMBERS | ( | r, | |
| v, | |||
| arg | |||
| ) | (BOOST_PP_STRINGIZE(BOOST_PP_TUPLE_ELEM(2, 1, arg)), BOOST_PP_TUPLE_ELEM(2, 1, arg)) |
Definition at line 89 of file wisp_struct.h.
| #define __WISP_STRUCT_WITH_INIT | ( | in_template, | |
| name, | |||
| members, | |||
| initializers | |||
| ) |
BOOST_PP_SEQ_FOR_EACH(__WISP_STRUCT_MEMBER, _, members) \ explicit name(BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_PARAM_INIT, BOOST_PP_ARRAY_PUSH_FRONT(BOOST_PP_ARRAY_PUSH_FRONT(initializers, BOOST_PP_SUB(BOOST_PP_SEQ_SIZE(members), BOOST_PP_ARRAY_SIZE(initializers))), in_template), members)) : \ BOOST_PP_SEQ_FOR_EACH_I(__WISP_STRUCT_INIT_MEMBER, _, members) { } \ __WISP_STRUCT_SERIALIZE_MEMBERS(members) \ __WISP_STRUCT_EQOP(name, members) \ __WISP_STRUCT_VISIT(members)
Definition at line 120 of file wisp_struct.h.
| #define WISP_STRUCT | ( | name, | |
| members | |||
| ) | struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT(0, name, members) } |
Definition at line 128 of file wisp_struct.h.
| #define WISP_STRUCT_T | ( | name, | |
| members | |||
| ) | struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT(1, name, members) } |
Definition at line 131 of file wisp_struct.h.
| #define WISP_STRUCT_WITH_INIT | ( | name, | |
| members, | |||
| initializers | |||
| ) | struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT_WITH_INIT(0, name, members, BOOST_PP_SEQ_TO_ARRAY(initializers)) } |
Definition at line 134 of file wisp_struct.h.
| #define WISP_STRUCT_WITH_INIT_T | ( | name, | |
| members, | |||
| initializers | |||
| ) | struct name : public NS_SSRC_WISP_UTILITY::wisp_struct { __WISP_STRUCT_WITH_INIT(1, name, members, BOOST_PP_SEQ_TO_ARRAY(initializers)) } |
Definition at line 137 of file wisp_struct.h.