process-cpp: core::testing::CrossProcessSync Class Reference

process-cpp 3.0.0 A simple convenience library for handling processes in C++11.

Classes | Public Member Functions | List of all members
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. More...
| CrossProcessSync (const CrossProcessSync &rhs)
| Copy c'tor, duping the underlying fds. More...
| ~CrossProcessSync () noexcept
| Closes the underlying fds. More...
CrossProcessSync & | operator= (const CrossProcessSync &rhs)
| operator =, dup's the underlying fds. More...
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. More...
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. More...

## 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().

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

- /build/process-cpp/src/process-cpp-3.0.1/include/core/testing/cross_process_sync.h
- /build/process-cpp/src/process-cpp-3.0.1/src/core/testing/cross_process_sync.cpp