From c29a163fd9deda347c3e8188c515ac31300bdb81 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 27 Mar 1997 10:56:10 +0000 Subject: [PATCH] lilypond-0.0.46.jcn1 --- lily/include/register.hh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lily/include/register.hh b/lily/include/register.hh index 808b28d05c..4ac81c61e4 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -11,6 +11,7 @@ #include "varray.hh" #include "request.hh" #include "staff-elem-info.hh" +#include "staff-info.hh" /** a struct which processes requests, and creates the #Staff_elem#s. @@ -84,7 +85,7 @@ protected: /** Does this equal or contain a certain register? */ - virtual bool contains_b(Request_register*reg_l); + virtual bool contains_b(Request_register*reg_l)const; /** Get information on the staff. Default: ask daddy. */ @@ -103,6 +104,22 @@ public: void print() const; }; +/** + A macro to automate administration of registers. + */ +#define ADD_THIS_REGISTER(c) \ +struct c ## init { \ + static Request_register * globalctor (){ \ + return new c; \ + } \ + c ## init () { \ + add_request_register(c::static_name(), globalctor); \ + \ + } \ +} _ ## c ## init; + +typedef Request_register*(*Reg_ctor)(void); +void add_request_register(String s, Reg_ctor f); #endif // REGISTER_HH -- 2.39.5