SimObject.py (7677:c6e283904437) | SimObject.py (7738:e2e8ca8d9640) |
---|---|
1# Copyright (c) 2004-2006 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 652 unchanged lines hidden (view full) --- 661 # Add a new child to this object. 662 def add_child(self, name, child): 663 child = coerceSimObjectOrVector(child) 664 if child.get_parent(): 665 raise RuntimeError, \ 666 "add_child('%s'): child '%s' already has parent '%s'" % \ 667 (name, child._name, child._parent) 668 if self._children.has_key(name): | 1# Copyright (c) 2004-2006 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 652 unchanged lines hidden (view full) --- 661 # Add a new child to this object. 662 def add_child(self, name, child): 663 child = coerceSimObjectOrVector(child) 664 if child.get_parent(): 665 raise RuntimeError, \ 666 "add_child('%s'): child '%s' already has parent '%s'" % \ 667 (name, child._name, child._parent) 668 if self._children.has_key(name): |
669 clear_child(name) | 669 self.clear_child(name) |
670 child.set_parent(self, name) 671 self._children[name] = child 672 673 # Take SimObject-valued parameters that haven't been explicitly 674 # assigned as children and make them children of the object that 675 # they were assigned to as a parameter value. This guarantees 676 # that when we instantiate all the parameter objects we're still 677 # inside the configuration hierarchy. --- 294 unchanged lines hidden --- | 670 child.set_parent(self, name) 671 self._children[name] = child 672 673 # Take SimObject-valued parameters that haven't been explicitly 674 # assigned as children and make them children of the object that 675 # they were assigned to as a parameter value. This guarantees 676 # that when we instantiate all the parameter objects we're still 677 # inside the configuration hierarchy. --- 294 unchanged lines hidden --- |