cancel: Add utility for always running callback

This makes it possible to have a guaranteed callback, where an uncalled
callback will be called with a set of default parameters upon
destruction if it was not called at least once.

Change-Id: Id5b499e645adc9e23bf03158f10710f281bd7fd3
Signed-off-by: William A. Kennington III <wak@google.com>
2 files changed
tree: 0cca59785aa6983f8fd666643f0b729f8e4c1fde
  1. example/
  2. src/
  3. subprojects/
  4. test/
  5. .clang-format
  6. .clang-ignore
  7. .gitignore
  8. .lcovrc
  9. LICENSE
  10. MAINTAINERS
  11. meson.build
  12. meson_options.txt
  13. README.md
README.md

stdplus

stdplus is a c++ project containing commonly used classes and functions for the Linux platform. Note the goals of this project are to implement only the minimum set of features needed by the OpenBMC project and other users. You may find the included set of functions currently quite sparse.

This project provides the following primitives:

  • A movable and copyable RAII helper wrapper which is used for wrapping c-native types that have custom destruction or copy reference logic.
  • Functions for trivially configuring signals without having to do the normal signal set operations from libc
  • C-Style Error Handler that wrap c-style functions which return errnos and negative error values into functions that throw c++ exceptions.
  • String Utilities that focus on providing helpful wrappers like efficient string append and concatenation.

Dependencies

Test cases require google{test,mock}, valgrind, and lcov. It also requires the Meson Build System which can be installed following the instructions at mesonbuild.com.

Building

For a standard release build, you want something like:

meson setup -Dexamples=false -Dtests=disabled builddir
ninja -C builddir
ninja -C builddir install

For a test / debug build, a typical configuration is

meson setup -Dtests=enabled builddir
meson test -C builddir