本文整理汇总了C++中tr1::shared_ptr::get_next_cpi方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::get_next_cpi方法的具体用法?C++ shared_ptr::get_next_cpi怎么用?C++ shared_ptr::get_next_cpi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr1::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::get_next_cpi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: task
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);
}