Deleted Added
sdiff udiff text old ( 7526:4bb5f5207617 ) new ( 7528:6efc3672733b )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 35 unchanged lines hidden (view full) ---

44#
45#####################################################################
46
47import copy
48import datetime
49import re
50import sys
51import time
52
53import proxy
54import ticks
55from util import *
56
57def isSimObject(*args, **kwargs):
58 return SimObject.isSimObject(*args, **kwargs)
59

--- 113 unchanged lines hidden (view full) ---

173 return ' '.join([v.ini_str() for v in self])
174
175 def getValue(self):
176 return [ v.getValue() for v in self ]
177
178 def unproxy(self, base):
179 return [v.unproxy(base) for v in self]
180
181class SimObjVector(VectorParamValue):
182 def print_ini(self, ini_file):
183 for v in self:
184 v.print_ini(ini_file)
185
186class VectorParamDesc(ParamDesc):
187 file_ext = 'vptype'
188
189 # Convert assigned value to appropriate type. If the RHS is not a
190 # list or tuple, it generates a single-element list.
191 def convert(self, value):
192 if isinstance(value, (list, tuple)):
193 # list: coerce each element into new list
194 tmp_list = [ ParamDesc.convert(self, v) for v in value ]
195 else:
196 # singleton: coerce to a single-element list
197 tmp_list = [ ParamDesc.convert(self, value) ]
198
199 if isSimObjectSequence(tmp_list):
200 return SimObjVector(tmp_list)
201 else:
202 return VectorParamValue(tmp_list)
203
204 def swig_predecls(self):
205 return ['%%include "%s_vptype.i"' % self.ptype_str]
206
207 def swig_decl(self):
208 cxx_type = re.sub('std::', '', self.ptype.cxx_type)

--- 995 unchanged lines hidden ---