Package pygccxml :: Package declarations :: Module typedef

Source Code for Module pygccxml.declarations.typedef

 1  # Copyright 2004-2008 Roman Yakovenko. 
 2  # Distributed under the Boost Software License, Version 1.0. (See 
 3  # accompanying file LICENSE_1_0.txt or copy at 
 4  # http://www.boost.org/LICENSE_1_0.txt) 
 5   
 6  """ 
 7  defines class that describes C++ typedef declaration 
 8  """ 
 9   
10  import declaration 
11  import dependencies 
12 13 -class typedef_t( declaration.declaration_t ):
14 """describes C++ typedef declaration""" 15
16 - def __init__( self, name='', type=None ):
17 """creates class that describes C++ typedef""" 18 declaration.declaration_t.__init__( self, name ) 19 self._type = type
20
21 - def _get__cmp__items( self ):
22 """implementation details""" 23 return [self.type]
24
25 - def __eq__(self, other):
26 if not declaration.declaration_t.__eq__( self, other ): 27 return False 28 return self.type == other.type
29
30 - def _get_type(self):
31 return self._type
32 - def _set_type(self, type):
33 self._type = type
34 type = property( _get_type, _set_type 35 , doc="reference to the original L{type<type_t>}" ) 36
37 - def i_depend_on_them( self, recursive=True ):
38 return [ dependencies.dependency_info_t( self, self.type ) ]
39 40 @property
41 - def byte_size (self):
42 "Size of this type in bytes @type: int" 43 return self._type.byte_size
44 45 @property
46 - def byte_align (self):
47 "alignment of this type in bytes @type: int" 48 return self._type.byte_align
49