Added documentation for Address and Protocol concepts.

This commit is contained in:
chris 2004-05-24 23:26:24 +00:00
parent 83dffa3363
commit d4b7057c4e
7 changed files with 130 additions and 4 deletions

View File

@ -31,7 +31,18 @@
namespace asio { namespace asio {
namespace ipv4 { namespace ipv4 {
/// The address class implements IP version 4 style addresses. /// Implements IP version 4 style addresses.
/**
* The asio::ipv4::address class provides the ability to use and manipulate IP
* version 4 addresses.
*
* @par Thread Safety:
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
* @par Concepts:
* Address.
*/
class address class address
{ {
public: public:
@ -41,9 +52,12 @@ public:
/// The default datagram-based protocol associated with the address type. /// The default datagram-based protocol associated with the address type.
typedef udp default_dgram_protocol; typedef udp default_dgram_protocol;
/// The native types of the socket address. These types are dependent on the /// The native type of the address structure. This type is dependent on the
/// underlying implementation of the socket layer. /// underlying implementation of the socket layer.
typedef detail::socket_addr_type native_address_type; typedef detail::socket_addr_type native_address_type;
/// The native type for the size of the address structure. This type is
/// dependent on the underlying implementation of the socket layer.
typedef detail::socket_addr_len_type native_size_type; typedef detail::socket_addr_len_type native_size_type;
/// Underlying types for internet addresses. /// Underlying types for internet addresses.

View File

@ -23,7 +23,17 @@
namespace asio { namespace asio {
namespace ipv4 { namespace ipv4 {
/// The tcp class contains the flags necessary to use TCP sockets. /// Encapsulates the flags needed for TCP.
/**
* The asio::ipv4::tcp class contains the flags necessary to use TCP sockets.
*
* @par Thread Safety:
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Safe.
*
* @par Concepts:
* Protocol.
*/
class tcp class tcp
{ {
public: public:

View File

@ -22,7 +22,17 @@
namespace asio { namespace asio {
namespace ipv4 { namespace ipv4 {
/// The udp class contains the flags necessary to use UDP sockets. /// Encapsulates the flags needed for UDP.
/**
* The asio::ipv4::udp class contains the flags necessary to use UDP sockets.
*
* @par Thread Safety:
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Safe.
*
* @par Concepts:
* Protocol.
*/
class udp class udp
{ {
public: public:

View File

@ -23,10 +23,12 @@ EXTRA_DIST = \
asio.css \ asio.css \
asio_dox.txt \ asio_dox.txt \
release_checklist.htm \ release_checklist.htm \
concepts/Address.hpp \
concepts/Async_Object.hpp \ concepts/Async_Object.hpp \
concepts/Async_Recv_Stream.hpp \ concepts/Async_Recv_Stream.hpp \
concepts/Async_Send_Stream.hpp \ concepts/Async_Send_Stream.hpp \
concepts/Dispatcher.hpp \ concepts/Dispatcher.hpp \
concepts/Protocol.hpp \
concepts/Stream.hpp \ concepts/Stream.hpp \
concepts/Sync_Recv_Stream.hpp \ concepts/Sync_Recv_Stream.hpp \
concepts/Sync_Send_Stream.hpp \ concepts/Sync_Send_Stream.hpp \

View File

@ -97,10 +97,12 @@ documentation</a> for more information on how to use <tt>boost::bind</tt>.
<H2>Concepts</H2> <H2>Concepts</H2>
\li Address
\li Async_Object \li Async_Object
\li Async_Recv_Stream \li Async_Recv_Stream
\li Async_Send_Stream \li Async_Send_Stream
\li Dispatcher \li Dispatcher
\li Protocol
\li Stream \li Stream
\li Sync_Recv_Stream \li Sync_Recv_Stream
\li Sync_Send_Stream \li Sync_Send_Stream

View File

@ -0,0 +1,56 @@
//
// address.hpp
// ~~~~~~~~~~~
//
// Copyright (c) 2003, 2004 Christopher M. Kohlhoff (chris@kohlhoff.com)
//
// Permission to use, copy, modify, distribute and sell this software and its
// documentation for any purpose is hereby granted without fee, provided that
// the above copyright notice appears in all copies and that both the copyright
// notice and this permission notice appear in supporting documentation. This
// software is provided "as is" without express or implied warranty, and with
// no claim as to its suitability for any purpose.
//
/// Address concept.
/**
* @par Implemented By:
* asio::ipv4::address
*/
class Address
{
public:
/// The default stream-based protocol associated with the address type. This
/// typedef is not required if the address family does not support any stream
/// protocols.
typedef implementation_defined default_stream_protocol;
/// The default datagram-based protocol associated with the address type.
/// This typedef is not required if the address family does not support any
/// datagram protocols.
typedef implementation_defined default_dgram_protocol;
/// The native type of the address structure. This type is dependent on the
/// underlying implementation of the socket layer.
typedef implementation_defined native_address_type;
/// The native type for the size of the address structure. This type is
/// dependent on the underlying implementation of the socket layer.
typedef implementation_defined native_size_type;
/// The address family.
int family() const;
/// Get the underlying address in the native type. The returned object may be
/// modified by the caller.
native_address_type* native_address();
/// Get the underlying address in the native type.
const native_address_type* native_address() const;
/// Get the underlying size of the address in the native type.
native_size_type native_size() const;
/// Set the underlying size of the address in the native type.
void native_size(native_size_type size);
};

View File

@ -0,0 +1,32 @@
//
// Protocol.hpp
// ~~~~~~~~~~~~
//
// Copyright (c) 2003, 2004 Christopher M. Kohlhoff (chris@kohlhoff.com)
//
// Permission to use, copy, modify, distribute and sell this software and its
// documentation for any purpose is hereby granted without fee, provided that
// the above copyright notice appears in all copies and that both the copyright
// notice and this permission notice appear in supporting documentation. This
// software is provided "as is" without express or implied warranty, and with
// no claim as to its suitability for any purpose.
//
/// Protocol concept.
/**
* @par Implemented By:
* asio::ipv4::tcp @n
* asio::ipv4::udp
*/
class Protocol
{
public:
/// Obtain an identifier for the type of the protocol.
int type() const;
/// Obtain an identifier for the protocol.
int protocol() const;
/// Obtain an identifier for the protocol family.
int family() const;
};