ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
Overview

Abstract

The ALib C++ Framework provides industrial-strength infrastructure components for modern C++20 applications, including logging, formatting, memory management, configuration systems, expression parsing, and diagnostics.
Its mission is to provide reusable infrastructure, diagnostics, utilities, and development patterns relevant to modern C++ applications.

ALib is modular and subsets of the available modules can be selectively included in custom builds of the framework.

Why ALib?

ALib was created as an alternative to assembling large C++ projects from dozens of disconnected micro-libraries. It is a cohesive infrastructure layer for C++20 applications.

The focus is:

  • high runtime efficiency
  • low allocation overhead
  • modular integration (choose what you need)
  • cross-platform consistency
  • deep debug capabilities

ALib combines capabilities typically spread across libraries such as spdlog, fmt, Boost, CLI11, magic_enum, Abseil, folly, exprtk, and dedicated diagnostics, configuration, allocator, and utility frameworks. For many C++20 applications, ALib might be the better-integrated alternative.

ALib is particularly suited for:

  • small and large native C++ applications
  • tools and infrastructure software
  • performance-sensitive systems
  • long-lived enterprise codebases
  • diagnostic-heavy development environments

New In this Version

Introduced the new module ALib App which aggregates several features of lower-level modules and orchestrates bootstrapping. With this addition, we felt it was appropriate to rename ALib from a "class library" to a "framework". Furthermore the optional C++20-Module compilation is back. Nevertheless, it is only supported on GNU/Linux platform with the newest Clang compiler version. We are waiting for GCC to relax its currently restrictive interpretation of the standard.

In addition to many smaller improvements, we added an external resource format definition and introduced a corresponding resource compiler that writes C++ code.

All details of changes are provided in the Changelog.

A Quick Sample

#include "ALib.Bootstrap.H"
int main( int, const char ** ) {
alib::Compiler compiler;
compiler.SetupDefaults();
alib::Expression expression = compiler.Compile( "40+2 * 3-4" );
Log_Info( "Input: {!Q}", expression->GetOriginalString() )
Log_Info( "Normalized: {!Q}", expression->GetNormalizedString() )
Log_Info( "Optimized: {!Q}", expression->GetOptimizedString() )
alib::expressions::Scope scope( compiler.CfgFormatter );
Log_Info( "Result: " , expression->Evaluate( scope ) )
alib::Shutdown();
return 0;
}
#define Log_Info(...)
virtual Expression Compile(const String &expressionString)
Definition compiler.cpp:200
Definition alox.cpp:14
void Bootstrap(BootstrapPhases targetPhase, camp::Camp *targetCamp, int alibVersion, int alibRevision, TCompilationFlags compilationFlags)
expressions::Compiler Compiler
Type alias in namespace #"%alib".
Definition compiler.hpp:535
expressions::Expression Expression
Type alias in namespace #"%alib".

Produces the following output:

sample.cpp:13: main [0.000 +--- ][PROCESS][/] #002: Input: "40+2 * 3-4"
sample.cpp:14: main [0.000 +--- ][PROCESS][/] #003: Normalized: "40 + (2 * 3) - 4"
sample.cpp:15: main [0.000 +--- ][PROCESS][/] #004: Optimized: "42"
sample.cpp:18: main [0.000 +--- ][PROCESS][/] #005: Result: 42

This small example already demonstrates several core ALib capabilities:

  • bootstrapping and lifecycle management
  • expression parsing (extensible with custom functions and context variables)
  • logging
  • formatting
  • boxing (much more than std::any provides)
  • type erasure
  • runtime diagnostics

Some highlights of the functionality:

  • ALib Strings: String types with interfaces similar to Java/C#, compatible with anything that "smells" like a string. (Technically achieved using C++20 concepts).
  • ALib Boxing: Consider this "std::any on steroids".
  • ALib EnumOps and ALib EnumRecords: Finally, we get what we expected from C++ enums.
  • ALib Monomem: Monotonic allocation with recycling. Why use the oh-so-slow heap?
  • ALox: High-performance logging with deep diagnostics support.
  • ALib App: Applications with a well-structured execution design and command-line parsing.
  • ALib BitBuffer: Write bit-streams instead of human-readable text.
  • ALib Expressions: Type-safe runtime expression compiler. Easily extensible to support your custom expression functions. 130+ (optional) predefined functions (math, string compare, date/time, etc.)
  • ALib Variables: Runtime variables for C++. Its priority-management allows hard-coding defaults and having them be overridden by configuration files, environment-variables or command-line parameters.
  • ALib FileTree: A directory and file scanner (with runtime expression support)
  • ALib Format: Formatting of strings with Python-like and alternatively Java-like syntax.
  • ALib Threads: Thread diagnostics and deadlock detection.
  • ALib ThreadModel: A dynamic thread-pool implementation, dedicated worker threads with prioritized job-management, and periodic event triggering.
  • And last but not least: Many more tools like managing bootstrapping of C++ software, externalized resources, configuration data, singletons with Windows DLLs, ...

