Skip to content

IlyaKozhevnikov7/CppReflection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CppReflection

This is a solution for using reflection in a C++ project. With it, you can selectively apply reflection to your C++ types, and also get meta information about types at runtime.


Windows Linux

Requirements

  • C++20 compatible compiler (MSVC, clang++)
  • Supported OS: Windows, Linux

Build

# Build MetaGenerator
premake5 vs2022   # Required for MetaGenerator (.NET)
dotnet build MetaGenerator/MetaGenerator.csproj -c [Debug|Release]

# Build CppReflection

# Windows
msbuild Reflection\CppReflection.vcxproj

# Linux
premake5 gmake
make CppReflection

How to use

  • Include headers (Reflection/Include)
  • Setup MetaGenerator (See Generator Usage for details)

Common features

  • Automatic generation of metainformation

  • Assembly

    • Dynamic loading
    • Type extraction (by name)

      ⚠️(except generic types)

  • Attributes (for types, field, methods, constructors)

  • Types (class / struct / generics)

    • Name
    • Namespace
    • Size
    • Parent types
    • Lifetime control
      • Constructors
      • Destructors
    • Fields
      • Name
      • Accesse (read / write) (local / static)
    • Methods
      • Name
      • Signature (return type / argument types)
      • Dynamic invoke
    • IsA checks
  • Generic Types

    • Template name
    • Parameter types (Single, multiple and ellipsis)

      ⚠️ Only type parameters are supported (no value parameters)

  • Enums

    • Name
    • Namespace
    • Base type
    • Value names
    • Values
  • Static and polymorphic type extraction

  • Cast (upcast, downcast, crosscast)

    💡 Without RTTI


Here more information about how to use CppReflection.

About

C++ Reflection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors