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

C++ ASIO_MOVE_CAST函数代码示例

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

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



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

示例1: read_op

 read_op(AsyncReadStream& stream, const std::array<Elem, 2>& buffers,
     CompletionCondition completion_condition, ReadHandler& handler)
   : detail::base_from_completion_cond<
       CompletionCondition>(completion_condition),
     stream_(stream),
     buffers_(buffers),
     start_(0),
     total_transferred_(0),
     handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
 {
 }
开发者ID:4nc3str4l,项目名称:LostEngine,代码行数:11,代码来源:read.hpp


示例2: win_iocp_socket_recvmsg_op

 win_iocp_socket_recvmsg_op(
     socket_ops::weak_cancel_token_type cancel_token,
     const MutableBufferSequence& buffers,
     socket_base::message_flags& out_flags, Handler& handler)
   : operation(&win_iocp_socket_recvmsg_op::do_complete),
     cancel_token_(cancel_token),
     buffers_(buffers),
     out_flags_(out_flags),
     handler_(ASIO_MOVE_CAST(Handler)(handler))
 {
 }
开发者ID:AliAkbarMontazeri,项目名称:AtomicGameEngine,代码行数:11,代码来源:win_iocp_socket_recvmsg_op.hpp


示例3: connect_op

 connect_op(basic_socket<Protocol, SocketService>& sock,
            const Iterator& begin, const Iterator& end,
            const ConnectCondition& connect_condition,
            ComposedConnectHandler& handler)
     : base_from_connect_condition<ConnectCondition>(connect_condition),
       socket_(sock),
       iter_(begin),
       end_(end),
       start_(0),
       handler_(ASIO_MOVE_CAST(ComposedConnectHandler)(handler))
 {
 }
开发者ID:kevinlovesing,项目名称:resiprocate,代码行数:12,代码来源:connect.hpp


示例4: read_op

 read_op(AsyncReadStream& stream,
     const asio::mutable_buffers_1& buffers,
     CompletionCondition completion_condition,
     ReadHandler& handler)
   : detail::base_from_completion_cond<
       CompletionCondition>(completion_condition),
     stream_(stream),
     buffer_(buffers),
     total_transferred_(0),
     handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
 {
 }
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:12,代码来源:read.hpp


示例5: read_at_op

 read_at_op(AsyncRandomAccessReadDevice& device,
     boost::uint64_t offset, const asio::mutable_buffers_1& buffers,
     CompletionCondition completion_condition, ReadHandler& handler)
   : detail::base_from_completion_cond<
       CompletionCondition>(completion_condition),
     device_(device),
     offset_(offset),
     buffer_(buffers),
     total_transferred_(0),
     handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
 {
 }
开发者ID:BorisSchaeling,项目名称:asio,代码行数:12,代码来源:read_at.hpp


示例6: win_iocp_socket_recvfrom_op

 win_iocp_socket_recvfrom_op(Endpoint& endpoint,
     socket_ops::weak_cancel_token_type cancel_token,
     const MutableBufferSequence& buffers, Handler& handler)
   : operation(&win_iocp_socket_recvfrom_op::do_complete),
     endpoint_(endpoint),
     endpoint_size_(static_cast<int>(endpoint.capacity())),
     cancel_token_(cancel_token),
     buffers_(buffers),
     handler_(ASIO_MOVE_CAST(Handler)(handler))
 {
   handler_work<Handler>::start(handler_);
 }
开发者ID:Ahbee,项目名称:Cinder,代码行数:12,代码来源:win_iocp_socket_recvfrom_op.hpp


示例7: write_at_op

 write_at_op(AsyncRandomAccessWriteDevice& device,
     boost::uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, WriteHandler& handler)
   : detail::base_from_completion_cond<
       CompletionCondition>(completion_condition),
     device_(device),
     offset_(offset),
     buffers_(buffers),
     total_transferred_(0),
     handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
 {
 }
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:12,代码来源:write_at.hpp