IDE / Build System Setup

The current version was tested on the following platform combinations:

  • GNU/Linux Arch 7.0.5, Clang++ 21.1.5, C++20/23, 32-Bit / 64-Bit
    (This is the main development platform.)
  • GNU/Linux Arch 7.0.5, GNU C++ 16.1.1, C++20/23, 32-Bit / 64-Bit
  • WindowsOS 11, MSC 19.51 (Visual Studio 2026 Insiders), C++20, 32-Bit/64-Bit
  • WindowsOS 11, MinGW, 64-Bit, GCC 13.47, C++20
  • macOS Tahoe 26.4.1, Apple M2 / ARM64, Apple Clang Version 21.0.0, C++20/23, 64-Bit
  • Raspberry 3, aarch64, Cortex-A53, GNU C++ 12.2.0, C++20/23
  • Raspberry 4, aarch64, Cortex-A72, GNU C++ 14.2.0, C++20/23
  • Raspberry 4, armhf (32-bit), Cortex-A72, GNU C++ 12.2.0, C++20/23

The Programmer's Manual contains an extensive chapter about how to compile and use ALib in your C++ environment.

Documentation

The following documentation is provided:

  1. A General Framework Manual is available describing ALib's structure, its compilation, bootstrapping, etc.
  2. Separated Programmer's Manuals are provided. One dedicated manual is provided for each ALib Module.

    The manuals are well-structured, provide step-by-step source code tutorials and sometimes go into in-depth discussion in respect to design decisions and overall rationales behind important features of the ALib Modules.

  3. Reference Documentation,annotated.html covering 100% of the provided types, members, functions, namespaces, macros, etc. In short, each and every C++ entity is documented.
  4. A detailed version history, documenting every interface change is found in the Change Log.
  5. All documentation provided leverages the full power of Doxygen (the industry standard).

    Therefore, changes in the library's interfaces are always detected and corrected. Most code samples are implemented as unit tests and thus are tested when compiling the documentation. This is also mostly true for the output text of the code samples. (See an example here).

Summary: ALib comes with a complete book of documentation, which has more than 1000 pages** if it was printed. It is all explained, for beginners and experts!

License

ALib is free software and can be downloaded at Github.

Starting with version 2605, ALib is licensed under the MIT License:

MIT License

Copyright (c) 2013-2026 A-Worx GmbH, Germany

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

The change from the Boost Software License 1.0 to the MIT License is intended to simplify future integration of third-party MIT-licensed components and adaptations within ALib.

Previous releases remain available under the Boost Software License 1.0.

Main Characteristics And Design Goals

  • ALib is free software.
  • Compiles with standards C++20 and 23.
  • Modularization: Possible selective use and compilation of the Framework.
  • Extensive documentation.
  • Least intrusive: Designed to keep user code independent of ALib types and idioms when possible.
  • Ease of use by design. When things become complex, features are hidden behind default behavior and are only available to users who investigate deeper. For example, by consulting the detailed chapters of the Programmer's Manuals. There is one manual available for each module.
  • Developed and steadily tested under GNU/Linux, Windows OS, macOS, and Raspberry Pi** devices. For details in respect to the current release, see the section below.

No Dependencies

ALib builds without mandatory third-party dependencies. Optional integrations exist. For example, if boost is available, ALib Strings** are using its regular-expression searches. In contrast, ALib provides optional compatibility headers for 3rd-party libraries (e.g., QT Class Library), which, for example, provide adaptations of ALib type-traits for QT-types.

Contributions

We are happy about community input and contributions. For legal clarity, contributions must be provided under the MIT License (or a more permissive license).

C# and Java Versions Of ALib

Historically, parts of ALib were also developed for C# and Java. Those projects are currently unmaintained but remain available as reference implementations and experimental sibling projects.

The primary and actively maintained version is ALib for C++.

ALib for C# and ALib for Java are included in and distributed with the cross-platform ALox Logging Library.

Thanks

Our thanks go to all supporters that did and do help to realize this project. Furthermore, to just all of these millions of supporters of free software, including: