Update of /cvsroot/pygccxml/source/pyplusplus/code_creators
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv516/pyplusplus/code_creators
Modified Files:
calldef.py class_declaration.py
Removed Files:
interfaces.py
Log Message:
removing finalize from the code_creators and adding it to decl wrappers
Index: class_declaration.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/class_declaration.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** class_declaration.py 5 Mar 2006 05:50:25 -0000 1.37
--- class_declaration.py 20 Mar 2006 05:47:56 -0000 1.38
***************
*** 11,25 ****
import algorithm
import smart_pointers
- import interfaces
import declaration_based
import array_1_registrator
from pygccxml import declarations
! class class_t( scoped.scoped_t, interfaces.finalizable_t ):
def __init__(self, class_inst, wrapper=None, held_type=None, parent=None ):
scoped.scoped_t.__init__( self
, parent=parent
, declaration=class_inst )
- interfaces.finalizable_t.__init__( self )
self._wrapper = wrapper
--- 11,23 ----
import algorithm
import smart_pointers
import declaration_based
import array_1_registrator
from pygccxml import declarations
! class class_t( scoped.scoped_t ):
def __init__(self, class_inst, wrapper=None, held_type=None, parent=None ):
scoped.scoped_t.__init__( self
, parent=parent
, declaration=class_inst )
self._wrapper = wrapper
***************
*** 53,65 ****
held_type = property( _get_held_type, _set_held_type )
- ##def is_finalizable(self):
- ##if not self.wrapper:
- ##return False
- ##finalizables = filter( lambda creator: isinstance( creator, interfaces.finalizable_t )
- ##and creator.wrapper
- ##, self.creators )
- ##temp = filter( lambda creator: creator.is_finalizable(), finalizables )
- ##return len( temp ) == len( finalizables )
-
def _exported_base_classes(self):
if not self.declaration.bases:
--- 51,54 ----
***************
*** 98,116 ****
return operator_creators
- ##def finalize( self ):
- ##if not self.wrapper:
- ##return
- ##if not self.is_finalizable():
- ##raise interfaces.finalize_error_t( 'Unable to finalize class "%s". Some internal code creators are not finalazable.'
- ##% declarations.full_name( self.declaration ) )
-
- ##finalizables = filter( lambda creator: isinstance( creator, interfaces.finalizable_t )
- ##, self.creators )
- ##relevant_ones = filter( lambda creator: creator.wrapper and creator.wrapper.parent is self.wrapper
- ##, finalizables )
- ##map( lambda creator: creator.finalize(), relevant_ones )
- ##self.wrapper.parent.remove_creator( self.wrapper )
- ##self.wrapper = None
-
def _generate_noncopyable(self):
if declarations.is_noncopyable( self.declaration ):
--- 87,90 ----
--- interfaces.py DELETED ---
Index: calldef.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/calldef.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** calldef.py 5 Mar 2006 05:51:30 -0000 1.47
--- calldef.py 20 Mar 2006 05:47:56 -0000 1.48
***************
*** 7,16 ****
import types
import algorithm
- import interfaces
import declaration_based
import class_declaration
from pygccxml import declarations
! class function_t( declaration_based.declaration_based_t, interfaces.finalizable_t ):
_PARAM_SEPARATOR = ', '
def __init__(self, function, wrapper=None, parent=None ):
--- 7,15 ----
import types
import algorithm
import declaration_based
import class_declaration
from pygccxml import declarations
! class function_t( declaration_based.declaration_based_t):
_PARAM_SEPARATOR = ', '
def __init__(self, function, wrapper=None, parent=None ):
***************
*** 18,22 ****
, declaration=function
, parent=parent )
- interfaces.finalizable_t.__init__( self )
self._wrapper = wrapper
--- 17,20 ----
***************
*** 66,94 ****
return isinstance( self.parent, class_declaration.class_t )
- ##May be in future I will enable this functionality again, right now it seems
- ##that this is useless
- ##def is_finalizable(self):
- ##if not self.wrapper:
- ##return False
- ##return self.declaration.virtuality != declarations.VIRTUALITY_TYPES.PURE_VIRTUAL
-
- ##def finalize( self ):
- ##if not self.wrapper:
- ##return
- ##if self.declaration.virtuality == declarations.VIRTUALITY_TYPES.PURE_VIRTUAL:
- ##raise interfaces.finalize_error_t( 'Unable to finalize pure virtual function "%s".'
- ##% declarations.full_name( self.declaration ) )
-
- ##if ( declarations.ACCESS_TYPES.PROTECTED == self.declaration.access_type
- ##and declarations.VIRTUALITY_TYPES.NOT_VIRTUAL == self.declaration.virtuality ) \
- ##or declarations.ACCESS_TYPES.PUBLIC != self.declaration.access_type:
- ###TODO: add this comment to documentation
- ###The logic is simple if user finalize non public function it means
- ###that he does not want ro expose this function at all, otherwise he
- ###will get compilation error.
- ##self.parent.remove_creator( self )
- ##self.wrapper.parent.remove_creator( self.wrapper )
- ##self.wrapper = None
-
def _generate_functions_ref( self ):
result = []
--- 64,67 ----
***************
*** 471,480 ****
return os.linesep.join( answer )
! class constructor_t( declaration_based.declaration_based_t, interfaces.finalizable_t ):
def __init__(self, constructor, wrapper=None, parent=None ):
declaration_based.declaration_based_t.__init__( self
, declaration=constructor
, parent=parent )
- interfaces.finalizable_t.__init__( self )
self._wrapper = wrapper
--- 444,452 ----
return os.linesep.join( answer )
! class constructor_t( declaration_based.declaration_based_t ):
def __init__(self, constructor, wrapper=None, parent=None ):
declaration_based.declaration_based_t.__init__( self
, declaration=constructor
, parent=parent )
self._wrapper = wrapper
***************
*** 503,518 ****
use_default_arguments = property( _get_use_default_arguments, _set_use_default_arguments )
-
- ##def is_finalizable(self):
- ##return bool( self.wrapper )
-
- ##def finalize( self ):
- ##if not self.wrapper:
- ##return
- ##if declarations.ACCESS_TYPES.PROTECTED == self.declaration.access_type:
- ##self.parent.remove_creator( self )
- ##self.wrapper.parent.remove_creator( self.wrapper )
- ##self.wrapper = None
-
def _keywords_args(self):
if not self.declaration.arguments:
--- 475,478 ----
|