这篇教程C++ ASIO_MOVE_ARG函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASIO_MOVE_ARG函数的典型用法代码示例。如果您正苦于以下问题:C++ ASIO_MOVE_ARG函数的具体用法?C++ ASIO_MOVE_ARG怎么用?C++ ASIO_MOVE_ARG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASIO_MOVE_ARG函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: async_accept async_accept(basic_socket<Protocol1, SocketService>& peer, ASIO_MOVE_ARG(AcceptHandler) handler, typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; return this->get_service().async_accept(this->get_implementation(), peer, static_cast<endpoint_type*>(0), ASIO_MOVE_CAST(AcceptHandler)(handler)); }
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:12,
示例2: ASIO_INITFN_RESULT_TYPE * @code void handler( * const asio::error_code& error, // Result of operation. * * std::size_t bytes_transferred // Number of bytes written from the * // buffers. If an error occurred, * // this will be less than the sum * // of the buffer sizes. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation of * the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ template <typename AsyncWriteStream, typename Allocator, typename WriteHandler> ASIO_INITFN_RESULT_TYPE( WriteHandler, void( asio::error_code, std::size_t ) ) async_write( AsyncWriteStream& s, basic_streambuf<Allocator>& b, ASIO_MOVE_ARG( WriteHandler ) handler ); /// Start an asynchronous operation to write a certain amount of data to a /// stream. /** * This function is used to asynchronously write a certain number of bytes of * data to a stream. The function call always returns immediately. The * asynchronous operation will continue until one of the following conditions * is true: * * @li All of the data in the supplied basic_streambuf has been written. * * @li The completion_condition function object returns 0. * * This operation is implemented in terms of zero or more calls to the stream's * async_write_some function, and is known as a <em>composed operation</em>. The
开发者ID:obergner,项目名称:wally-io,代码行数:31,
示例3: dispatch /** * This function is used to ask the strand to execute the given function * object on its underlying executor. The function object will be executed * inside this function if the strand is not otherwise busy and if the * underlying executor's @c dispatch() function is also able to execute the * function before returning. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template <typename Function, typename Allocator> void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) { detail::strand_executor_service::dispatch(impl_, executor_, ASIO_MOVE_CAST(Function)(f), a); } /// Request the strand to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object will never be executed inside this function. * Instead, it will be scheduled by the underlying executor's defer function. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode *
开发者ID:DevSlashNull,项目名称:MaidSafe,代码行数:31,
示例4: ASIO_INITFN_RESULT_TYPE * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation of * the handler will be performed in a manner equivalent to using * clmdep_asio::io_service::post(). * * @note This overload is equivalent to calling: * @code clmdep_asio::async_read( * s, b, * clmdep_asio::transfer_all(), * handler); @endcode */template <typename AsyncReadStream, typename Allocator, typename ReadHandler>ASIO_INITFN_RESULT_TYPE(ReadHandler, void (clmdep_asio::error_code, std::size_t))async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, ASIO_MOVE_ARG(ReadHandler) handler);/// Start an asynchronous operation to read a certain amount of data from a/// stream./** * This function is used to asynchronously read a certain number of bytes of * data from a stream. The function call always returns immediately. The * asynchronous operation will continue until one of the following conditions is * true: * * @li The supplied buffer is full (that is, it has reached maximum size). * * @li The completion_condition function object returns 0. * * This operation is implemented in terms of zero or more calls to the stream's * async_read_some function, and is known as a <em>composed operation</em>. The
开发者ID:dvdjg,项目名称:GoapCpp,代码行数:31,
示例5: flush /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation. Throws an /// exception on failure. std::size_t flush(); /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation, or 0 if an /// error occurred. std::size_t flush(asio::error_code& ec); /// Start an asynchronous flush. template <typename WriteHandler> ASIO_INITFN_RESULT_TYPE(WriteHandler, void (asio::error_code, std::size_t)) async_flush(ASIO_MOVE_ARG(WriteHandler) handler); /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers); /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred and the error handler did not throw. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers, asio::error_code& ec); /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. template <typename ConstBufferSequence, typename WriteHandler>
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:30,
示例6: writeinline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, CompletionCondition completion_condition, typename enable_if< is_const_buffer_sequence<ConstBufferSequence>::value >::type*){ asio::error_code ec; std::size_t bytes_transferred = write(s, buffers, completion_condition, ec); asio::detail::throw_error(ec, "write"); return bytes_transferred;}template <typename SyncWriteStream, typename DynamicBufferSequence, typename CompletionCondition>std::size_t write(SyncWriteStream& s, ASIO_MOVE_ARG(DynamicBufferSequence) buffers, CompletionCondition completion_condition, asio::error_code& ec, typename enable_if< is_dynamic_buffer_sequence<DynamicBufferSequence>::value >::type*){ typename decay<DynamicBufferSequence>::type b( ASIO_MOVE_CAST(DynamicBufferSequence)(buffers)); std::size_t bytes_transferred = write(s, b.data(), completion_condition, ec); b.consume(bytes_transferred); return bytes_transferred;}template <typename SyncWriteStream, typename DynamicBufferSequence>inline std::size_t write(SyncWriteStream& s,
开发者ID:damu,项目名称:asio,代码行数:31,
示例7: ASIO_INITFN_RESULT_TYPE * @li Constructs an object @c result of type <tt>async_result<Handler></tt>, * initializing the object as <tt>result(handler)</tt>. * * @li Obtains the handler's associated executor object @c ex by performing * <tt>get_associated_executor(handler)</tt>. * * @li Obtains the handler's associated allocator object @c alloc by performing * <tt>get_associated_allocator(handler)</tt>. * * @li Performs <tt>ex.post(std::move(handler), alloc)</tt>. * * @li Returns <tt>result.get()</tt>. */template <typename CompletionToken>ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( ASIO_MOVE_ARG(CompletionToken) token);/// Submits a completion token or function object for execution./** * This function submits an object for execution using the specified executor. * The function object is queued for execution, and is never called from the * current thread prior to returning from <tt>post()</tt>. * * This function has the following effects: * * @li Constructs a function object handler of type @c Handler, initialized * with <tt>handler(forward<CompletionToken>(token))</tt>. * * @li Constructs an object @c result of type <tt>async_result<Handler></tt>, * initializing the object as <tt>result(handler)</tt>. *
开发者ID:DevSlashNull,项目名称:MaidSafe,代码行数:31,
示例8: ASIO_MOVE_ARG#include "asio/detail/recycling_allocator.hpp"#include "asio/detail/type_traits.hpp"#include "asio/execution_context.hpp"#include "asio/detail/push_options.hpp"namespace asio {inline execution_context& system_executor::context() const ASIO_NOEXCEPT{ return detail::global<context_impl>();}template <typename Function, typename Allocator>void system_executor::dispatch( ASIO_MOVE_ARG(Function) f, const Allocator&) const{ typename decay<Function>::type tmp(ASIO_MOVE_CAST(Function)(f)); asio_handler_invoke_helpers::invoke(tmp, tmp);}template <typename Function, typename Allocator>void system_executor::post( ASIO_MOVE_ARG(Function) f, const Allocator& a) const{ context_impl& ctx = detail::global<context_impl>(); // Make a local, non-const copy of the function. typedef typename decay<Function>::type function_type; function_type tmp(ASIO_MOVE_CAST(Function)(f));
开发者ID:htaox,项目名称:mysql-replication-listener-win,代码行数:30,
示例9: ASIO_INITFN_RESULT_TYPE * * // ... * * void connect_handler( * const asio::error_code& ec, * tcp::resolver::iterator i) * { * // ... * } @endcode */template <typename Protocol, typename SocketService, typename Iterator, typename ComposedConnectHandler>ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void (asio::error_code, Iterator))async_connect(basic_socket<Protocol, SocketService>& s, Iterator begin, ASIO_MOVE_ARG(ComposedConnectHandler) handler);/// Asynchronously establishes a socket connection by trying each endpoint in a/// sequence./** * This function attempts to connect a socket to one of a sequence of * endpoints. It does this by repeated calls to the socket's @c async_connect * member function, once for each endpoint in the sequence, until a connection * is successfully established. * * @param s The socket to be connected. If the socket is already open, it will * be closed. * * @param begin An iterator pointing to the start of a sequence of endpoints. * * @param end An iterator pointing to the end of a sequence of endpoints.
开发者ID:Ahbee,项目名称:Cinder,代码行数:31,
示例10: executor_binder_base};// Helper to:// - Apply the empty base optimisation to the executor.// - Perform uses_executor construction of the target type, if required.template <typename T, typename Executor, bool UsesExecutor>class executor_binder_base;template <typename T, typename Executor>class executor_binder_base<T, Executor, true> : protected Executor{protected: template <typename E, typename U> executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u) : executor_(ASIO_MOVE_CAST(E)(e)), target_(executor_arg_t(), executor_, ASIO_MOVE_CAST(U)(u)) { } Executor executor_; T target_;};template <typename T, typename Executor>class executor_binder_base<T, Executor, false>{protected: template <typename E, typename U> executor_binder_base(ASIO_MOVE_ARG(E) e, ASIO_MOVE_ARG(U) u)
开发者ID:DINKIN,项目名称:mongo,代码行数:31,
示例11: ASIO_INITFN_RESULT_TYPE * } * } * * ... * * asio::ip::tcp::acceptor acceptor(io_service); * ... * acceptor.async_wait( * asio::ip::tcp::acceptor::wait_read, * wait_handler); * @endcode */ template <typename WaitHandler> ASIO_INITFN_RESULT_TYPE(WaitHandler, void (asio::error_code)) async_wait(wait_type w, ASIO_MOVE_ARG(WaitHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WaitHandler. ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; return this->get_service().async_wait(this->get_implementation(), w, ASIO_MOVE_CAST(WaitHandler)(handler)); } /// Accept a new connection. /** * This function is used to accept a new connection from a peer into the * given socket. The function call will block until a new connection has been * accepted successfully or an error occurs. *
开发者ID:DevSlashNull,项目名称:MaidSafe,代码行数:31,
示例12: dispatch /// Request the executor to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object is executed according to the rules of the * target executor object. * * @param f The function object to be called. The executor will make a copy * of the handler object as required. The function signature of the function * object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template <typename Function, typename Allocator> void dispatch(ASIO_MOVE_ARG(Function) f, const Allocator& a) const; /// Request the executor to invoke the given function object. /** * This function is used to ask the executor to execute the given function * object. The function object is executed according to the rules of the * target executor object. * * @param f The function object to be called. The executor will make * a copy of the handler object as required. The function signature of the * function object must be: @code void function(); @endcode * * @param a An allocator that may be used by the executor to allocate the * internal storage needed for function invocation. */ template <typename Function, typename Allocator>
开发者ID:0xbda2d2f8,项目名称:asio,代码行数:30,
示例13: ASIO_INITFN_RESULT_TYPE * not, the handler will not be invoked from within this function. Invocation of * the handler will be performed in a manner equivalent to using * asio::io_context::post(). * * @note This overload is equivalent to calling: * @code asio::async_read_at( * d, 42, b, * asio::transfer_all(), * handler); @endcode */template <typename AsyncRandomAccessReadDevice, typename Allocator, typename ReadHandler>ASIO_INITFN_RESULT_TYPE(ReadHandler, void (asio::error_code, std::size_t))async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset, basic_streambuf<Allocator>& b, ASIO_MOVE_ARG(ReadHandler) handler);/// Start an asynchronous operation to read a certain amount of data at the/// specified offset./** * This function is used to asynchronously read a certain number of bytes of * data from a random access device at the specified offset. The function call * always returns immediately. The asynchronous operation will continue until * one of the following conditions is true: * * @li The completion_condition function object returns 0. * * This operation is implemented in terms of zero or more calls to the device's * async_read_some_at function. * * @param d The device from which the data is to be read. The type must support
开发者ID:Polarhigh,项目名称:AmxxCurl,代码行数:31,
示例14: win_iocp_overlapped_ptr// Wraps a handler to create an OVERLAPPED object for use with overlapped I/O.class win_iocp_overlapped_ptr : private noncopyable{public: // Construct an empty win_iocp_overlapped_ptr. win_iocp_overlapped_ptr() : ptr_(0), iocp_service_(0) { } // Construct an win_iocp_overlapped_ptr to contain the specified handler. template <typename Handler> explicit win_iocp_overlapped_ptr( asio::io_service& io_service, ASIO_MOVE_ARG(Handler) handler) : ptr_(0), iocp_service_(0) { this->reset(io_service, ASIO_MOVE_CAST(Handler)(handler)); } // Destructor automatically frees the OVERLAPPED object unless released. ~win_iocp_overlapped_ptr() { reset(); } // Reset to empty. void reset() {
开发者ID:AliAkbarMontazeri,项目名称:AtomicGameEngine,代码行数:31,
示例15: defined#if defined(_MSC_VER) && (_MSC_VER >= 1200)# pragma once#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)#include "asio/detail/config.hpp"#include "asio/associated_allocator.hpp"#include "asio/associated_executor.hpp"#include "asio/detail/work_dispatcher.hpp"#include "asio/detail/push_options.hpp"namespace asio {template <typename CompletionToken>ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post( ASIO_MOVE_ARG(CompletionToken) token){ typedef ASIO_HANDLER_TYPE(CompletionToken, void()) handler; async_completion<CompletionToken, void()> init(token); typename associated_executor<handler>::type ex( (get_associated_executor)(init.completion_handler)); typename associated_allocator<handler>::type alloc( (get_associated_allocator)(init.completion_handler)); ex.post(ASIO_MOVE_CAST(handler)(init.completion_handler), alloc); return init.result.get();}
开发者ID:Dagarman,项目名称:mame,代码行数:31,
示例16: connect//.........这里部分代码省略......... * @par Example * @code tcp::resolver r(io_service); * tcp::resolver::query q("host", "service"); * tcp::socket s(io_service); * * // ... * * r.async_resolve(q, resolve_handler); * * // ... * * void resolve_handler( * const asio::error_code& ec, * tcp::resolver::iterator i) * { * if (!ec) * { * asio::async_connect(s, i, connect_handler); * } * } * * // ... * * void connect_handler( * const asio::error_code& ec, * tcp::resolver::iterator i) * { * // ... * } @endcode */template <typename Protocol, typename SocketService, typename Iterator, typename ComposedConnectHandler>void async_connect(basic_socket<Protocol, SocketService>& s, Iterator begin, ASIO_MOVE_ARG(ComposedConnectHandler) handler);/// Asynchronously establishes a socket connection by trying each endpoint in a/// sequence./** * This function attempts to connect a socket to one of a sequence of * endpoints. It does this by repeated calls to the socket's @c async_connect * member function, once for each endpoint in the sequence, until a connection * is successfully established. * * @param s The socket to be connected. If the socket is already open, it will * be closed. * * @param begin An iterator pointing to the start of a sequence of endpoints. * * @param end An iterator pointing to the end of a sequence of endpoints. * * @param handler The handler to be called when the connect operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * // Result of operation. if the sequence is empty, set to * // asio::error::not_found. Otherwise, contains the * // error from the last connection attempt. * const asio::error_code& error, * * // On success, an iterator denoting the successfully * // connected endpoint. Otherwise, the end iterator. * Iterator iterator * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using
开发者ID:BorisSchaeling,项目名称:asio,代码行数:67,
示例17: spawn/// completes./** * This function is used to launch a new coroutine. * * @param handler A handler to be called when the coroutine exits. More * importantly, the handler provides an execution context (via the the handler * invocation hook) for the coroutine. The handler must have the signature: * @code void handler(); @endcode * * @param function The coroutine function. The function must have the signature: * @code void function(basic_yield_context<Handler> yield); @endcode * * @param attributes Boost.Coroutine attributes used to customise the coroutine. */template <typename Handler, typename Function>void spawn(ASIO_MOVE_ARG(Handler) handler, ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes());/// Start a new stackful coroutine, inheriting the execution context of another./** * This function is used to launch a new coroutine. * * @param ctx Identifies the current coroutine as a parent of the new * coroutine. This specifies that the new coroutine should inherit the * execution context of the parent. For example, if the parent coroutine is * executing in a particular strand, then the new coroutine will execute in the * same strand. * * @param function The coroutine function. The function must have the signature:
开发者ID:4nc3str4l,项目名称:LostEngine,代码行数:31,
示例18: write * * @param buffers The dynamic buffer sequence from which data will be written. * Successfully written data is automatically consumed from the buffers. * * @returns The number of bytes transferred. * * @throws asio::system_error Thrown on failure. * * @note This overload is equivalent to calling: * @code asio::write( * s, buffers, * asio::transfer_all()); @endcode */template <typename SyncWriteStream, typename DynamicBuffer>std::size_t write(SyncWriteStream& s, ASIO_MOVE_ARG(DynamicBuffer) buffers, typename enable_if< is_dynamic_buffer<DynamicBuffer>::value >::type* = 0);/// Write all of the supplied data to a stream before returning./** * This function is used to write a certain number of bytes of data to a stream. * The call will block until one of the following conditions is true: * * @li All of the data in the supplied dynamic buffer sequence has been written. * * @li An error occurred. * * This operation is implemented in terms of zero or more calls to the stream's * write_some function.
开发者ID:Dagarman,项目名称:mame,代码行数:31,
示例19: ASIO_INITFN_RESULT_TYPE * @param handler The handler to be called when the accept operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * const asio::error_code& error // Result of operation. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ template <typename SocketService, typename AcceptHandler> ASIO_INITFN_RESULT_TYPE(AcceptHandler, void (asio::error_code)) async_accept(basic_socket<protocol_type, SocketService>& peer, endpoint_type& peer_endpoint, ASIO_MOVE_ARG(AcceptHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a AcceptHandler. ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check; return this->get_service().async_accept(this->get_implementation(), peer, &peer_endpoint, ASIO_MOVE_CAST(AcceptHandler)(handler)); }};} // namespace asio#include "asio/detail/pop_options.hpp"#endif // ASIO_BASIC_SOCKET_ACCEPTOR_HPP
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:31,
示例20: executor_typeinline io_service::executor_typeio_service::get_executor() ASIO_NOEXCEPT{ return executor_type(*this);}#if !defined(ASIO_NO_DEPRECATED)inline void io_service::reset(){ restart();}template <typename CompletionHandler>ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())io_service::dispatch(ASIO_MOVE_ARG(CompletionHandler) handler){ // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a CompletionHandler. ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check; async_completion<CompletionHandler, void ()> init(handler); if (impl_.can_dispatch()) { detail::fenced_block b(detail::fenced_block::full); asio_handler_invoke_helpers::invoke(init.handler, init.handler); } else { // Allocate and construct an operation to wrap the handler.
开发者ID:ChineseDr,项目名称:mongo,代码行数:31,
示例21: defined# include <boost/bind.hpp>#else // defined(ASIO_HAS_BOOST_BIND)# include <functional>#endif // defined(ASIO_HAS_BOOST_BIND)namespace archetypes {#if defined(ASIO_HAS_BOOST_BIND)namespace bindns = boost;#else // defined(ASIO_HAS_BOOST_BIND)namespace bindns = std;#endif // defined(ASIO_HAS_BOOST_BIND)template <typename CompletionToken>ASIO_INITFN_RESULT_TYPE(CompletionToken, void())async_op_0(ASIO_MOVE_ARG(CompletionToken) token){ typedef typename asio::async_completion<CompletionToken, void()>::completion_handler_type handler_type; asio::async_completion<CompletionToken, void()> completion(token); typename asio::associated_allocator<handler_type>::type a = asio::get_associated_allocator(completion.completion_handler); typename asio::associated_executor<handler_type>::type ex = asio::get_associated_executor(completion.completion_handler); ex.post(ASIO_MOVE_CAST(handler_type)(completion.completion_handler), a);
开发者ID:Corvusoft,项目名称:asio-dependency,代码行数:30,
示例22: ASIO_INITFN_RESULT_TYPE * * @param handler The handler to be called. The io_service will make * a copy of the handler object as required. The function signature of the * handler must be: @code void handler(); @endcode * * @note This function throws an exception only if: * * @li the handler's @c asio_handler_allocate function; or * * @li the handler's copy constructor * * throws an exception. */ template <typename CompletionHandler> ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ()) dispatch(ASIO_MOVE_ARG(CompletionHandler) handler); /// (Deprecated: Use asio::post().) Request the io_service to invoke /// the given handler and return immediately. /** * This function is used to ask the io_service to execute the given handler, * but without allowing the io_service to call the handler from inside this * function. * * The io_service guarantees that the handler will only be called in a thread * in which the run(), run_one(), poll() or poll_one() member functions is * currently being invoked. * * @param handler The handler to be called. The io_service will make * a copy of the handler object as required. The function signature of the * handler must be: @code void handler(); @endcode
开发者ID:DevSlashNull,项目名称:MaidSafe,代码行数:31,
示例23: get static type get(const detail::buffered_flush_handler<WriteHandler>& h, const Executor& ex = Executor()) ASIO_NOEXCEPT { return associated_executor<WriteHandler, Executor>::get(h.handler_, ex); }};#endif // !defined(GENERATING_DOCUMENTATION)template <typename Stream>template <typename WriteHandler>ASIO_INITFN_RESULT_TYPE(WriteHandler, void (asio::error_code, std::size_t))buffered_write_stream<Stream>::async_flush( ASIO_MOVE_ARG(WriteHandler) handler){ // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; async_completion<WriteHandler, void (asio::error_code, std::size_t)> init(handler); async_write(next_layer_, buffer(storage_.data(), storage_.size()), detail::buffered_flush_handler<ASIO_HANDLER_TYPE( WriteHandler, void (asio::error_code, std::size_t))>( storage_, init.completion_handler)); return init.result.get();}
开发者ID:DINKIN,项目名称:mongo,代码行数:30,
示例24: wait { return service_impl_.cancel(impl, ec); } // Wait for a signaled state. void wait(implementation_type& impl, asio::error_code& ec) { service_impl_.wait(impl, ec); } /// Start an asynchronous wait. template <typename WaitHandler> ASIO_INITFN_RESULT_TYPE(WaitHandler, void (asio::error_code)) async_wait(implementation_type& impl, ASIO_MOVE_ARG(WaitHandler) handler) { asio::detail::async_result_init< WaitHandler, void (asio::error_code)> init( ASIO_MOVE_CAST(WaitHandler)(handler)); service_impl_.async_wait(impl, init.handler); return init.result.get(); }private: // Destroy all user-defined handler objects owned by the service. void shutdown_service() { service_impl_.shutdown_service();
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:31,
示例25: async_wait * error code asio::error::operation_aborted. * * @param handler The handler to be called when the signal occurs. Copies * will be made of the handler as required. The function signature of the * handler must be: * @code void handler( * const asio::error_code& error, // Result of operation. * int signal_number // Indicates which signal occurred. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * asio::io_service::post(). */ template <typename SignalHandler> void async_wait(ASIO_MOVE_ARG(SignalHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a SignalHandler. ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check; this->service.async_wait(this->implementation, ASIO_MOVE_CAST(SignalHandler)(handler)); }};} // namespace asio#include "asio/detail/pop_options.hpp"#endif // ASIO_BASIC_SIGNAL_SET_HPP
开发者ID:Shumen,项目名称:asio,代码行数:31,
示例26: cancel return service_impl_.clear(impl, ec); } /// Cancel all operations associated with the signal set. asio::error_code cancel(implementation_type& impl, asio::error_code& ec) { return service_impl_.cancel(impl, ec); } // Start an asynchronous operation to wait for a signal to be delivered. template <typename SignalHandler> ASIO_INITFN_RESULT_TYPE(SignalHandler, void (asio::error_code, int)) async_wait(implementation_type& impl, ASIO_MOVE_ARG(SignalHandler) handler) { detail::async_result_init< SignalHandler, void (asio::error_code, int)> init( ASIO_MOVE_CAST(SignalHandler)(handler)); service_impl_.async_wait(impl, init.handler); return init.result.get(); }private: // Destroy all user-defined handler objects owned by the service. void shutdown_service() { service_impl_.shutdown_service();
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:31,
示例27: ASIO_INITFN_RESULT_TYPE * * @param handler The handler to be called when the timer expires. Copies * will be made of the handler as required. The function signature of the * handler must be: * @code void handler( * const clmdep_asio::error_code& error // Result of operation. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * clmdep_asio::io_service::post(). */ template <typename WaitHandler> ASIO_INITFN_RESULT_TYPE(WaitHandler, void (clmdep_asio::error_code)) async_wait(ASIO_MOVE_ARG(WaitHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WaitHandler. ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check; return this->service.async_wait(this->implementation, ASIO_MOVE_CAST(WaitHandler)(handler)); }};} // namespace clmdep_asio#include "asio/detail/pop_options.hpp"#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
开发者ID:dvdjg,项目名称:GoapCpp,代码行数:31,
示例28: read * the SyncReadStream concept. * * @param buffers The dynamic buffer sequence into which the data will be read. * * @returns The number of bytes transferred. * * @throws asio::system_error Thrown on failure. * * @note This overload is equivalent to calling: * @code asio::read( * s, buffers, * asio::transfer_all()); @endcode */template <typename SyncReadStream, typename DynamicBufferSequence>std::size_t read(SyncReadStream& s, ASIO_MOVE_ARG(DynamicBufferSequence) buffers, typename enable_if< is_dynamic_buffer_sequence<DynamicBufferSequence>::value >::type* = 0);/// Attempt to read a certain amount of data from a stream before returning./** * This function is used to read a certain number of bytes of data from a * stream. The call will block until one of the following conditions is true: * * @li The supplied buffer is full (that is, it has reached maximum size). * * @li An error occurred. * * This operation is implemented in terms of zero or more calls to the stream's * read_some function.
开发者ID:blockchain-research-foundation,项目名称:openmonero,代码行数:31,
示例29: overlapped_ptr * @e Shared @e objects: Unsafe. */class overlapped_ptr : private noncopyable{public: /// Construct an empty overlapped_ptr. overlapped_ptr() : impl_() { } /// Construct an overlapped_ptr to contain the specified handler. template <typename Handler> explicit overlapped_ptr(asio::io_context& io_context, ASIO_MOVE_ARG(Handler) handler) : impl_(io_context, ASIO_MOVE_CAST(Handler)(handler)) { } /// Destructor automatically frees the OVERLAPPED object unless released. ~overlapped_ptr() { } /// Reset to empty. void reset() { impl_.reset(); }
开发者ID:Dagarman,项目名称:mame,代码行数:30,
示例30: on_work_started void on_work_started() ASIO_NOEXCEPT { executor_.on_work_started(); } void on_work_finished() ASIO_NOEXCEPT { executor_.on_work_finished(); } execution_context& context() ASIO_NOEXCEPT { return executor_.context(); } void dispatch(ASIO_MOVE_ARG(function) f) { executor_.dispatch(ASIO_MOVE_CAST(function)(f), allocator_); } void post(ASIO_MOVE_ARG(function) f) { executor_.post(ASIO_MOVE_CAST(function)(f), allocator_); } void defer(ASIO_MOVE_ARG(function) f) { executor_.defer(ASIO_MOVE_CAST(function)(f), allocator_); } type_id_result_type target_type() const ASIO_NOEXCEPT
开发者ID:damu,项目名称:asio,代码行数:31,
注:本文中的ASIO_MOVE_ARG函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASIO_MOVE_CAST函数代码示例 C++ ASIO_HANDLER_COMPLETION函数代码示例 |