1
2
3
4
5
6 """
7 defines classes, that describe C++ types
8 """
9
10 import compilers
11 import algorithms_cache
14 """base class for all types"""
21
23 res = self.decl_string
24 if res[:2]=="::":
25 res = res[2:]
26 return res
27
32
34 return not self.__eq__( other )
35
37 if not isinstance( other, self.__class__ ):
38 return self.__class__.__name__ < other.__class__.__name__
39 return self.decl_string < other.decl_string
40
42 raise NotImplementedError()
43
44 @property
47
48 @property
51
53 raise NotImplementedError()
54
56 "returns new instance of the type"
57 answer = self._clone_impl()
58 return answer
59
61 return self._byte_size
63 self._byte_size = new_byte_size
64 byte_size = property( _get_byte_size, _set_byte_size
65 , doc="Size of this type in bytes @type: int")
66
72 self._byte_align = new_byte_align
73 byte_align = property( _get_byte_align, _set_byte_align
74 , doc="Alignment of this type in bytes @type: int")
75
83 """provides L{type_t} interface for a string, that defines C++ type.
84
85 This class could be very useful in the code generator.
86 """
90
92 return self._decl_string
93