Lumiera  0.pre.03
»edit your freedom«
typelist-diagnostics.hpp File Reference

Go to the source code of this file.

Description

Support for writing metaprogramming unit-tests dealing with typelists and flags.

a Printer template usable for debugging the structure of a typelist built upon some simple debugging-style types. Examples being a Num<int> template, or the Flag type. A Printer type generated from this template provides a static print() function. The string returned from this function visualises the structure of the typelist provided as parameter to the Printer template.

See also
typelist-manip-test.cpp
config-flags-test.cpp

Definition in file typelist-diagnostics.hpp.

#include "lib/meta/typelist.hpp"
#include "lib/meta/generator.hpp"
#include "lib/format-string.hpp"
#include "lib/format-cout.hpp"
#include "lib/meta/util.hpp"
#include <string>

Classes

struct  Config< f1, f2, f3, f4, f5 >
 < distinct type representing a configuration More...
 
struct  CountDown< X >
 helper for generating test lists More...
 
struct  CountDown< Num< 0 > >
 
struct  CountDown< Num< I > >
 
struct  Flag< bit >
 
struct  NullP
 
struct  Num< I >
 constant-wrapper type for debugging purposes, usable for generating lists of distinguishable types More...
 
struct  Numz
 dummy interface / baseclass for diagnostics More...
 
struct  Printer< T, BASE >
 debugging template, printing the "number" used for instantiation on ctor call More...
 
struct  Printer< Config< f1, f2, f3, f4, f5 >, BASE >
 
struct  Printer< Flag< Fl >, BASE >
 < display the presence of a Flag in the typelist More...
 
struct  Printer< int, BASE >
 < display the presence of a plain int in the typelist More...
 
struct  Printer< Node< TY, TYPES >, BASE >
 Specialisation for debug-printing of a nested sublist. More...
 
struct  Printer< NullType, BASE >
 
struct  Printer< Num< I >, BASE >
 < display the presence of a Num instance in the typelist More...
 

Macros

#define DISPLAY(_IT_)   cout << STRINGIFY(_IT_) << "\t:" << showType<_IT_>() << endl;
 
#define DUMPVAL(_IT_)   cout << STRINGIFY(_IT_) << "\t:" << util::toString(_IT_) << endl;
 

Functions

template<class L >
string printSublist ()
 call the debug-print for a typelist utilising the Printer template
 
template<typename TYPES >
enable_if< is_Typelist< TYPES >, string > showType ()
 

Namespaces

 lib
 Implementation namespace for support and library code.