]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/type-swallow-trans.hh
release: 0.1.13
[lilypond.git] / lily / include / type-swallow-trans.hh
1 /*
2   type-swallow-grav.hh -- declare Type_swallow_translator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef TYPESWALLOW_GRAV_HH
11 #define TYPESWALLOW_GRAV_HH
12
13 #include "translator.hh"
14 /// eat a certain type of request
15 class Type_swallow_translator : public virtual Translator
16 {
17 protected:
18   const char * type_;
19   bool do_try_request (Request*);
20 public:
21   DECLARE_MY_RUNTIME_TYPEINFO;
22   TRANSLATOR_CLONE(Type_swallow_translator);
23   Type_swallow_translator ();
24 };
25
26 #define DECLARE_REQUEST_SWALLOWER(TYPE)  \
27 struct TYPE ## _swallow_translator : public Type_swallow_translator {\
28   TYPE ## _swallow_translator() { \
29     type_ = TYPE::static_name ();\
30   }\
31   DECLARE_MY_RUNTIME_TYPEINFO;\
32   TRANSLATOR_CLONE(TYPE ## _swallow_translator);\
33 };\
34 IMPLEMENT_IS_TYPE_B1(TYPE ## _swallow_translator, Type_swallow_translator);\
35 ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\
36
37 #endif // TYPESWALLOW_GRAV_HH
38