manpagez: man pages & more
info ginac
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5.1 GiNaC's run-time type information system

All algebraic classes (that is, all classes that can appear in expressions) in GiNaC are direct or indirect subclasses of the class basic. So a basic * (which is essentially what an ex is) represents a generic pointer to an algebraic class. Occasionally it is necessary to find out what the class of an object pointed to by a basic * really is. Also, for the unarchiving of expressions it must be possible to find the unarchive() function of a class given the class name (as a string). A system that provides this kind of information is called a run-time type information (RTTI) system. The C++ language provides such a thing (see the standard header file ‘<typeinfo>’) but for efficiency reasons GiNaC implements its own, simpler RTTI.

The RTTI in GiNaC is based on two mechanisms:

The disadvantage of this proprietary RTTI implementation is that there's a little more to do when implementing new classes (C++'s RTTI works more or less automatically) but don't worry, most of the work is simplified by macros.


© manpagez.com 2000-2024
Individual documents may contain additional copyright information.