PageRenderTime 37ms CodeModel.GetById 33ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/contrib/boost/asio/local/datagram_protocol.hpp

http://pythonocc.googlecode.com/
C++ Header | 80 lines | 38 code | 15 blank | 27 comment | 2 complexity | 98c35ea5e51fb35447876c73c05bcdcd MD5 | raw file
 1//
 2// datagram_protocol.hpp
 3// ~~~~~~~~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2010 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 BOOST_ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP
12#define BOOST_ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/push_options.hpp>
19
20#include <boost/asio/basic_datagram_socket.hpp>
21#include <boost/asio/local/basic_endpoint.hpp>
22#include <boost/asio/detail/socket_types.hpp>
23
24#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) \
25  || defined(GENERATING_DOCUMENTATION)
26
27namespace boost {
28namespace asio {
29namespace local {
30
31/// Encapsulates the flags needed for datagram-oriented UNIX sockets.
32/**
33 * The boost::asio::local::datagram_protocol class contains flags necessary for
34 * datagram-oriented UNIX domain sockets.
35 *
36 * @par Thread Safety
37 * @e Distinct @e objects: Safe.@n
38 * @e Shared @e objects: Safe.
39 *
40 * @par Concepts:
41 * Protocol.
42 */
43class datagram_protocol
44{
45public:
46  /// Obtain an identifier for the type of the protocol.
47  int type() const
48  {
49    return SOCK_DGRAM;
50  }
51
52  /// Obtain an identifier for the protocol.
53  int protocol() const
54  {
55    return 0;
56  }
57
58  /// Obtain an identifier for the protocol family.
59  int family() const
60  {
61    return AF_UNIX;
62  }
63
64  /// The type of a UNIX domain endpoint.
65  typedef basic_endpoint<datagram_protocol> endpoint;
66
67  /// The UNIX domain socket type.
68  typedef basic_datagram_socket<datagram_protocol> socket;
69};
70
71} // namespace local
72} // namespace asio
73} // namespace boost
74
75#endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
76       //   || defined(GENERATING_DOCUMENTATION)
77
78#include <boost/asio/detail/pop_options.hpp>
79
80#endif // BOOST_ASIO_LOCAL_DATAGRAM_PROTOCOL_HPP