diff options
author | Nathan Binkert <nate@binkert.org> | 2008-10-09 22:19:39 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2008-10-09 22:19:39 -0700 |
commit | 94b08bed07d13106381a0bb692bf0d879c5353d4 (patch) | |
tree | e6edac20c9eaa5cfb6eab25d3e6a4716d4451da9 /src/SConscript | |
parent | 4ecc5d53a302c5e494df5853a314a61e8bba3a50 (diff) | |
download | gem5-94b08bed07d13106381a0bb692bf0d879c5353d4.tar.xz |
SimObjects: Clean up handling of C++ namespaces.
Make them easier to express by only having the cxx_type parameter which
has the full namespace name, and drop the cxx_namespace thing.
Add support for multiple levels of namespace.
Diffstat (limited to 'src/SConscript')
-rw-r--r-- | src/SConscript | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/SConscript b/src/SConscript index 09ccf7722..be721d57e 100644 --- a/src/SConscript +++ b/src/SConscript @@ -531,23 +531,24 @@ def buildParams(target, source, env): print >>out, decl continue - code = '' - base = obj.get_base() + class_path = obj.cxx_class.split('::') + class_path.reverse() + classname = class_path[0] + namespaces = class_path[1:] + code = '' code += '// stop swig from creating/wrapping default ctor/dtor\n' - code += '%%nodefault %s;\n' % obj.cxx_class - code += 'class %s ' % obj.cxx_class - if base: - code += ': public %s' % base + code += '%%nodefault %s;\n' % classname + code += 'class %s ' % classname + if obj._base: + code += ': public %s' % obj._base.cxx_class code += ' {};\n' - klass = obj.cxx_class; - if hasattr(obj, 'cxx_namespace'): - new_code = 'namespace %s {\n' % obj.cxx_namespace + for ns in namespaces: + new_code = 'namespace %s {\n' % ns new_code += code new_code += '}\n' code = new_code - klass = '%s::%s' % (obj.cxx_namespace, klass) print >>out, code |