Simple yet powerful reflection system / property system. This project is meant for students and professionals alike to have a default goto code that solves the very annoying issue of C++ properties. The code should be able to be inserted in game engines and applications without a problem. If you wish please read the Documentation.
Feel free to use the code in your projects. Don't forget to visit the project page and provide feedback or contribute, all is welcome.
struct common
{
int m_ValueHoldingVar = 0;
const int m_ReadOnlyValue = 100;
void setValues() {/*...*/}
XPROPERTY_DEF
( "Common", common
, obj_member<"m_ValueHoldingVar", &common::m_ValueHoldingVar>
, obj_member<"m_ReadOnlyValue", &common::m_ReadOnlyValue >
, obj_member<"setValues", &common::setValues>
)
};
XPROPERTY_REG(common)
- MIT license
- C++20
- Easy to integrate with existing libraries and systems
- Single header
- No allocations
- Most things happens at compile time
- No external dependencies
- No macros overused (4 of them used for convinience can be ignored)
- No exceptions for maximun speed
- No extra/external compilation step needed
- Minimalistic API
- Op-In properties
- Flexible configuration
- Properties can be define with the struct/classed making it easy to mantain
- Data and Function base properties
- Allows the user to support any container such
std::array
andstd::vector
or anything else - Supports unions, variants, any, etc...
- Support C-arrays, raw pointers, and the user can add support for std::share_ptr or any other C++ type of pointer
- Very easy to extend (Easy to add new types, and add extra data per type, or new type of lists)
- Supports base class interface for OOP
- Handle any kind of inheritance
- Works on all major compilers
- Examples for all the features and Documentation
- Examples on serization and deserialization using xcore
- Property Inspector Example for ImGui with undo/redo
- No dependencies required for the main library
- Some of the examples may require external libraries such: