Cbeam
|
The root namespace for the Cbeam library. This namespace unifies cross-platform utilities for concurrency, memory management, file handling, logging, serialization, and more. Its purpose is to provide a cohesive collection of modern C++ components that address common system-level and application-level tasks, while promoting thread-safety, interprocess communication, and stable resource handling across varied platform APIs. More...
Namespaces | |
namespace | concurrency |
Provides concurrency primitives and abstractions for multithreaded programming. It features the powerful message_manager class for managing asynchronous message queues with flexible ordering (FIFO, FILO, or RANDOM), as well as threaded_object , which uses CRTP to encapsulate worker-thread logic with built-in synchronization. These classes simplify threaded operations, interprocess synchronization, and message dispatch under varying concurrency scenarios. | |
namespace | container |
Offers advanced container types with unique approaches to stability and interprocess sharing. Besides standard helpers like buffer and circular_buffer , it includes innovative classes such as stable_interprocess_container and stable_interprocess_map . These support shared-memory usage, ensuring consistent serialization and robust data exchange across process boundaries or differing compiler environments. | |
namespace | convert |
Contains conversion utilities to transform data between different formats and types. Functions here handle string conversions, encoding manipulations, and the creation of string representations for various C++ types. They help ensure consistent serialization and text output across the library. | |
namespace | encoding |
Focuses on UTF-8 checks, character handling, and encoding-specific validations. It includes lightweight helpers like is_valid_utf8 and has_utf8_specific_encoding , which verify the correctness and properties of strings under UTF-8 constraints. | |
namespace | error |
Defines Cbeam-specific exception types that behave like their standard counterparts. For example, runtime_error and system_error derive from base_error and std::runtime_error (or std::system_error), unifying error handling under a single hierarchy and ensuring consistent cross-platform throw/catch logic. | |
namespace | filesystem |
Facilitates file I/O, path normalization, and directory operations in a cross-platform manner. Its classes and functions simplify reading, writing, creating, or deleting files and directories, handling discrepancies in path formats, symbolic links, and OS-specific peculiarities. | |
namespace | json |
Provides JSON-style and nested-map serialization features. It offers methods to convert a wide range of container types (maps, nested_maps) and strings into JSON-like structures, with an emphasis on composability and integration with other Cbeam utilities. The goal is to offer concise, type-safe serialization for both simple and nested data. | |
namespace | lifecycle |
Manages the lifecycle of singletons, item registries, and scoped variables. This namespace introduces powerful constructs such as singleton_control and item_registry for explicitly managing the instantiation and teardown of resources, minimizing global-state risks and encouraging well-defined initialization flows. | |
namespace | logging |
Offers flexible logging mechanisms to record messages with timestamps and thread information. The log_manager can create or reinitialize log files at runtime, appending text from multiple threads safely, while log handles file writes with concurrency considerations. Debug-logging macros are also provided for conditional compilation. | |
namespace | memory |
Houses abstractions for shared-memory and interprocess data exchange. This includes interprocess_shared_memory for OS-level memory segments and unified resource sharing, along with helper classes in other namespaces. It highlights stable reference counting and safe pointer conversions for robust cross-process operations. | |
namespace | platform |
Groups platform-specific helpers for Windows, Linux, and macOS. These utilities detect CPU architecture, manage COM initialization on Windows, resolve runtime paths, handle system directories, and unify OS-level functionality behind well-defined C++ APIs. | |
namespace | random |
Collects random number generation tools for multithreaded environments. It includes a default thread-local generator and utilities to produce random integers, uniform distributions, or random strings. This promotes convenient generation of secure or test-oriented random values without external dependencies. | |
namespace | serialization |
Implements traits-based serialization for complex data types, including standard containers and custom structures. It relies on specialized traits and buffer logic to convert objects to and from raw memory blocks, enabling stable interprocess data transport and straightforward integration with advanced container classes and xpod variants. | |
Functions | |
std::string | get_version () |
Returns the library version string, for example "1.2.3". | |
The root namespace for the Cbeam library. This namespace unifies cross-platform utilities for concurrency, memory management, file handling, logging, serialization, and more. Its purpose is to provide a cohesive collection of modern C++ components that address common system-level and application-level tasks, while promoting thread-safety, interprocess communication, and stable resource handling across varied platform APIs.
|
inline |
Returns the library version string, for example "1.2.3".
USING_CMAKE
is defined and the current git commit is tagged, this function uses the generated CBEAM_VERSION
macro, which corresponds to the commit tag (with the leading 'v' removed).USING_CMAKE
is not defined - it returns "0.0.0".Note: Official Cbeam releases are always tagged.