Classdesc EcoLab Graphcode Documentation
SF Project Website Download Source Code Repository Doxygen Documentation

Classdesc

Russell Standish

Classdesc is a system for adding reflection to C++, ie the ability to query an object's structure at runtime. This is different from run time type enquiry (RTTI), which merely returns a unique signature for an object's type.

It consists of a preprocessor that parses class definitions, and outputs definitions of an overloaded function (called an action, or descriptor) that is recursively called on the members. By defining the action on basic types such as int, floats, chars etc, the action can be called on any arbitrary type.

The classdesc distribution comes with an action called pack defined, which performs serialisation on objects (packing an object into a binary representation, which may optionally be machine independent).

ClassdescMP builds on the serialisation capability of Classdesc to provide an easy to use MPI programming environment for C++ users.

A Fortran version of Classdesc, called FClassdesc was started under a project funded by the Australian Partnership for Advanced Computing, but is not currently under active development. A snapshot of this project that implements serialisation is available from the file release area.

Why use Classdesc?

Obviously (at this stage) Classdesc is only useful for C++ programmers.

Publications

Please use reference 7 below to cite Classdesc, and 5 to refer to ClassdescMP.

  1. Standish R.K. (2024) “Fat API bindings of C++ objects into scripting languages”, Overload Journal, 32, No. 181 16-20. arXiv:2403.14940 .

  2. Standish R.K. (2019) “C++ Reflection for Python Binding”, Overload Journal, No. 152, 15-18.

  3. Standish R.K. (2016) “Classdesc: A Reflection System for C++11”, Overload Journal, No. 131, 18-23.

  4. Standish, R.K. and Madina, D. (2008) “Classdesc and Graphcode: support for scientific programming in C++”, arXiv:cs.CE/0610120

  5. Standish, R.K. and Madina, D. (2003) “ClassdescMP: Easy MPI programming in C++” in Computational Science, Sloot et al. (eds), LNCS 2660, Springer, 896. arXiv:cs.DC/0401027

  6. Leow, R. and Standish, R.K. (2003) “Running C++ models under the Swarm Environment”, in Proceedings SwarmFest 2003. arXiv:cs.MA/0401025

  7. Madina, D. and Standish, R.K. (2001) “A system for reflection in C++”, in Proceedings AUUG 2001: Always on and Everywhere, 207. ISBN 0957753225 arXiv:cs.PL/0401024