示例8: range_connect_op

 range_connect_op(basic_socket<Protocol ASIO_SVC_TARG>& sock,
     const EndpointSequence& endpoints,
     const ConnectCondition& connect_condition,
     RangeConnectHandler& handler)
   : base_from_connect_condition<ConnectCondition>(connect_condition),
     socket_(sock),
     endpoints_(endpoints),
     index_(0),
     start_(0),
     handler_(ASIO_MOVE_CAST(RangeConnectHandler)(handler))
 {
 }
开发者ID:Dagarman,项目名称:mame,代码行数:12,代码来源:connect.hpp


示例9: write_op

 write_op(AsyncWriteStream& stream,
     const asio::const_buffers_1& buffers,
     CompletionCondition completion_condition,
     WriteHandler& handler)
   : detail::base_from_completion_cond<
       CompletionCondition>(completion_condition),
     stream_(stream),
     buffer_(buffers),
     total_transferred_(0),
     handler_(ASIO_MOVE_CAST(WriteHandler)(handler))
 {
 }
开发者ID:Shumen,项目名称:asio,代码行数:12,代码来源:write.hpp


示例10: 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,代码来源:basic_socket_acceptor.hpp


示例11: iterator_connect_op

 iterator_connect_op(basic_socket<Protocol ASIO_SVC_TARG>& sock,
     const Iterator& begin, const Iterator& end,
     const ConnectCondition& connect_condition,
     IteratorConnectHandler& handler)
   : base_from_connect_condition<ConnectCondition>(connect_condition),
     socket_(sock),
     iter_(begin),
     end_(end),
     start_(0),
     handler_(ASIO_MOVE_CAST(IteratorConnectHandler)(handler))
 {
 }
开发者ID:Dagarman,项目名称:mame,代码行数:12,代码来源:connect.hpp


示例12: reactive_socket_recv_op

 reactive_socket_recv_op( socket_type socket,
                          socket_ops::state_type state,
                          const MutableBufferSequence& buffers,
                          socket_base::message_flags flags,
                          Handler& handler )
     : reactive_socket_recv_op_base<MutableBufferSequence>( socket,
                                                            state,
                                                            buffers,
                                                            flags,
                                                            &reactive_socket_recv_op::do_complete ),
       handler_( ASIO_MOVE_CAST( Handler )( handler ) )
 {
 }
开发者ID:obergner,项目名称:wally-io,代码行数:13,代码来源:reactive_socket_recv_op.hpp


示例13: win_iocp_socket_recvmsg_op

 win_iocp_socket_recvmsg_op(
     socket_ops::weak_cancel_token_type cancel_token,
     const MutableBufferSequence& buffers,
     socket_base::message_flags& out_flags,
     Handler& handler, const IoExecutor& io_ex)
   : operation(&win_iocp_socket_recvmsg_op::do_complete),
     cancel_token_(cancel_token),
     buffers_(buffers),
     out_flags_(out_flags),
     handler_(ASIO_MOVE_CAST(Handler)(handler)),
     io_executor_(io_ex)
 {
   handler_work<Handler, IoExecutor>::start(handler_, io_executor_);
 }
开发者ID:DitansKing,项目名称:asio,代码行数:14,代码来源:win_iocp_socket_recvmsg_op.hpp


示例14: win_iocp_socket_accept_op

 win_iocp_socket_accept_op(win_iocp_socket_service_base& socket_service,
     socket_type socket, Socket& peer, const Protocol& protocol,
     typename Protocol::endpoint* peer_endpoint,
     bool enable_connection_aborted, Handler& handler)
   : operation(&win_iocp_socket_accept_op::do_complete),
     socket_service_(socket_service),
     socket_(socket),
     peer_(peer),
     protocol_(protocol),
     peer_endpoint_(peer_endpoint),
     enable_connection_aborted_(enable_connection_aborted),
     handler_(ASIO_MOVE_CAST(Handler)(handler))
 {
 }
开发者ID:AbdelghaniDr,项目名称:Cinder,代码行数:14,代码来源:win_iocp_socket_accept_op.hpp


