A lightweight, dependency-free runtime reflection and dynamic type system for C++, optimized for loading thousands of data-driven types from configuration files (written in an easy-to-use DSL) while maintaining high performance.
- Runtime Type Creation: Load types dynamically from DSL files at runtime
- Full Introspection: Iterate over properties, query inheritance hierarchies
- Inheritance Support: Multi-level inheritance with automatic property collection
- Type-Safe Storage: Built on
std::variantfor compile-time type safety - Zero Dependencies: Uses only C++17 standard library (we will be upgrading to C++23)
- Scalable: Designed to handle thousands of types efficiently
| Option | Default | Description |
|---|---|---|
VAPOR_BUILD_EXAMPLES |
ON |
Build example programs |
VAPOR_BUILD_TESTS |
OFF |
Build test suite |
VAPOR_BUILD_BENCHMARKS |
OFF |
Build performance benchmarks |
VAPOR_BUILD_SHARED |
OFF |
Build shared library instead of static |
- PropertyValue: Type-safe storage using
std::variant<int, double, std::string, bool, std::vector<int>, std::vector<double>, std::vector<std::string>> - TypeDescriptor: Metadata for types and their properties
- TypeRegistry: Singleton registry for type management and object creation
- DynamicObject: Runtime instances with property access
- DSLParser: Parser for type definition files
- Simplicity over Magic: Avoided complex template metaprogramming for maintainability
- Performance Where It Matters: O(1) property access via hash maps
- Type Safety: Compile-time type checking where possible, runtime validation elsewhere
- Scalability: Tested conceptually with thousands of types
- Limited to 7 basic property types (int, double, string, bool, vector, vector, vector)
- This should suffice for most general purpose applications to start with
- Not thread-safe by default (work will be done on this front once we are at a point of implementation)
- No built-in serialization
- Additional property types (custom structs, etc.)
- Method/function support in type descriptors
- Data serialization format (possibly integrate JSON and binary formats)
- Runtime schema evolution
- Multi-threading support
- Plugin architecture for custom native types