當前位置: 首頁>>代碼示例>>C++>>正文


C++ shared_ptr::get_op_name方法代碼示例

本文整理匯總了C++中tr1::shared_ptr::get_op_name方法的典型用法代碼示例。如果您正苦於以下問題:C++ shared_ptr::get_op_name方法的具體用法?C++ shared_ptr::get_op_name怎麽用?C++ shared_ptr::get_op_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tr1::shared_ptr的用法示例。


在下文中一共展示了shared_ptr::get_op_name方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
    }
開發者ID:saga-project,項目名稱:saga-cpp,代碼行數:53,代碼來源:sync_async_impl.hpp

示例2: void

    inline saga::task
    async_sync (proxy * prxy, 
                TR1::shared_ptr <Cpi> cpi, 
                TR1::shared_ptr <adaptor_selector_state> state,
                void (Base::*sync) (RetVal&, 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))
    {
        saga::adaptors::task t(state->get_op_name(), cpi, prxy, sync, 
                               BOOST_PP_ENUM_PARAMS(K, arg), prep);

        detail::set_selector_state(t, state);
        
        return t;
    }
開發者ID:saga-project,項目名稱:saga-cpp,代碼行數:15,代碼來源:sync_async_impl.hpp


注:本文中的tr1::shared_ptr::get_op_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。