From 8531da5e2f98e4a5044509885fc540ea3299ddaa Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 29 Dec 2001 00:01:11 +0000 Subject: [PATCH] record two-way inheritance links [SVN r12169] --- new/class.jam | 7 +++++++ v2/kernel/class.jam | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/new/class.jam b/new/class.jam index 3db39fb00..dedc863be 100644 --- a/new/class.jam +++ b/new/class.jam @@ -24,6 +24,7 @@ rule class ( name : bases * ) { # This is a record of the class' base classes module local __bases__ = $(bases) ; + module local __derived__ = ; # always bring in the rules defined from this module, so that # users can easily call "inherit", for example. @@ -47,6 +48,12 @@ rule class ( name : bases * ) # ECHO import __init__ from module class@$(base) into class@$(name) as $(base).__init__ ; IMPORT class@$(base) : __init__ : class@$(name) : $(base).__init__ ; EXPORT class@$(name) : $(base).__init__ ; + module class@$(base) + { + # not using symbolic name "name" here because it might + # be a module-local variable + __derived__ += $(1) ; + } } } } diff --git a/v2/kernel/class.jam b/v2/kernel/class.jam index 3db39fb00..dedc863be 100644 --- a/v2/kernel/class.jam +++ b/v2/kernel/class.jam @@ -24,6 +24,7 @@ rule class ( name : bases * ) { # This is a record of the class' base classes module local __bases__ = $(bases) ; + module local __derived__ = ; # always bring in the rules defined from this module, so that # users can easily call "inherit", for example. @@ -47,6 +48,12 @@ rule class ( name : bases * ) # ECHO import __init__ from module class@$(base) into class@$(name) as $(base).__init__ ; IMPORT class@$(base) : __init__ : class@$(name) : $(base).__init__ ; EXPORT class@$(name) : $(base).__init__ ; + module class@$(base) + { + # not using symbolic name "name" here because it might + # be a module-local variable + __derived__ += $(1) ; + } } } }