diff --git a/reflex/inc/Reflex/Builder/DictSelection.h b/reflex/inc/Reflex/Builder/DictSelection.h index acce97612324207e06a544db291cc4af30eba7a5..3ac4ddfc4007d1e57ecf0e6a0efea6dff76ba9d9 100644 --- a/reflex/inc/Reflex/Builder/DictSelection.h +++ b/reflex/inc/Reflex/Builder/DictSelection.h @@ -1,4 +1,4 @@ -// @(#)root/reflex:$Name: $:$Id: DictSelection.h,v 1.3 2005/11/23 16:08:08 roiser Exp $ +// @(#)root/reflex:$Name: $:$Id: DictSelection.h,v 1.4 2006/03/13 15:49:50 roiser Exp $ // Author: Stefan Roiser 2004 #ifndef ROOT_Reflex_DictSelection @@ -236,6 +236,16 @@ namespace ROOT { namespace Reflex { namespace Selection { + + /* + * @brief turn of autoselection of the class + * + * By default classes which appear in the Selection namespace will be selected + * for dictionary generation. If a class has a member of type NO_SELF_AUTOSELECT + * no dictionary information for this class will be generated. + */ + class RFLX_API NO_SELF_AUTOSELECT {}; + /* * @brief Mark a MemberAt as being transient. diff --git a/reflex/python/genreflex/gendict.py b/reflex/python/genreflex/gendict.py index 18139126f3ad074c59b1a9a10de712ace6f0815c..59dd23037c01141f6be66134cf1b8abfa2304e17 100644 --- a/reflex/python/genreflex/gendict.py +++ b/reflex/python/genreflex/gendict.py @@ -131,24 +131,27 @@ class genDictionary(object) : return #---------------------------------------------------------------------------------- def notice_autoselect (self, c, selection): - attrs = self.xref[c['id']]['attrs'] - if attrs.has_key('extra') : attrs['extra']['autoselect'] = 'true' - else : attrs['extra'] = {'autoselect':'true'} + self_autoselect = 1 for f in self.get_fields (selection): tid = f['type'] tname = self.genTypeName (tid) + if tname.startswith( self.selectionname+'::NO_SELF_AUTOSELECT'): self_autoselect = 0 if tname.startswith (self.selectionname+'::AUTOSELECT'): - if 'members' in c: - for mnum in c['members'].split(): - m = self.xref[mnum] - if 'name' in m['attrs'] and m['attrs']['name'] == f['name']: - if m['elem'] == 'Field': - fattrs = self.xref[m['attrs']['type']]['attrs'] - if fattrs.has_key('extra') : fattrs['extra']['autoselect'] = 'true' - else : fattrs['extra'] = {'autoselect':'true'} - else : - print '--->> genreflex: WARNING: AUTOSELECT selection functionality for %s not implemented yet' % m['elem'] - self.warnings += 1 + if 'members' in c: + for mnum in c['members'].split(): + m = self.xref[mnum] + if 'name' in m['attrs'] and m['attrs']['name'] == f['name']: + if m['elem'] == 'Field': + fattrs = self.xref[m['attrs']['type']]['attrs'] + if fattrs.has_key('extra') : fattrs['extra']['autoselect'] = 'true' + else : fattrs['extra'] = {'autoselect':'true'} + else : + print '--->> genreflex: WARNING: AUTOSELECT selection functionality for %s not implemented yet' % m['elem'] + self.warnings += 1 + if self_autoselect : + attrs = self.xref[c['id']]['attrs'] + if attrs.has_key('extra') : attrs['extra']['autoselect'] = 'true' + else : attrs['extra'] = {'autoselect':'true'} return #---------------------------------------------------------------------------------- def get_fields (self, c):