How nguyenchiemminhvu/castle works
CASTLE is a header-only C++17 library for bounded, predictable embedded software. An application includes the headers for the job it needs, then uses fixed-capacity primitives and domain APIs that report ordinary failures through statuses rather than requiring exceptions. Its capabilities span core language support, containers, events and synchronization, mathematical utilities, and embedded protocols and integrations. The graph groups these capabilities rather than depicting an application-specific runtime pipeline; arrows are limited to relationships visible in the README or sampled source index. Some unsampled subsystems are represented at their exact source directories.
Main entry points: event_handler.hpp Async event scheduler · status.hpp Status values · array.hpp Fixed-capacity containers · function.hpp Callable wrappers
Components 27
Core foundation
- Compiler abstraction
include/castle/core/compiler.hpp - Configuration and types
include/castle/core/config.hpp - Type traits
include/castle/core/traits.hpp - Error handling
include/castle/core/error_handler.hpp - Status values
include/castle/error/status.hpp
Core primitives
- Fixed-capacity containers
include/castle/container/array.hpp - Non-owning views
include/castle/container/array_view.hpp - Callable wrappers
include/castle/callbacks/function.hpp - Memory and lifetime
include/castle/memory/storage.hpp - Utility types
include/castle/utility - Algorithms and iterators
include/castle/algorithm
Events and coordination
- Clocks and durations
include/castle/chrono - Async event scheduler
include/castle/events/event_handler.hpp - Events and signals
include/castle/events - Synchronization
include/castle/sync
Math and geometry
- Math utilities
include/castle/math - Geometry and linear algebra
include/castle/math/geometry
Embedded extensions
- Diagnostics
include/castle_ext/diag/diagnostic_manager.hpp - Signal filtering
include/castle_ext/filter - Geodetic and geofence
include/castle_ext/geodetic - NMEA and UBX parsers
include/castle_ext/parsers - NMEA protocol
include/castle_ext/protocols/nmea/nmea.hpp - Device protocols
include/castle_ext/protocols - Serialization formats
include/castle_ext/serialization - Codecs and cryptography
include/castle_ext/codecs - Hardware and file I/O
include/castle_ext/io
Other components
- Firmware application
Connections 10
- Firmware application → Fixed-capacity containers: uses
- Firmware application → Callable wrappers: uses
- Firmware application → Error handling: uses
- Firmware application → Status values: uses
- NMEA and UBX parsers → NMEA protocol: parses with
include/castle_ext/parsers/nmea_parser/nmea_parser.hpp - Geodetic and geofence → Geometry and linear algebra: uses
include/castle_ext/geodetic/geofence.hpp - Async event scheduler → Callable wrappers: stores callbacks
include/castle/events/event_handler.hpp - Async event scheduler → Clocks and durations: schedules by time
include/castle/events/event_handler.hpp - Async event scheduler → Status values: reports status
include/castle/events/event_handler.hpp - Async event scheduler → Fixed-capacity containers: queues tasks
include/castle/events/event_handler.hpp