// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)

#ifndef BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
#define BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED

#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>

#include <boost/spirit/typeof/encode_decode.hpp>
#include <boost/spirit/typeof/concatenate.hpp>

#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()

#ifndef BOOST_TYPEOF_FUN_PARAMS_SUPPORTED
#define BOOST_TYPEOF_FUN_PARAMS_SUPPORTED 10
#endif

enum 
{
    FUN_ID                          = BOOST_TYPEOF_UNIQUE_ID(),
    VOID_FUN_ID                     = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    MEM_FUN_ID                      = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    CONST_MEM_FUN_ID                = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    VOID_MEM_FUN_ID                 = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    CONST_VOID_MEM_FUN_ID           = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    VOLATILE_MEM_FUN_ID             = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    VOLATILE_CONST_MEM_FUN_ID       = FUN_ID + 7 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    VOLATILE_VOID_MEM_FUN_ID        = FUN_ID + 8 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED),
    VOLATILE_CONST_VOID_MEM_FUN_ID  = FUN_ID + 9 * BOOST_PP_INC(BOOST_TYPEOF_FUN_PARAMS_SUPPORTED)
};

namespace boost
{
    namespace type_of
    {
        namespace
        {
            # define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_FUN_PARAMS_SUPPORTED)
            # define BOOST_PP_FILENAME_1 <boost/spirit/typeof/register_functions_iterate.hpp>
            # include BOOST_PP_ITERATE()    
        }
    }
}

#endif//BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
