Skip to content

RogerDX9/cppbindings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPP Bindings

Template based reflection for C++

Getting Started

A function with all members described and template specification are required per class:

struct Wheel
{
    int                 m_rotation;
    std::vector<int>    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 <Wheel> : public ClassType<Wheel> {}; // template specification
}

Compiled under:

  • visual studio 2015 - build/vs2015/cppbindings.sln
  • gcc 6.4.0 - run >G++ example/main.cpp

About

Template based reflection for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published