SimObject.py (9017:a20f46ccb9ce) | SimObject.py (9100:3caf131d7a95) |
---|---|
1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 154 unchanged lines hidden (view full) --- 163 cls._ports = multidict() # port descriptions 164 165 # class or instance attributes 166 cls._values = multidict() # param values 167 cls._children = multidict() # SimObject children 168 cls._port_refs = multidict() # port ref objects 169 cls._instantiated = False # really instantiated, cloned, or subclassed 170 | 1# Copyright (c) 2012 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 154 unchanged lines hidden (view full) --- 163 cls._ports = multidict() # port descriptions 164 165 # class or instance attributes 166 cls._values = multidict() # param values 167 cls._children = multidict() # SimObject children 168 cls._port_refs = multidict() # port ref objects 169 cls._instantiated = False # really instantiated, cloned, or subclassed 170 |
171 # We don't support multiple inheritance. If you want to, you 172 # must fix multidict to deal with it properly. 173 if len(bases) > 1: 174 raise TypeError, "SimObjects do not support multiple inheritance" | 171 # We don't support multiple inheritance of sim objects. If you want 172 # to, you must fix multidict to deal with it properly. Non sim-objects 173 # are ok, though 174 bTotal = 0 175 for c in bases: 176 if isinstance(c, MetaSimObject): 177 bTotal += 1 178 if bTotal > 1: 179 raise TypeError, "SimObjects do not support multiple inheritance" |
175 176 base = bases[0] 177 178 # Set up general inheritance via multidicts. A subclass will 179 # inherit all its settings from the base class. The only time 180 # the following is not true is when we define the SimObject 181 # class itself (in which case the multidicts have no parent). 182 if isinstance(base, MetaSimObject): --- 942 unchanged lines hidden --- | 180 181 base = bases[0] 182 183 # Set up general inheritance via multidicts. A subclass will 184 # inherit all its settings from the base class. The only time 185 # the following is not true is when we define the SimObject 186 # class itself (in which case the multidicts have no parent). 187 if isinstance(base, MetaSimObject): --- 942 unchanged lines hidden --- |