]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/virtual-methods.hh
* lily/tie-column.cc (set_manual_tie_configuration): new function.
[lilypond.git] / flower / include / virtual-methods.hh
1 /*
2   virtual-methods.hh -- declare macros for our do-it-yourself RTTI
3
4   source file of the Flower Library
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #ifndef VIRTUAL_METHODS_HH
10 #define VIRTUAL_METHODS_HH
11
12 #include <typeinfo>
13 using namespace std;
14
15 #define classname(class_ptr) demangle_classname (typeid (* (class_ptr)))
16
17 char const *
18 demangle_classname (type_info const &);
19
20 /* Virtual copy constructor.  Make up for C++'s lack of a standard
21    factory or clone () function.  Uses a typeof hack.  Usage:
22
23    class Foo : Baseclass
24    {
25    VIRTUAL_COPY_CONSTRUCTOR (Baseclass, Foo);
26    }; */
27
28 #define VIRTUAL_COPY_CONSTRUCTOR(Base, name)    \
29   virtual Base *clone () const                  \
30   {                                             \
31     return new name (*this);                    \
32   }
33
34 #endif /* VIRTUAL_METHODS_HH */