当前位置: 首页>>代码示例>>C++>>正文


C++ BOOST_PP_ENUM_PARAMS函数代码示例

本文整理汇总了C++中BOOST_PP_ENUM_PARAMS函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_PP_ENUM_PARAMS函数的具体用法?C++ BOOST_PP_ENUM_PARAMS怎么用?C++ BOOST_PP_ENUM_PARAMS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BOOST_PP_ENUM_PARAMS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: operator

 R operator()(
     BOOST_PP_ENUM_BINARY_PARAMS(MOCK_NUM_ARGS, T, t) ) const
 {
     valid_ = false;
     for( expectations_cit it = expectations_.begin();
         it != expectations_.end(); ++it )
         if( it->is_valid(
             BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, t) ) )
         {
             if( ! it->invoke() )
             {
                 error_type::fail( "sequence failed",
                     MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
                 return error_type::abort();
             }
             if( ! it->functor() )
             {
                 error_type::fail( "missing action",
                     MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
                 return error_type::abort();
             }
             valid_ = true;
             error_type::call(
                 MOCK_FUNCTION_CONTEXT, it->file(), it->line() );
             return it->functor()(
                 BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, t) );
         }
     error_type::fail( "unexpected call", MOCK_FUNCTION_CONTEXT );
     return error_type::abort();
 }
开发者ID:cfsghost,项目名称:qtjs-generator,代码行数:30,代码来源:function_impl_template.hpp

示例2: dispatch_sync

    inline saga::task
    dispatch_sync (run_mode     mode, 
                   char const * name,
                   TR1::shared_ptr<v1_0::cpi> cpi_instance,
                   void       (Base::*sync ) (RetVal &, BOOST_PP_ENUM_PARAMS (K, FuncArg)),
                   saga::task (Base::*async) (          BOOST_PP_ENUM_PARAMS (K, FuncArg)),
                   BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg))
    {
        TR1::shared_ptr<Base> c = TR1::static_pointer_cast<Base>(cpi_instance);

        switch (mode) {
        case Sync_Sync:
            return sync_sync(c, sync, BOOST_PP_ENUM_PARAMS(K, arg));

        case Sync_Async:
            return sync_async(c, async, BOOST_PP_ENUM_PARAMS(K, arg));

        case Async_Sync:
        case Async_Async:
            BOOST_ASSERT(false);
            break;

        default:
            break;
        }

        // no adaptor found  (Invalid mode)!
        SAGA_THROW_VERBATIM(cpi_instance.get(),
            std::string ("No adaptor implements method: ") + name,
            adaptors::NoAdaptor);

        return saga::task(saga::task_base::Done);
    }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:33,代码来源:sync_async_impl.hpp

示例3: operator

 typename lazy_enable_if_c<
     (mpl::size<param_types>::value == N)
   , make_nonterminal_holder<
         parameterized_nonterminal<
             Derived
           , fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>
         >
       , Derived
     >
 >::type
 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& f)) const
 {
     typename
         make_nonterminal_holder<
             parameterized_nonterminal<
                 Derived
               , fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>
             >
           , Derived
         >::type
     result =
     {{
         static_cast<Derived const*>(this)
       , fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)>(
             BOOST_PP_ENUM_PARAMS(N, f))
     }};
     return result;
 }
开发者ID:Axitonium,项目名称:sourcesdkpython,代码行数:28,代码来源:nonterminal_fcall.hpp

示例4: emplace_alert

		void emplace_alert(BOOST_PP_ENUM_BINARY_PARAMS(I, A, const& a) )
		{
			mutex::scoped_lock lock(m_mutex);
#ifndef TORRENT_NO_DEPRECATE
			if (m_dispatch)
			{
				m_dispatch(std::auto_ptr<alert>(new T(m_allocations[m_generation]
					BOOST_PP_COMMA_IF(I)
					BOOST_PP_ENUM_PARAMS(I, a))));
				return;
			}
#endif
			// don't add more than this number of alerts, unless it's a
			// high priority alert, in which case we try harder to deliver it
			// for high priority alerts, double the upper limit
			if (m_alerts[m_generation].size() >= m_queue_size_limit
				* (1 + T::priority))
				return;

			T alert(m_allocations[m_generation]
				BOOST_PP_COMMA_IF(I)
				BOOST_PP_ENUM_PARAMS(I, a));
			m_alerts[m_generation].push_back(alert);

			maybe_notify(&alert, lock);
		}
开发者ID:MikaelSmith,项目名称:libtorrent,代码行数:26,代码来源:alert_manager_variadic_emplace.hpp

示例5: construct_instance

static instance construct_instance(BOOST_PP_ENUM_BINARY_PARAMS(N, Param, p)) {
  // An instance is similar to boost::any. Initialize it with
  // a void ptr.
  return instance(static_cast<void*>(
    construct<T BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, Param)>
     (BOOST_PP_ENUM_PARAMS(N, p))),
                  &destruct<T>);
}
开发者ID:drupii,项目名称:cloudobserver,代码行数:8,代码来源:reflector_free_functions.hpp

示例6: compare_not_equal

  bool operator!=( of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D1)> const& a0
                 , of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D2)> const& a1
                 )
  {
    static const std::size_t
    a = of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D1)>::static_size;

    static const std::size_t
    b = of_size_<BOOST_PP_ENUM_PARAMS(NT2_MAX_DIMENSIONS, D2)>::static_size;

    return details::compare_not_equal(a0,a1,boost::mpl::size_t<(a < b) ? b : a>());
  }
开发者ID:JanVogelgesang,项目名称:nt2,代码行数:12,代码来源:comparison.hpp

