morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::testing::OwnerProbeRecorder Class Reference

Records every owner check a loop-owned body makes while this object is alive (morph::exec::detail::noteOwner), and what the calling thread's executor scope said at that moment. More...

#include <owner_probe_recorder.hpp>

Classes

struct  Seen
 One owner check. More...

Public Member Functions

 OwnerProbeRecorder (::core::async::IExecutor const &expected)
 Installs this recorder as the process's owner probe.
 ~OwnerProbeRecorder ()
 Uninstalls the probe, then waits for every thread still inside record().
 OwnerProbeRecorder (const OwnerProbeRecorder &)=delete
OwnerProbeRecorder & operator= (const OwnerProbeRecorder &)=delete
 OwnerProbeRecorder (OwnerProbeRecorder &&)=delete
OwnerProbeRecorder & operator= (OwnerProbeRecorder &&)=delete
std::vector< Seen > at (std::string_view site) const
 The checks made at one site.
std::size_t count (std::string_view site) const
 How many checks were made at one site.
bool allPosted (std::string_view site) const
 Whether every check at one site ran posted to the expected owner.

Detailed Description

Records every owner check a loop-owned body makes while this object is alive (morph::exec::detail::noteOwner), and what the calling thread's executor scope said at that moment.

What a posted-call test reads: a verb called from a thread that is not the loop, whose body then shows up here with onOwner == true, was posted. A body run inline on the caller's thread shows up with onOwner == false. The scope is read here, by the test, not taken from the component.

Definition at line 31 of file owner_probe_recorder.hpp.

Constructor & Destructor Documentation

◆ OwnerProbeRecorder()

morph::testing::OwnerProbeRecorder::OwnerProbeRecorder ( ::core::async::IExecutor const & expected)
inlineexplicit

Installs this recorder as the process's owner probe.

Parameters
expectedThe owner every check is expected to name: the IoLoop's loop.

Definition at line 46 of file owner_probe_recorder.hpp.

◆ ~OwnerProbeRecorder()

morph::testing::OwnerProbeRecorder::~OwnerProbeRecorder ( )
inline

Uninstalls the probe, then waits for every thread still inside record().

Definition at line 52 of file owner_probe_recorder.hpp.

Member Function Documentation

◆ at()

std::vector< Seen > morph::testing::OwnerProbeRecorder::at ( std::string_view site) const
inlinenodiscard

The checks made at one site.

Parameters
siteThe site name.
Returns
Every check made at site so far.

Definition at line 71 of file owner_probe_recorder.hpp.

◆ count()

std::size_t morph::testing::OwnerProbeRecorder::count ( std::string_view site) const
inlinenodiscard

How many checks were made at one site.

Parameters
siteThe site name.
Returns
How many checks were made at site.

Definition at line 85 of file owner_probe_recorder.hpp.

◆ allPosted()

bool morph::testing::OwnerProbeRecorder::allPosted ( std::string_view site) const
inlinenodiscard

Whether every check at one site ran posted to the expected owner.

Parameters
siteThe site name.
Returns
Whether at least one check was made at site, and every one of them ran inside a task of the expected owner.

Definition at line 91 of file owner_probe_recorder.hpp.


The documentation for this class was generated from the following file: