Flow-IPC 3.0.0
Flow-IPC project: Public API.
Classes | Functions
ipc::transport::stat Namespace Reference

Stats-related sub-namespace, for ADL segregation and general organization. More...

Classes

struct  Blob_rcv_stats
 Cumulative stats from the incoming-direction (receive) pipe of a Blob_receiver or Native_handle_receiver concept implementation. More...
 
struct  Blob_snd_stats
 Cumulative stats from the outgoing-direction (send) pipe of a Blob_sender or Native_handle_sender concept implementation. More...
 

Functions

const Blob_snd_stats & blob_snd_stats (const Blob_snd_stats &stats)
 Maps a stats struct type to its core Blob_snd_stats; identity for Blob_snd_stats itself. More...
 
const Blob_rcv_stats & blob_rcv_stats (const Blob_rcv_stats &stats)
 Maps a stats struct type to its core Blob_rcv_stats; identity for Blob_rcv_stats itself. More...
 
template<typename Visitor >
void declare_stats (const flow::util::stat::Stat_name &name_prefix, const Blob_snd_stats *src_stats, Blob_snd_stats *target_stats, Visitor &&visitor)
 Declares the stats for Blob_snd_stats. More...
 
template<typename Stats_t >
Blob_snd_stats & blob_snd_stats_mutable (Stats_t &stats)
 Non-const wrapper around blob_snd_stats(). More...
 
template<typename Visitor >
void declare_stats (const flow::util::stat::Stat_name &name_prefix, const Blob_rcv_stats *src_stats, Blob_rcv_stats *target_stats, Visitor &&visitor)
 Declares the stats for Blob_rcv_stats. More...
 
template<typename Stats_t >
Blob_rcv_stats & blob_rcv_stats_mutable (Stats_t &stats)
 Non-const wrapper around blob_rcv_stats(). More...
 

Detailed Description

Stats-related sub-namespace, for ADL segregation and general organization.

Function Documentation

◆ blob_rcv_stats()

const Blob_rcv_stats & ipc::transport::stat::blob_rcv_stats ( const Blob_rcv_stats &  stats)

Maps a stats struct type to its core Blob_rcv_stats; identity for Blob_rcv_stats itself.

See Blob_receiver::Blob_rcv_stats and Native_handle_receiver::Native_handle_rcv_stats concept doc headers for context. Both concepts require this same function (the core receive-stats type is shared).

Generic use with proper ADL (let Cool_receiver be a Blob_receiver or Native_handle_receiver impl instance).

Cool_receiver::Blob_rcv_stats total_stats = ...;
const auto& core_stats = blob_rcv_stats(total_stats);
// core_stats has type Blob_rcv_stats.
// If Cool_receiver::Blob_rcv_stats is Blob_rcv_stats, then the present free function was invoked.
// Otherwise an actual mapping function in `Cool_receiver`s namespace was invoked via ADL.
const Blob_rcv_stats & blob_rcv_stats(const Blob_rcv_stats &stats)
Maps a stats struct type to its core Blob_rcv_stats; identity for Blob_rcv_stats itself.
Definition: blob_transport_stats.cpp:67
Parameters
statsThing.
Returns
stats.

◆ blob_rcv_stats_mutable()

template<typename Stats_t >
Blob_rcv_stats & ipc::transport::stat::blob_rcv_stats_mutable ( Stats_t &  stats)

Non-const wrapper around blob_rcv_stats().

Safe because the input is non-const, so the const_cast merely undoes the const added by delegating to the const overload.

Template Parameters
Stats_tBlob_rcv_stats, or an extended stats type with a blob_rcv_stats(const Stats_t&) ADL overload.
Parameters
statsStats to map.
Returns
See blob_rcv_stats(); but non-const.

◆ blob_snd_stats()

const Blob_snd_stats & ipc::transport::stat::blob_snd_stats ( const Blob_snd_stats &  stats)

Maps a stats struct type to its core Blob_snd_stats; identity for Blob_snd_stats itself.

See Blob_sender::Blob_snd_stats and Native_handle_sender::Native_handle_snd_stats concept doc headers for context. Both concepts require this same function (the core send-stats type is shared).

Generic use with proper ADL (let Cool_sender be a Blob_sender or Native_handle_sender impl instance).

Cool_sender::Blob_snd_stats total_stats = ...;
const auto& core_stats = blob_snd_stats(total_stats);
// core_stats has type Blob_snd_stats.
// If Cool_sender::Blob_snd_stats is Blob_snd_stats, then the present free function was invoked.
// Otherwise an actual mapping function in `Cool_sender`s namespace was invoked via ADL.
const Blob_snd_stats & blob_snd_stats(const Blob_snd_stats &stats)
Maps a stats struct type to its core Blob_snd_stats; identity for Blob_snd_stats itself.
Definition: blob_transport_stats.cpp:56
Parameters
statsThing.
Returns
stats.

◆ blob_snd_stats_mutable()

template<typename Stats_t >
Blob_snd_stats & ipc::transport::stat::blob_snd_stats_mutable ( Stats_t &  stats)

Non-const wrapper around blob_snd_stats().

Safe because the input is non-const, so the const_cast merely undoes the const added by delegating to the const overload.

Template Parameters
Stats_tBlob_snd_stats, or an extended stats type with a blob_snd_stats(const Stats_t&) ADL overload.
Parameters
statsStats to map.
Returns
See blob_snd_stats(); but non-const.

◆ declare_stats() [1/2]

template<typename Visitor >
void ipc::transport::stat::declare_stats ( const flow::util::stat::Stat_name &  name_prefix,
const Blob_rcv_stats *  src_stats,
Blob_rcv_stats *  target_stats,
Visitor &&  visitor 
)

Declares the stats for Blob_rcv_stats.

Not invoked directly except by flow::util::stat internals, or when composing this stat-set into another.

See also
flow::util::stat namespace doc header for background on the declare/visit mechanism.
Template Parameters
VisitorSee above.
Parameters
name_prefixSee above.
src_statsSee above.
target_statsSee above.
visitorSee above.

◆ declare_stats() [2/2]

template<typename Visitor >
void ipc::transport::stat::declare_stats ( const flow::util::stat::Stat_name &  name_prefix,
const Blob_snd_stats *  src_stats,
Blob_snd_stats *  target_stats,
Visitor &&  visitor 
)

Declares the stats for Blob_snd_stats.

Not invoked directly except by flow::util::stat internals, or when composing this stat-set into another.

See also
flow::util::stat namespace doc header for background on the declare/visit mechanism.
Template Parameters
VisitorSee above.
Parameters
name_prefixSee above.
src_statsSee above.
target_statsSee above.
visitorSee above.