core::testing::CrossProcessSync Class Reference

A cross-process synchronization primitive that supports simple wait-condition-like scenarios. More...

`#include <cross_process_sync.h>`

Collaboration diagram for core::testing::CrossProcessSync:

## Classes

struct | Error

## Public Member Functions

| CrossProcessSync ()
| Constructs a new sync element.
| CrossProcessSync (const CrossProcessSync &rhs)
| Copy c'tor, duping the underlying fds.
| ~CrossProcessSync () noexcept
| Closes the underlying fds.
CrossProcessSync & | operator= (const CrossProcessSync &rhs)
| operator =, dup's the underlying fds.
void | try_signal_ready_for (const std::chrono::milliseconds &duration)
| Try to signal the other side that we are ready for at most duration milliseconds.
std::uint32_t | wait_for_signal_ready_for (const std::chrono::milliseconds &duration)
| Wait for the other sides to signal readiness for at most duration milliseconds.

## Detailed Description

A cross-process synchronization primitive that supports simple wait-condition-like scenarios.

Definition at line 36 of file cross_process_sync.h.

## Constructor & Destructor Documentation

## CrossProcessSync() [1/2]

core::testing::CrossProcessSync::CrossProcessSync | ( |  | ) |

Constructs a new sync element.

Definition at line 32 of file cross_process_sync.cpp.

## CrossProcessSync() [2/2]

core::testing::CrossProcessSync::CrossProcessSync | ( | const CrossProcessSync & | rhs | ) |

Copy c'tor, duping the underlying fds.

Parameters

  rhs | The instance to copy.

Definition at line 38 of file cross_process_sync.cpp.

## ~CrossProcessSync()

core::testing::CrossProcessSync::~CrossProcessSync | ( |  | ) |

noexcept

Closes the underlying fds.

Definition at line 44 of file cross_process_sync.cpp.

## Member Function Documentation

## operator=()

core::testing::CrossProcessSync & core::testing::CrossProcessSync::operator= | ( | const CrossProcessSync & | rhs | ) |

operator =, dup's the underlying fds.

Parameters

  rhs | The instance to assign from.

Returns
  A mutable reference to this instance.

Definition at line 50 of file cross_process_sync.cpp.

## try_signal_ready_for()

void core::testing::CrossProcessSync::try_signal_ready_for | ( | const std::chrono::milliseconds & | duration | ) |

Try to signal the other side that we are ready for at most duration milliseconds.

Exceptions

  Error::Timeout | in case of a timeout.
  std::system_error | for problems with the underlying pipe.

Definition at line 62 of file cross_process_sync.cpp.

Referenced by TEST().

## wait_for_signal_ready_for()

std::uint32_t core::testing::CrossProcessSync::wait_for_signal_ready_for | ( | const std::chrono::milliseconds & | duration | ) |

Wait for the other sides to signal readiness for at most duration milliseconds.

Returns
  The number of ready signals that have been collected since creation.

Exceptions

  Error::Timeout | in case of a timeout.
  std::system_error | for problems with the underlying pipe.

Definition at line 78 of file cross_process_sync.cpp.

Referenced by TEST(), and TEST().

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

- cross_process_sync.h
- cross_process_sync.cpp