Boost logo

Boost :

From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-01-24 18:21:58


Usage may be clearer with some code.... leaving out pp includes.

The file models/Furnace.h includes <boost/mpl/list.hpp>

---- IncludeAllModels.h

#define SUBCLASS_LIST \
   BOOST_PP_TUPLE_TO_LIST( \
      3, \
      ( \
         Slitter, \
         Scalper, \
         Furnace \
      ) \
   ) \
   //< List of all models

#define FILE_SUFFIX .h
#define FILE_PATH models/
#define LIST SUBCLASS_LIST

#include "ComputedInclude.h"

---- ComputedInclude.h

#define LIST_SIZE BOOST_PP_LIST_SIZE (LIST)
#define ITER_SIZE BOOST_PP_DEC (LIST_SIZE)
#define BOOST_PP_ITERATION_LIMITS (0, ITER_SIZE)
#define BOOST_PP_FILENAME_1 "ComputedIncludeIteration.h"

#define HARPS_CI 1
#include BOOST_PP_ITERATE()
#undef HARPS_CI

---- ComputedIncludeIteration.h

#define ITER BOOST_PP_ITERATION()
#define THIS_ITEM BOOST_PP_LIST_AT ( LIST, ITER)
#define FILE_NAME BOOST_PP_CAT (THIS_ITEM, FILE_SUFFIX)

#define FULL_NAME BOOST_PP_CAT (FILE_PATH, FILE_NAME)

#define FN BOOST_PP_STRINGIZE (FULL_NAME)

#include FN


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk