diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
commit | 420d2ef464d4a741028e132e662d5626806a41f5 (patch) | |
tree | 1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /core/test_propcomp_cpp-speed.cpp |
Diffstat (limited to 'core/test_propcomp_cpp-speed.cpp')
-rw-r--r-- | core/test_propcomp_cpp-speed.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/core/test_propcomp_cpp-speed.cpp b/core/test_propcomp_cpp-speed.cpp new file mode 100644 index 0000000..ab9e4ba --- /dev/null +++ b/core/test_propcomp_cpp-speed.cpp @@ -0,0 +1,48 @@ +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#define BOOST_MPL_LIMIT_LIST_SIZE 50 + +#include <iostream> + +#include <boost/mpl/pair.hpp> +#include <boost/mpl/list.hpp> +#include <boost/mpl/bool.hpp> + +#include "continuous_property.hpp" +#include "pla_debug_name.hpp" +#include "property_composition.hpp" + +#include "mempool.hpp" + +// create some extra properties +#define A1(t, s) GEN_CP(Global, t, s, int, 0); +#define A2(t, s) A1(t ## 0, s "0") A1(t ## 1, s "1") +#define A4(t, s) A2(t ## 0, s "0") A2(t ## 1, s "1") +#define A8(t, s) A4(t ## 0, s "0") A4(t ## 1, s "1") +#define A16(t, s) A8(t ## 0, s "0") A8(t ## 1, s "1") +#define A32(t, s) A16(t ## 0, s "0") A16(t ## 1, s "1") +#define A64(t, s) A32(t ## 0, s "0") A32(t ## 1, s "1") +#define A128(t, s) A64(t ## 0, s "0") A64(t ## 1, s "1") + +#define B1(t) boost::mpl::pair<t, boost::mpl::bool_<false>> +#define B2(t) B1(t ## 0), B1(t ## 1) +#define B4(t) B2(t ## 0), B2(t ## 1) +#define B8(t) B4(t ## 0), B4(t ## 1) +#define B16(t) B8(t ## 0), B8(t ## 1) +#define B32(t) B16(t ## 0), B16(t ## 1) +#define B64(t) B32(t ## 0), B32(t ## 1) +#define B128(t) B64(t ## 0), B64(t ## 1) + +#define B48(t) B32(t ## 0), B16(t ## 1 ## 1) + +A64(Many, "many") + +int main() { + // below is bullshit + PropertyComposition< + boost::mpl::list< + B48(Many) // work around boost::mpl::list limit of 50 elements + >> test1; + + PLA_Debug_Name action_debug; + std::cout << *test1.call(action_debug) << std::endl; +} |