Realistic 3D camera system
3D camera system components
winrt_resolve_op.hpp
Go to the documentation of this file.
1 //
2 // detail/winrt_resolve_op.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_DETAIL_WINRT_RESOLVE_OP_HPP
12 #define ASIO_DETAIL_WINRT_RESOLVE_OP_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 
20 #if defined(ASIO_WINDOWS_RUNTIME)
21 
29 #include "asio/error.hpp"
30 
32 
33 namespace asio {
34 namespace detail {
35 
36 template <typename Protocol, typename Handler>
37 class winrt_resolve_op :
38  public winrt_async_op<
39  Windows::Foundation::Collections::IVectorView<
40  Windows::Networking::EndpointPair^>^>
41 {
42 public:
43  ASIO_DEFINE_HANDLER_PTR(winrt_resolve_op);
44 
45  typedef typename Protocol::endpoint endpoint_type;
47  typedef asio::ip::basic_resolver_iterator<Protocol> iterator_type;
48 
49  winrt_resolve_op(const query_type& query, Handler& handler)
50  : winrt_async_op<
51  Windows::Foundation::Collections::IVectorView<
52  Windows::Networking::EndpointPair^>^>(
53  &winrt_resolve_op::do_complete),
54  query_(query),
55  handler_(ASIO_MOVE_CAST(Handler)(handler))
56  {
57  }
58 
59  static void do_complete(io_service_impl* owner, operation* base,
60  const asio::error_code&, std::size_t)
61  {
62  // Take ownership of the operation object.
63  winrt_resolve_op* o(static_cast<winrt_resolve_op*>(base));
64  ptr p = { asio::detail::addressof(o->handler_), o, o };
65 
67 
68  iterator_type iterator = iterator_type();
69  if (!o->ec_)
70  {
71  try
72  {
73  iterator = iterator_type::create(
74  o->result_, o->query_.hints(),
75  o->query_.host_name(), o->query_.service_name());
76  }
77  catch (Platform::Exception^ e)
78  {
79  o->ec_ = asio::error_code(e->HResult,
81  }
82  }
83 
84  // Make a copy of the handler so that the memory can be deallocated before
85  // the upcall is made. Even if we're not about to make an upcall, a
86  // sub-object of the handler may be the true owner of the memory associated
87  // with the handler. Consequently, a local copy of the handler is required
88  // to ensure that any owning sub-object remains valid until after we have
89  // deallocated the memory here.
90  detail::binder2<Handler, asio::error_code, iterator_type>
91  handler(o->handler_, o->ec_, iterator);
92  p.h = asio::detail::addressof(handler.handler_);
93  p.reset();
94 
95  // Make the upcall if required.
96  if (owner)
97  {
99  ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
100  asio_handler_invoke_helpers::invoke(handler, handler.handler_);
102  }
103  }
104 
105 private:
106  query_type query_;
107  Handler handler_;
108 };
109 
110 } // namespace detail
111 } // namespace asio
112 
114 
115 #endif // defined(ASIO_WINDOWS_RUNTIME)
116 
117 #endif // ASIO_DETAIL_WINRT_RESOLVE_OP_HPP
#define ASIO_HANDLER_INVOCATION_END
pylon Camera Software Suite for Linux for Use with Basler Gigabit the pylon Viewer and the IP Configurator applications might not be available System I340 and I350 series Although the pylon software will work with any GigE network we would recommend to use one of these adapters USB For U3V devices a USB3 capable USB controller is necessary For best performance and stability we highly recommend a kernel the following settings should be i e
asio::basic_streambuf< Allocator > & b
Definition: read.hpp:702
null_fenced_block fenced_block
class task_io_service io_service_impl
Definition: io_service.hpp:48
void invoke(Function &function, Context &context)
#define ASIO_HANDLER_INVOCATION_BEGIN(args)
Class to represent an error code value.
Definition: error_code.hpp:80
task_io_service_operation operation
Definition: operation.hpp:32
#define ASIO_DEFINE_HANDLER_PTR(op)
#define ASIO_HANDLER_COMPLETION(args)
#define ASIO_MOVE_CAST(type)
Definition: config.hpp:138
ASIO_DECL const error_category & system_category()
Returns the error category used for the system errors produced by asio.
Definition: error_code.ipp:118