示例15: win_iocp_socket_move_accept_op

 win_iocp_socket_move_accept_op(
     win_iocp_socket_service_base& socket_service, socket_type socket,
     const Protocol& protocol, asio::io_context& peer_io_context,
     typename Protocol::endpoint* peer_endpoint,
     bool enable_connection_aborted, Handler& handler)
   : operation(&win_iocp_socket_move_accept_op::do_complete),
     socket_service_(socket_service),
     socket_(socket),
     peer_(peer_io_context),
     protocol_(protocol),
     peer_endpoint_(peer_endpoint),
     enable_connection_aborted_(enable_connection_aborted),
     handler_(ASIO_MOVE_CAST(Handler)(handler))
 {
   handler_work<Handler>::start(handler_);
 }
开发者ID:Aulddays,项目名称:APass,代码行数:16,代码来源:win_iocp_socket_accept_op.hpp


示例16: operator

    void operator()(asio::error_code ec, int start = 0)
    {
        switch (start_ = start)
        {
        case 1:
            for (;;)
            {
                this->check_condition(ec, iter_, end_);

                if (iter_ != end_)
                {
                    socket_.close(ec);
                    socket_.async_connect(*iter_,
                                          ASIO_MOVE_CAST(connect_op)(*this));
                    return;
                }

                if (start)
                {
                    ec = asio::error::not_found;
                    socket_.get_io_service().post(detail::bind_handler(*this, ec));
                    return;
                }

            default:

                if (iter_ == end_)
                    break;

                if (!socket_.is_open())
                {
                    ec = asio::error::operation_aborted;
                    break;
                }

                if (!ec)
                    break;

                ++iter_;
            }

            handler_(static_cast<const asio::error_code&>(ec),
                     static_cast<const Iterator&>(iter_));
        }
    }
开发者ID:kevinlovesing,项目名称:resiprocate,代码行数:45,代码来源:connect.hpp


示例17: operator

    void operator()(const asio::error_code& ec,
        std::size_t bytes_transferred, int start = 0)
    {
      switch (start)
      {
        case 1:
        buffers_.prepare(this->check_for_completion(ec, total_transferred_));
        for (;;)
        {
          device_.async_read_some_at(offset_ + total_transferred_,
              buffers_, ASIO_MOVE_CAST(read_at_op)(*this));
          return; default:
          total_transferred_ += bytes_transferred;
          buffers_.consume(bytes_transferred);
          buffers_.prepare(this->check_for_completion(ec, total_transferred_));
          if ((!ec && bytes_transferred == 0)
              || buffers_.begin() == buffers_.end())
            break;
        }

        handler_(ec, static_cast<const std::size_t&>(total_transferred_));
      }
    }
开发者ID:BorisSchaeling,项目名称:asio,代码行数:23,代码来源:read_at.hpp


示例18: completion_handler

 completion_handler(Handler& h)
   : operation(&completion_handler::do_complete),
     handler_(ASIO_MOVE_CAST(Handler)(h))
 {
 }
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:5,代码来源:completion_handler.hpp


示例19: winrt_socket_connect_op

 winrt_socket_connect_op(Handler& handler)
   : winrt_async_op<void>(&winrt_socket_connect_op::do_complete),
     handler_(ASIO_MOVE_CAST(Handler)(handler))
 {
   handler_work<Handler>::start(handler_);
 }
开发者ID:DINKIN,项目名称:mongo,代码行数:6,代码来源:winrt_socket_connect_op.hpp


示例20: basic_handle

 /**
  * This constructor moves a handle from one object to another.
  *
  * @param other The other basic_handle object from which the move will occur.
  *
  * @note Following the move, the moved-from object is in the same state as if
  * constructed using the @c basic_handle(io_service&) constructor.
  */
 basic_handle(basic_handle&& other)
   : basic_io_object<HandleService>(
       ASIO_MOVE_CAST(basic_handle)(other))
 {
 }
开发者ID:dvdjg,项目名称:GoapCpp,代码行数:13,代码来源:basic_handle.hpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ASIO_TEST_CASE函数代码示例发布时间:2022-05-30
下一篇:
C++ ASIO_MOVE_ARG函数代码示例发布时间: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