Skip to content

April 27, 2024

💤 Sane C++ April 2024#

SC

Here we are with the forth monthly update for Sane C++ Libraries!

📄 Sane C++ Libraries Documentation
💻 Sane C++ Libraries Repository
📹 Sane Coding Youtube channel
💬 Sane Coding Discord

SC::AsyncLoopWork#

Executing background work with notification on event loop

SC::Async has gained the new SC::AsyncLoopWork type, that allows executing blocking work in background thread, with an "after work" notification callback called on the event loop itself. This second notification callback can be used to update GUI or to safely modify some global state without needing mutexes. SC::AsyncLoopWork is a generalization of the system used to execute file operations on thread pool, extending it to any arbitrary blocking operation.

The addition of SC::AsyncLoopWork has been recorded in a video.

Relevant commits:

Coverage and Documentation#

Automation for GitHub CI

GitHub CI scripts are now able to generate test coverage reports and documentation. In line with the spirit of the project, both features have been added to SC::Tools, avoiding any shell scripting or use of other languages. This means that they've been written in C++, using Sane C++ libraries to execute FileSystem operations, spawn processes and SC::Package to download and extract binary dependencies.

  • SC build coverage generates the coverage report using clang source based coverage (and a SVG badge).
  • SC build documentation generates documentation using doxygen.
Both actions are executed in sequence in the same CI job and automatically deployed to GitHub pages.
This means that the entire Documentation Website is now automatically built and deployed on every commit to main!

Relevant commits:

C bindings#

because Sane C++ libraries map to C really well

Most Sane C++ Libraries have been designed to nicely map to a clean C-api.
Time has come to start creating some C bindings, starting with the simplest one: SC::Hashing.
This is the result.
What library do you think should be the next?

Relevant Commits:

SC::Process#

Everyone loves child processes

SC::Process library is getting more complete.
This month it has been gaining ability to:

  • Set child process working directory
  • Set child process environment variables

Both options have been implemented on all supported platforms (windows/macOS/Linux).

Relevant commits:

Improvements to the Library#

Some fixes and minor additions have been delivered too, improving the entire set of libraries.