Lines Matching refs:cls
94 cls = super(MetaParamValue, mcls).__new__(mcls, name, bases, dct)
96 allParams[name] = cls
97 return cls
110 def cxx_predecls(cls, code):
114 def pybind_predecls(cls, code):
115 cls.cxx_predecls(code)
130 def cxx_ini_predecls(cls, code):
136 def cxx_ini_parse(cls, code, src, dest, ret):
137 code('// Unhandled param type: %s' % cls.__name__)
554 def cxx_ini_predecls(cls, code):
568 def __init__(cls, name, bases, dict):
569 super(CheckedIntType, cls).__init__(name, bases, dict)
577 if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
578 if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
582 if cls.unsigned:
583 cls.min = 0
584 cls.max = 2 ** cls.size - 1
586 cls.min = -(2 ** (cls.size - 1))
587 cls.max = (2 ** (cls.size - 1)) - 1
620 def cxx_predecls(cls, code):
656 def cxx_ini_predecls(cls, code):
662 def cxx_ini_parse(cls, code, src, dest, ret):
691 def cxx_ini_predecls(cls, code):
836 def cxx_predecls(cls, code):
841 def pybind_predecls(cls, code):
846 def cxx_ini_predecls(cls, code):
852 def cxx_ini_parse(cls, code, src, dest, ret):
926 def cxx_ini_predecls(cls, code):
932 def cxx_ini_parse(cls, code, src, dest, ret):
961 def cxx_predecls(cls, code):
1014 def cxx_predecls(cls, code):
1066 def cxx_predecls(cls, code):
1140 def cxx_predecls(cls, code):
1248 def cxx_predecls(cls, code):
1275 def cxx_ini_predecls(cls, code):
1279 def cxx_ini_parse(cls, code, src, dest, ret):
1304 cls = super(MetaEnum, mcls).__new__(mcls, name, bases, dict)
1305 allEnums[name] = cls
1306 return cls
1308 def __init__(cls, name, bases, init_dict):
1310 if not isinstance(cls.map, dict):
1314 cls.vals = list(cls.map.keys())
1315 cls.vals.sort()
1317 if not isinstance(cls.vals, list):
1321 cls.map = {}
1322 for idx,val in enumerate(cls.vals):
1323 cls.map[val] = idx
1328 if cls.is_class:
1329 cls.cxx_type = '%s' % name
1331 cls.cxx_type = 'Enums::%s' % name
1333 super(MetaEnum, cls).__init__(name, bases, init_dict)
1338 def cxx_decl(cls, code):
1339 wrapper_name = cls.wrapper_name
1340 wrapper = 'struct' if cls.wrapper_is_struct else 'namespace'
1341 name = cls.__name__ if cls.enum_name is None else cls.enum_name
1349 if cls.is_class:
1360 for val in cls.vals:
1361 code('$val = ${{cls.map[val]}},')
1362 code('Num_$name = ${{len(cls.vals)}}')
1366 if cls.is_class:
1370 elif cls.wrapper_is_struct:
1375 if not cls.is_class:
1382 def cxx_def(cls, code):
1383 wrapper_name = cls.wrapper_name
1384 file_name = cls.__name__
1385 name = cls.__name__ if cls.enum_name is None else cls.enum_name
1388 if cls.wrapper_is_struct:
1392 if cls.is_class:
1403 for val in cls.vals:
1408 if not cls.wrapper_is_struct and not cls.is_class:
1413 def pybind_def(cls, code):
1414 name = cls.__name__
1415 enum_name = cls.__name__ if cls.enum_name is None else cls.enum_name
1416 wrapper_name = enum_name if cls.is_class else cls.wrapper_name
1431 if cls.is_class:
1438 for val in cls.vals:
1479 def cxx_predecls(cls, code):
1480 code('#include "enums/$0.hh"', cls.__name__)
1483 def cxx_ini_parse(cls, code, src, dest, ret):
1485 for elem_name in cls.map.keys():
1488 name = cls.__name__ if cls.enum_name is None else cls.enum_name
1489 code('%s = %s::%s;' % (dest, name if cls.is_class else 'Enums',
1532 def cxx_predecls(cls, code):
1543 def cxx_ini_predecls(cls, code):
1679 def __new__(cls, value):
1681 return super(cls, Voltage).__new__(cls, value)
1690 def __new__(cls, value):
1692 return super(cls, Current).__new__(cls, value)
1701 def __new__(cls, value):
1703 return super(cls, Energy).__new__(cls, value)
1714 def __new__(cls, value):
1717 return super(cls, NetworkBandwidth).__new__(cls, val)
1741 def cxx_ini_predecls(cls, code):
1753 def __new__(cls, value):
1756 return super(cls, MemoryBandwidth).__new__(cls, val)
1779 def cxx_ini_predecls(cls, code):
1798 def __call__(cls):
1799 return cls
2083 def compat(cls, role, peer):
2084 cls._compat_dict.setdefault(role, set()).add(peer)
2085 cls._compat_dict.setdefault(peer, set()).add(role)
2088 def is_compat(cls, one, two):
2115 cls.cxx_predecls(self, code)