mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 00:02:34 +01:00
ircd::ios: Structure documentation briefs. [ci skip]
This commit is contained in:
parent
a30f06d80b
commit
705c1cc776
2 changed files with 12 additions and 0 deletions
|
@ -19,6 +19,9 @@ namespace ircd::ios
|
|||
const string_view &name(const descriptor &);
|
||||
}
|
||||
|
||||
/// Each descriptor classifies and quantifies our operations through asio.
|
||||
/// Instances are usually static; all callback handlers are wrapped with an
|
||||
/// ios::handle and associated with an ios::descriptor instance.
|
||||
struct ircd::ios::descriptor
|
||||
:instance_list<descriptor>
|
||||
{
|
||||
|
@ -48,6 +51,7 @@ struct ircd::ios::descriptor
|
|||
~descriptor() noexcept;
|
||||
};
|
||||
|
||||
/// Statistics for the descriptor.
|
||||
struct ircd::ios::descriptor::stats
|
||||
{
|
||||
using value_type = uint64_t;
|
||||
|
|
|
@ -21,6 +21,8 @@ namespace ircd::ios
|
|||
const string_view &name(const handler &);
|
||||
}
|
||||
|
||||
/// Non-template base class for ios::handle; templated derivations of this
|
||||
/// class comprise the function object we're submitting to boost::asio.
|
||||
struct ircd::ios::handler
|
||||
{
|
||||
static thread_local handler *current;
|
||||
|
@ -38,6 +40,9 @@ struct ircd::ios::handler
|
|||
uint64_t ts {0}; // last tsc sample; for profiling each phase
|
||||
};
|
||||
|
||||
/// Our function object type template. These should be rvalue-constructed in a
|
||||
/// callback argument to a boost::asio call. A reference to an ios::descriptor
|
||||
/// must be provided.
|
||||
template<class function>
|
||||
struct ircd::ios::handle
|
||||
:handler
|
||||
|
@ -54,6 +59,9 @@ struct ircd::ios::handle
|
|||
// ircd::ios::handle
|
||||
//
|
||||
|
||||
/// Construction of the handle is considered the enquement. Construct in the
|
||||
/// callback argument to a boost::asio call; provide a reference to the
|
||||
/// appropriate callsite descriptor.
|
||||
template<class function>
|
||||
inline
|
||||
ircd::ios::handle<function>::handle(ios::descriptor &d,
|
||||
|
|
Loading…
Reference in a new issue