libpsynth 0.2.1
Classes | Namespaces | Defines | Functions
/home/raskolnikov/dev/psynth/trunk/src/psynth/sound/dynamic_at_c.hpp File Reference

Time-stamp: <2010-11-04 12:48:28 raskolnikov> More...

#include <psynth/base/compat.hpp>
#include <cassert>
#include <stdexcept>
#include <boost/mpl/at.hpp>
#include <boost/mpl/size.hpp>
Include dependency graph for dynamic_at_c.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  psynth::base::detail::at_c::at_c_impl< 0 >
struct  psynth::base::detail::at_c::at_c_impl< 1 >
struct  psynth::base::detail::at_c::at_c_impl< 2 >
struct  psynth::base::detail::at_c::at_c_impl< 3 >

Namespaces

namespace  psynth
namespace  psynth::base
namespace  psynth::base::detail
namespace  psynth::base::detail::at_c

Defines

#define PSYNTH_AT_C_VALUE(z, N, text)   boost::mpl::at_c<IntTypes, S+N>::type::value,
#define PSYNTH_DYNAMIC_AT_C_LIMIT   226
#define PSYNTH_AT_C_LOOKUP(z, NUM, text)

Functions

template<typename IntTypes , typename ValueType >
ValueType psynth::base::at_c (std::size_t index)
 Given an MPL Random Access Sequence and a dynamic index n, returns the value of the n-th element It constructs a lookup table at compile time.

Detailed Description

Time-stamp: <2010-11-04 12:48:28 raskolnikov>

Author:
Juan Pedro Bolivar Puente <raskolnikov@es.gnu.org>
Date:
Thu Nov 4 12:37:28 2010

Constructs for static-to-dynamic integer convesion.


Define Documentation

#define PSYNTH_AT_C_LOOKUP (   z,
  NUM,
  text 
)
Value:
template<std::size_t S>                                             \
    struct at_c_fn<S,NUM>                                               \
    {                                                                   \
        template <typename IntTypes, typename ValueType> inline         \
            static ValueType apply(std::size_t index)                   \
        {                                                               \
            static ValueType table[] = {                                \
                BOOST_PP_REPEAT(NUM, PSYNTH_AT_C_VALUE, BOOST_PP_EMPTY) \
            };                                                          \
            return table[index];                                        \
        }                                                               \
    };
#define PSYNTH_AT_C_VALUE (   z,
  N,
  text 
)    boost::mpl::at_c<IntTypes, S+N>::type::value,
#define PSYNTH_DYNAMIC_AT_C_LIMIT   226