config: Fix handling of parents for simobject vectors
SimObjectVector objects did not provide the same interface to the _parent attribute through get_parent() like a normal SimObject. It also handled assigning a _parent incorrectly if objects in a SimObjectVector were changed post-creation, leading to errors later when the simulator tried to execute. This patch fixes these two omissions.
This commit is contained in:
@@ -784,6 +784,11 @@ class SimObject(object):
|
||||
self._parent = parent
|
||||
self._name = name
|
||||
|
||||
# Return parent object of this SimObject, not implemented by SimObjectVector
|
||||
# because the elements in a SimObjectVector may not share the same parent
|
||||
def get_parent(self):
|
||||
return self._parent
|
||||
|
||||
# Also implemented by SimObjectVector
|
||||
def get_name(self):
|
||||
return self._name
|
||||
|
||||
Reference in New Issue
Block a user