コード例 #1
0
ファイル: __init__.py プロジェクト: CTrauma/pypp11
 def print_( extmodule ):
     creators = filter( missing_call_policies._selector
                        , code_creators.make_flatten_generator( extmodule.creators ) )
     for creator in creators:
         print creator.declaration.__class__.__name__, ': ', declarations.full_name( creator.declaration )
         print '  *** MISSING CALL POLICY', creator.declaration.function_type().decl_string
         print 
コード例 #2
0
    def create(self, decl_headers=None):
        """
        create and return the module for the extension - code creators tree root.

        :param decl_headers: If None the headers for the wrapped decls are automatically found.
                             But you can pass a list of headers here to override that search.
        :rtype: :class:`code_creators.module_t`
        """
        # Invoke the appropriate visit_*() method on all decls
        for decl in self.__decls:
            self.curr_decl = decl
            declarations.apply_visitor(self, decl)
        for operator in self.__free_operators:
            self._adopt_free_operator(operator)
        self._treat_smart_pointers()
        if self.__enable_indexing_suite:
            self._treat_indexing_suite()
        for creator in code_creators.make_flatten_generator(self.__extmodule):
            creator.target_configuration = self.__target_configuration
        # last action.
        self._append_user_code()

        add_include = self.__extmodule.add_include
        # add system headers
        system_headers = self.__extmodule.get_system_files(recursive=True, unique=True, language="c++")
        map(lambda header: add_include(header, user_defined=False, system=True), system_headers)
        # add user defined header files
        if decl_headers is None:
            decl_headers = declarations.declaration_files(self.__decls)
        map(lambda header: add_include(header, user_defined=False, system=False), decl_headers)

        self.__dependencies_manager.inform_user()

        return self.__extmodule
コード例 #3
0
ファイル: __init__.py プロジェクト: tfepam/tce
 def print_( extmodule ):
     creators = filter( missing_call_policies._selector
                        , code_creators.make_flatten_generator( extmodule.creators ) )
     for creator in creators:
         print creator.declaration.__class__.__name__, ': ', declarations.full_name( creator.declaration )
         print '  *** MISSING CALL POLICY', creator.declaration.function_type().decl_string
         print 
コード例 #4
0
ファイル: bpcreator.py プロジェクト: chubbymaggie/pyplusplus
    def create(self, decl_headers=None):
        """
        create and return the module for the extension - code creators tree root.

        :param decl_headers: If None the headers for the wrapped decls are automatically found.
                             But you can pass a list of headers here to override that search.
        :rtype: :class:`code_creators.module_t`
        """
        # Invoke the appropriate visit_*() method on all decls
        for decl in self.__decls:
            self.curr_decl = decl
            declarations.apply_visitor(self, decl)
        for operator in self.__free_operators:
            self._adopt_free_operator(operator)
        self._treat_smart_pointers()
        if self.__enable_indexing_suite:
            self._treat_indexing_suite()
        for creator in code_creators.make_flatten_generator(self.__extmodule):
            creator.target_configuration = self.__target_configuration
        #last action.
        self._append_user_code()

        add_include = self.__extmodule.add_include
        #add system headers
        system_headers = self.__extmodule.get_system_files(recursive=True,
                                                           unique=True,
                                                           language='c++')
        map(
            lambda header: add_include(header, user_defined=False, system=True
                                       ), system_headers)
        #add user defined header files
        if decl_headers is None:
            decl_headers = declarations.declaration_files(self.__decls)
        map(
            lambda header: add_include(
                header, user_defined=False, system=False), decl_headers)

        self.__dependencies_manager.inform_user()

        return self.__extmodule
コード例 #5
0
ファイル: __init__.py プロジェクト: CTrauma/pypp11
 def exclude( extmodule ):
     creators = filter( missing_call_policies._selector
                        , code_creators.make_flatten_generator( extmodule.creators ) )
     for creator in creators:
         creator.parent.remove_creator( creator )
コード例 #6
0
 def exclude(extmodule):
     creators = list(
         filter(missing_call_policies._selector,
                code_creators.make_flatten_generator(extmodule.creators)))
     for creator in creators:
         creator.parent.remove_creator(creator)
コード例 #7
0
 def get_user_headers( self, creators ):
     headers = []
     for creator in code_creators.make_flatten_generator(creators):
         if isinstance( creator, code_creators.declaration_based_t ):
             headers.extend(creator.get_user_headers())
     return code_creators.code_creator_t.unique_headers( headers )