示例7: dispatch_async

    inline saga::task
    dispatch_async (proxy * prxy, 
                    TR1::shared_ptr <adaptor_selector_state> state,
                    void       (Base::*sync_)  (RetVal &, BOOST_PP_ENUM_PARAMS (K, FuncArg)),
                    saga::task (Base::*async_) (          BOOST_PP_ENUM_PARAMS (K, FuncArg)),
                    BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg),
                    bool       (Base::*prep_)  (RetVal &, BOOST_PP_ENUM_PARAMS(K, FuncArg), saga::uuid) = NULL)
    {
        typedef void       (Base::*sync_func )(RetVal&, BOOST_PP_ENUM_PARAMS(K, FuncArg));
        typedef saga::task (Base::*async_func)(         BOOST_PP_ENUM_PARAMS(K, FuncArg));
        typedef bool       (Base::*prep_func )(RetVal&, BOOST_PP_ENUM_PARAMS(K, FuncArg), saga::uuid);

        void       (Base::*sync )() = NULL;
        saga::task (Base::*async)() = NULL;
        bool       (Base::*prep )() = NULL;

        run_mode mode = Unknown;
        TR1::shared_ptr<Base> c (
            state->get_next_cpi (mode, &sync, &async, &prep));

//      BOOST_ASSERT(NULL == sync  || (sync_func)  sync  == sync_ );
//      BOOST_ASSERT(NULL == async || (async_func) async == async_);
//      BOOST_ASSERT(NULL == prep  || (prep_func)  prep  == prep_ );

        switch (mode) {
        case Async_Sync:
            BOOST_ASSERT(sync);
            return async_sync(prxy, c, state, (sync_func)sync, 
                BOOST_PP_ENUM_PARAMS(K, arg), (prep_func)prep);

        case Async_Async:
            BOOST_ASSERT(async);
            return async_async(c, state, (async_func)async, 
                BOOST_PP_ENUM_PARAMS(K, arg));

        case Sync_Sync:
        case Sync_Async:
            BOOST_ASSERT(false);
            break;

        default:
            break;
        }

        // no adaptor found  (Invalid mode)!
        SAGA_THROW_VERBATIM(c.get(),
                            std::string ("No adaptor implements method: ") + state->get_op_name(),
                            adaptors::NoAdaptor);

        // this makes some compilers happy, but will never be called in fact
        // (didn't you see the throw above?)
        return saga::task(saga::task_base::Done);
    }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:53,代码来源:sync_async_impl.hpp

示例8: operator

	R operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, Arg, arg))
	{
		BOOST_SQL_RESULT_TYPE result;
		impl->execute(BOOST_SQL_PARAM_TYPE(BOOST_PP_ENUM_PARAMS(N, arg)));
		impl->fetch(result);
		return make_result<R, BOOST_SQL_RESULT_TYPE>::call(result);
	}
开发者ID:purpleKarrot,项目名称:async-db,代码行数:7,代码来源:callable_pp.hpp

示例9: def

void def(std::string const &name, R (*f)(BOOST_PP_ENUM_PARAMS(n,T)),
         policies const &p = policies())
{
    add_function(name,
                 boost::shared_ptr<details::callback_base>(
                     new details::BOOST_PP_CAT(callback,n)<R BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n,T)>(f)), p);
}
开发者ID:thelema,项目名称:cpptcl,代码行数:7,代码来源:interp_def.hpp

示例10: call

 BOOST_FORCEINLINE
 static type const call(src_type const &e)
 {
     type that = {
         BOOST_PP_ENUM_PARAMS(N, e.child)
     };
     return that;
 }
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:8,代码来源:generate_by_value.hpp

示例11: create

 /** Returns an instance of T (but does NOT retain ownership of the instance).
   * \param Params... The parameters described in the type of this factory.
   * \return An instance of T.
   * \pre is_valid() == true.
   * \post None.
   */
 T* create(Params...) const {
   if (this->func) {
     return this->func(BOOST_PP_ENUM_PARAMS(N, p));
   }
   else {
     return 0;
   }
 }
开发者ID:drupii,项目名称:cloudobserver,代码行数:14,代码来源:factory.hpp

示例12: sync_async

 inline saga::task
 sync_async (TR1::shared_ptr <Cpi> cpi,
             saga::task (Base::*async)(BOOST_PP_ENUM_PARAMS (K, FuncArg)),
             BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg))
 {
     return saga::detail::run_wait(
         (cpi.get()->*async)(BOOST_PP_ENUM_PARAMS(K, arg)));
 }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:8,代码来源:sync_async_impl.hpp

示例13: create

 T* create(BOOST_PP_ENUM_BINARY_PARAMS(N, Param, p)) const {
   if (this->func) {
     return this->func(BOOST_PP_ENUM_PARAMS(N, p));
   }
   else {
     return 0;
   }
 }
开发者ID:AntonDV235,项目名称:OMCompiler,代码行数:8,代码来源:factory.hpp

示例14: generate

 inline bool
 generate(
     OutputIterator const& sink_
   , Expr const& expr
   , BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& attr))
 {
     OutputIterator sink = sink_;
     return karma::generate(sink, expr, BOOST_PP_ENUM_PARAMS(N, attr));
 }
开发者ID:imos,项目名称:icfpc2015,代码行数:9,代码来源:generate_attr.hpp

示例15: operator

 void operator()
   (BOOST_PP_ENUM
    (BOOST_COROUTINE_ARG_MAX,
     BOOST_COROUTINE_param_with_default,
     arg)) {
   m_future_pimpl->assign(tuple_type
     (BOOST_PP_ENUM_PARAMS
      (BOOST_COROUTINE_ARG_MAX, arg)));
 }
开发者ID:Stevejohntest,项目名称:hpx,代码行数:9,代码来源:call_impl.hpp


注:本文中的BOOST_PP_ENUM_PARAMS函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。