• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ BOOST_PP_ENUM_PARAMS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: sync_sync

 inline saga::task
 sync_sync (TR1::shared_ptr <Cpi> cpi,
            void (Base::*sync) (RetVal &, BOOST_PP_ENUM_PARAMS (K, FuncArg)),
            BOOST_PP_ENUM_BINARY_PARAMS (K, Arg, const & arg))
 {
     saga::task t(saga::task::Done);
     (cpi.get()->*sync)(
         t.get_result<RetVal>(), BOOST_PP_ENUM_PARAMS (K, arg));
     return t;
 }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:10,代码来源:sync_async_impl.hpp


示例17: async_async

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


示例18: void

 inline task::task (
         char const *func_name, TR1::shared_ptr<Cpi> cpi, 
         void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid),
         BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
         bool (Base::*prep)(
             RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid))
   : base_type(create_task(func_name, cpi, cpi->get_proxy(), sync, 
         BOOST_PP_ENUM_PARAMS(P, arg), prep)) 
 {
 }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:10,代码来源:task_impl.hpp


示例19: wrapper_task

 /**
   * constructor
   */
 wrapper_task (std::string const& func_name, TR1::shared_ptr<BaseCpi> cpi, 
       void (Base::*sync)(
           RetVal&, BOOST_PP_ENUM_PARAMS (L, FuncArg), saga::uuid),
       BOOST_PP_ENUM_BINARY_PARAMS (L, Arg, arg),
       bool (Base::*prep)(
           RetVal&, BOOST_PP_ENUM_PARAMS (L, FuncArg), saga::uuid) = NULL)
   : base_type(func_name, cpi), exec_(sync), prep_func_(prep),
     func_args_(BOOST_PP_ENUM_PARAMS(L, arg))
 {   
 }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:13,代码来源:wrapper_task_impl.hpp


示例20: set

 void set() {
   // This assertion will fire if a factory type is
   // set to a class from which it doesn't inherit.
   BOOST_STATIC_ASSERT((is_base_of<T, D>::value));
 // This assertion will fire if D is const.
   BOOST_STATIC_ASSERT((!is_const<D>::value));
   this->func = &impl::create_function<
       T, D BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N,Param)
     >::create;
 }
开发者ID:AntonDV235,项目名称:OMCompiler,代码行数:10,代码来源:factory.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BOOST_PP_INC函数代码示例发布时间:2022-05-30
下一篇:
C++ BOOST_MPI_CHECK_RESULT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap