Documentation fixes.

This commit is contained in:
Christopher Kohlhoff 2014-10-03 11:35:55 +10:00
parent d23fb485b2
commit 97fed1de7f
14 changed files with 97 additions and 21 deletions

View File

@ -127,9 +127,6 @@ class basic_waitable_timer
: public basic_io_object<WaitableTimerService>
{
public:
/// The executor type.
typedef asio::io_service::executor_type executor_type;
/// The clock type.
typedef Clock clock_type;

View File

@ -209,7 +209,7 @@ public:
* given service type. If there is no existing implementation of the service,
* then the io_service will create a new instance of the service.
*
* @param e The io_service object that owns the service.
* @param i The io_service object that owns the service.
*
* @return The service interface implementing the specified service type.
* Ownership of the service interface is not transferred to the caller.

View File

@ -139,6 +139,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename ReadHandler, typename Allocator>
struct associated_allocator<
detail::buffered_fill_handler<ReadHandler>, Allocator>
@ -165,6 +167,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename Stream>
template <typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,
@ -322,6 +326,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename MutableBufferSequence,
typename ReadHandler, typename Allocator>
struct associated_allocator<
@ -356,6 +362,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename Stream>
template <typename MutableBufferSequence, typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,

View File

@ -125,6 +125,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename WriteHandler, typename Allocator>
struct associated_allocator<
detail::buffered_flush_handler<WriteHandler>, Allocator>
@ -151,6 +153,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename Stream>
template <typename WriteHandler>
ASIO_INITFN_RESULT_TYPE(WriteHandler,
@ -308,6 +312,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename ConstBufferSequence,
typename WriteHandler, typename Allocator>
struct associated_allocator<
@ -342,6 +348,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename Stream>
template <typename ConstBufferSequence, typename WriteHandler>
ASIO_INITFN_RESULT_TYPE(WriteHandler,

View File

@ -322,6 +322,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename Protocol, typename SocketService,
typename Iterator, typename ConnectCondition,
typename ComposedConnectHandler, typename Allocator>
@ -364,6 +366,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename Protocol, typename SocketService,
typename Iterator, typename ComposedConnectHandler>
inline ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,

View File

@ -516,6 +516,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
@ -552,6 +554,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
@ -730,6 +734,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename CompletionCondition, typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -766,6 +772,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,

View File

@ -565,6 +565,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
@ -601,6 +603,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
@ -786,6 +790,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -822,6 +828,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,

View File

@ -493,6 +493,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -527,6 +529,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
@ -729,6 +733,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -765,6 +771,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
@ -976,6 +984,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename RegEx, typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -1010,6 +1020,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
@ -1217,6 +1229,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename MatchCondition, typename ReadHandler, typename Allocator1>
struct associated_allocator<
@ -1253,6 +1267,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncReadStream, typename Allocator,
typename MatchCondition, typename ReadHandler>
ASIO_INITFN_RESULT_TYPE(ReadHandler,

View File

@ -224,6 +224,8 @@ private:
asio::error_code ec_;
};
#if !defined(GENERATING_DOCUMENTATION)
template <typename Handler, typename T, typename Allocator>
struct associated_allocator<detail::coro_handler<Handler, T>, Allocator>
{
@ -248,6 +250,8 @@ struct associated_executor<detail::coro_handler<Handler, T>, Executor>
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
namespace detail {
template <typename Handler, typename Function>

View File

@ -579,6 +579,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition, typename WriteHandler, typename Allocator>
struct associated_allocator<
@ -615,6 +617,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition, typename WriteHandler>
inline ASIO_INITFN_RESULT_TYPE(WriteHandler,
@ -744,6 +748,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename Allocator, typename WriteHandler, typename Allocator1>
struct associated_allocator<
detail::write_streambuf_handler<Allocator, WriteHandler>,
@ -774,6 +780,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncWriteStream, typename Allocator,
typename CompletionCondition, typename WriteHandler>
inline ASIO_INITFN_RESULT_TYPE(WriteHandler,

View File

@ -627,6 +627,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition, typename WriteHandler, typename Allocator>
struct associated_allocator<
@ -663,6 +665,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
typename CompletionCondition, typename WriteHandler>
inline ASIO_INITFN_RESULT_TYPE(WriteHandler,
@ -803,6 +807,8 @@ namespace detail
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename Allocator, typename WriteHandler, typename Allocator1>
struct associated_allocator<
detail::write_at_streambuf_op<Allocator, WriteHandler>,
@ -833,6 +839,8 @@ struct associated_executor<
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
typename CompletionCondition, typename WriteHandler>
inline ASIO_INITFN_RESULT_TYPE(WriteHandler,

View File

@ -378,8 +378,12 @@ public:
return static_cast<const Executor&>(*this);
}
#if defined(ASIO_HAS_VARIADIC_TEMPLATES) \
|| defined(GENERATING_DOCUMENTATION)
#if defined(GENERATING_DOCUMENTATION)
template <typename... Args> auto operator()(Args&& ...);
template <typename... Args> auto operator()(Args&& ...) const;
#elif defined(ASIO_HAS_VARIADIC_TEMPLATES)
/// Forwarding function call operator.
template <typename... Args>
@ -398,7 +402,6 @@ public:
}
#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
// || defined(GENERATING_DOCUMENTATION)
typename detail::executor_wrapper_result_of0<T>::type operator()()
{
@ -429,7 +432,6 @@ public:
#undef ASIO_PRIVATE_WRAP_CALL_DEF
#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
// || defined(GENERATING_DOCUMENTATION)
private:
typedef detail::executor_wrapper_base<T, Executor,

View File

@ -1425,6 +1425,9 @@
<xsl:when test="declname = 'Arg'">
<xsl:value-of select="declname"/>
</xsl:when>
<xsl:when test="declname = 'Args'">
<xsl:value-of select="declname"/>
</xsl:when>
<xsl:when test="declname = 'BufferSequence'">
<xsl:value-of select="declname"/>
</xsl:when>

View File

@ -292,8 +292,8 @@ Return to \ref tuttimer4
/**
\page tuttimer5 Timer.5 - Synchronising handlers in multithreaded programs
This tutorial demonstrates the use of the asio::strand class to synchronise
callback handlers in a multithreaded program.
This tutorial demonstrates the use of the asio::io_service::strand class to
synchronise callback handlers in a multithreaded program.
The previous four tutorials avoided the issue of handler synchronisation by
calling the asio::io_service::run() function from one thread only. As you
@ -329,22 +329,24 @@ tutorial by running two timers in parallel.
In addition to initialising a pair of asio::deadline_timer members, the
constructor initialises the <tt>strand_</tt> member, an object of type
asio::strand.
asio::io_service::strand.
An asio::strand guarantees that, for those handlers that are dispatched through
it, an executing handler will be allowed to complete before the next one is
started. This is guaranteed irrespective of the number of threads that are
calling asio::io_service::run(). Of course, the handlers may still execute
concurrently with other handlers that were <b>not</b> dispatched through an
asio::strand, or were dispatched through a different asio::strand object.
An asio::io_service::strand guarantees that, for those handlers that are
dispatched through it, an executing handler will be allowed to complete before
the next one is started. This is guaranteed irrespective of the number of
threads that are calling asio::io_service::run(). Of course, the handlers may
still execute concurrently with other handlers that were <b>not</b> dispatched
through an asio::io_service::strand, or were dispatched through a different
asio::io_service::strand object.
\until {
When initiating the asynchronous operations, each callback handler is "wrapped"
using the asio::strand object. The asio::strand::wrap() function returns a new
handler that automatically dispatches its contained handler through the
asio::strand object. By wrapping the handlers using the same asio::strand, we
are ensuring that they cannot execute concurrently.
using the asio::io_service::strand object. The asio::io_service::strand::wrap()
function returns a new handler that automatically dispatches its contained
handler through the asio::io_service::strand object. By wrapping the handlers
using the same asio::io_service::strand, we are ensuring that they cannot
execute concurrently.
\until }
\until }