Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RogerDX9/cppbindings
Template based reflection for C++
https://github.com/RogerDX9/cppbindings
Last synced: 18 days ago
JSON representation
Template based reflection for C++
- Host: GitHub
- URL: https://github.com/RogerDX9/cppbindings
- Owner: RogerDX9
- License: mit
- Created: 2014-11-09T13:11:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-16T19:45:46.000Z (almost 7 years ago)
- Last Synced: 2024-08-05T02:01:55.599Z (3 months ago)
- Language: C++
- Homepage:
- Size: 624 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# CPP Bindings
Template based reflection for C++
## Getting Started
A function with all members described and template specification are required per class:
```C++
struct Wheel
{
int m_rotation;
std::vector m_screws;static void tieMembers(CBind::IClassType * classType, std::string & outName) // a function
{
classType->tie("m_rotation", &Wheel::m_rotation);
classType->tie("m_screws", &Wheel::m_screws);outName = "Wheel";
}
};namespace CBind
{
template<> struct TypeInfo : public ClassType {}; // template specification
}
```* [Defined types are here](https://github.com/spoiltos/cppbindings/blob/master/cppbindings/Reflection.h)
* [Example of use](https://github.com/spoiltos/cppbindings/blob/master/example/main.cpp)
## Compiled under:
* visual studio 2015 - build/vs2015/cppbindings.sln
* gcc 6.4.0 - run >G++ example/main.cpp