def Namespace( name ): if not name: return _global_cpp try: return _backend.LookupCppEntity( name ) except AttributeError: pass # to help auto-loading, simply declare the namespace _backend.gInterpreter.Declare( 'namespace %s {}' % name ) return _backend.LookupCppEntity( name )
def __getattr__( cls, name ): attr = _backend.LookupCppEntity( name ) if type(attr) is _backend.PropertyProxy: setattr( cls.__class__, name, attr ) return attr.__get__(cls) setattr( cls, name, attr ) return attr
def __getattr__(cls, name): try: attr = _backend.LookupCppEntity(name) except TypeError as e: raise AttributeError(str(e)) if type(attr) is _backend.PropertyProxy: setattr(cls.__class__, name, attr) return attr.__get__(cls) setattr(cls, name, attr) return attr
def Namespace(name): if name == '': return _global_cpp else: return _backend.LookupCppEntity(name)