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,
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.
Obviously (at this stage) Classdesc is only useful for C++ programmers.
- Checkpoint/Restart. Make all relevant variables part of a single
model object, then use pack to convert this model object into a
binary stream that can be written to a file. Because the serialised
object can be machine independent, the resulting checkpoint file can
be moved between different computing architectures.
- Developing MPI applications. ClassdescMP takes away much of the
pain involved in programming MPI applications, particularly when you
need to pass around more complicated data structures than arrays of
- Persistent object store for unstructured
applications. Considerable performance boosts can be achieved over
naive reliance on virtual memory when the number of objects exceeds
available physical memory.
- Interfacing with other programming languages. For example, one
can interface with TCL/TK to easily add GUI items to a model
simulation. The accessor functions to obtain or set data items within
the model are created automatically via classdesc. See
for an example
implementation. Of course,
may also be used for
- Client-server applications. By periodically shipping a
serialised copy of a model state over a network to a client program,
one can easily create a client analysis or visualisation program of a
running simulation that is running elsewhere. See
for an example
Please use reference 4 below to cite Classdesc, and
2 to refer to ClassdescMP.
- Standish, R.K. and Madina, D. (2008)
``Classdesc and Graphcode: support for scientific
programming in C++'',
- Standish, R.K. and Madina, D. (2003)
``ClassdescMP: Easy MPI programming in
in Computational Science, Sloot et al. (eds),
2660, Springer, 896. arXiv:cs.DC/0401027
- Leow, R. and Standish, R.K. (2003) ``Running
C++ models under the Swarm
Environment'', in Proceedings SwarmFest 2003. arXiv:cs.MA/0401025
- Madina, D. and Standish, R.K. (2001)
``A system for reflection in
C++'', in Proceedings AUUG 2001:
Always on and Everywhere, 207. ISBN 0957753225