cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks

cpgf is a free, open source and cross platform C++ library collection.
cpgf adds exciting features, including reflection (meta data), serialization, script binding, callbacks (signal and slot), into standard C++.

The goal of cpgf is to extend C++ language with lots of easy to use features, which are only available in other higher level languages such as C#, Java, or scripts, and absent in C++.

Version: 1.6.1 Released on 2018-09-01
License: Apache License, Version 2.0

Components in cpgf library

  • cpgf reflection. Add runtime introspection and meta data reflection feature to C++. Have you ever envied the reflection system in C# and Java? Now we have it in C++!
  • cpgf serialization. Save C++ data and objects to persistent storage and then load back. Want the same serialization system that is in C# and Java? Try cpgf!
  • cpgf script binding. A script binding engine to connect Lua, Google V8 JavaScript, Python and Mozilla SpiderMonkey to C++. Now script binding in C++ is a piece of cake!
  • cpgf callback. A callback library to implement signal/slot/callback in C++. Want signal and slot without extra preprocessor? Try cpgf!
  • cpgf meta data collection. A library with pre-made built-in meta data support. Now there are meta data for C++ STL, OpenGL, OpenGLU, OpenGLUT, Box2D physical engine, SFML multimedia library and Irrlicht 3D render engine.
  • cpgf meta data generator tool. A tool written in Java to automatically generate meta data from Doxygen XML files. This is an optional tool. Meta data can be reflected manually perfectly.
  • cpgf tween and timeline – a library to implement ease animation in C++.

Quick facts of cpgf library

  • Free and open source.
  • Provide easy to use class and function based library.
  • Provide interface based, Windows COM style, binary compatible API. It's easy to put meta data in a dynamic library and use the meta data from within another library.
  • Written in standard and portable C++. It can be compiled in VC 2008, GCC 3.4.2, Intel Composer XE 12.1.2 and C++ Builder 2010, on Windows, Linux, and Mac (iOS, iPhone, iPad).
  • Extensively, but not abuse, using template programming.
  • No need external preprocessor or code generation tools. Just coding and enjoy. Easy to setup, easy to integrate with your project.
  • Doesn't depend on third party or extend C++ libraries. cpgf doesn't require C++0X, TR1, C++11 features, or Boost library.

Quick facts of reflection library

  • As powerful as the reflection system in Java and C#.
  • Reflect global/member functions, global/member fields (variable), global/member properties (fields with getter/setter), constructors, classes, enumerators, and annotations.
  • Real runtime reflection. No compile time template parameters are needed when using the reflection.
  • No external preprocessor required, no ugly macros. Only using C++ templates, classes, and functions.
  • Support multiple inheritance.
  • Support default parameters for constructor, method, and operators.
  • For more information, please read cpgf reflection related documentation.

Quick facts of serialization library

  • As powerful as the serialization system in Java and C#.
  • Serialize object graph.
  • Correctly resolve multiple pointers to same object.
  • Serialize polymorphic objects.
  • Serialize C++ array.
  • Very extensible. The library supports customized serializer to serialize special data type manually.
  • Storage format agnostic.
  • Versioning.
  • Doesn't require extra intervention. Serialization only depends on reflection meta data.
  • For more information, please read cpgf serialization related documentation.

Quick facts of script binding library

  • Support Lua 5.2 and 5.1, Google V8 JavaScript, Python 2.7.3 and Mozilla SpiderMonkey 1.8.5.
  • Very easy and simple to use. Any reflected meta data can be bound to scripts.
  • Bind C++ classes, enumerators, functions, variables and operators to script engine.
  • Invoke script engine functions from C++.
  • Pass function written in script to C++ and used by C++.
  • Get and set script engine variables from C++.
  • Transfer arbitrary binary data between C++ and script.
  • Pass arbitrary script function and object to C++.
  • Support C++ shared pointer (C++11, Boost).
  • For more information, please read cpgf script binding related documentation.

Quick facts of tween library

  • Support many features that exist in some other widely used Flash tweening engines such as TweenMax. cpgf tween library supports repeat, yoyo, delay, repeat delay, backward, use frames, time scale, dynamical destination value (follow), and a lot of callbacks on initialization or complete.
  • Support many easing functions. Now supports back, bounce, circle, cubic, elastic, exponent, linear, quad, quart, quint (strong), and sine. Adding new easing functions is a piece of cake!
  • Support unlimited property types to tween on. With the powerful generic template programming, any types can be tweened as long as the type supports operators T + T, T - T, and T * float.
  • Support tweening getter and setter functions. With the powerful cpgf accessor library, we can tween a property via either direct address access, or getter and setter functions.
  • Flexibility and extensibility. Not only can we add any new easing functions and tween different property types, but also we can tween a bunch of properties in CPU data cache friendly manner.
  • Support both tween and timeline. A timeline is a “super” tween which can contains other tweens and timelines.

Why are you still waiting? Just download and give it a try and you won't regret. If you regret, don't be upset, please let me know your opinion. The library is improved day by day! Please come back often, you will be satisfied sooner or later!