An example of a C++ application with self-registering modules
  • C++ 93.6%
  • CMake 6.4%
Find a file
2014-08-27 10:56:00 +02:00
src Renamed to module_demo 2014-08-27 10:56:00 +02:00
.gitignore Initial commit 2014-08-26 14:45:10 +02:00
CMakeLists.txt Renamed to module_demo 2014-08-27 10:56:00 +02:00
module_demo.sublime-project Renamed to module_demo 2014-08-27 10:56:00 +02:00
README.md Renamed to module_demo 2014-08-27 10:56:00 +02:00

Module Demo

A simple example application demonstrating a C++ application with self-registering modules, to be queried and instantiated by name using a factory.

It works by abusing the way static variables in C++ work. Using a macro, you create a static variable of a type whose constructor registers the module with a singleton registry class. As static variables are initialized at startup, by the time main() gets called, you will already have a complete index of your modules.