當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。