Exemple #1
0
    def __init__( self, config, cache=None, decl_factory=None):
        """Constructor.

        config is a configuration object that contains the parameters
        for invoking gccxml. cache specifies the cache to use for
        caching declarations between separate runs. By default, no
        cache is used.  decl_factory is an object that must provide
        the same interface than
        L{decl_factory_t<declarations.decl_factory_t>}, i.e. there must
        be a set of C{create_*} methods that return an instance of an
        appropriate declaration class.  By default, the declaration
        classes defined in the L{declarations} package are used.

        @param config: Configuration object
        @type config: L{config_t}
        @param cache: Declaration cache (None=no cache)
        @type cache: L{cache_base_t} or str
        @param decl_factory: Custom declaration factory object or None
        @type decl_factory: decl_factory_t
        """
        self.__config = config
        self.__dcache = None
        if isinstance( cache, declarations_cache.cache_base_t ):
            self.__dcache = cache
        elif isinstance( cache, types.StringTypes ):
            self.__dcache = declarations_cache.file_cache_t(cache)
        else:
            self.__dcache = declarations_cache.dummy_cache_t()
        self.__decl_factory = decl_factory
        if not decl_factory:
            self.__decl_factory = pygccxml.declarations.decl_factory_t()

        self.logger = utils.loggers.gccxml
Exemple #2
0
    def __init__(self, config, cache=None, decl_factory=None):
        """Constructor.

        config is a configuration object that contains the parameters
        for invoking gccxml. cache specifies the cache to use for
        caching declarations between separate runs. By default, no
        cache is used.  decl_factory is an object that must provide
        the same interface than
        L{decl_factory_t<declarations.decl_factory_t>}, i.e. there must
        be a set of C{create_*} methods that return an instance of an
        appropriate declaration class.  By default, the declaration
        classes defined in the L{declarations} package are used.

        @param config: Configuration object
        @type config: L{config_t}
        @param cache: Declaration cache (None=no cache)
        @type cache: L{cache_base_t} or str
        @param decl_factory: Custom declaration factory object or None
        @type decl_factory: decl_factory_t
        """
        self.__config = config
        self.__dcache = None
        if isinstance(cache, declarations_cache.cache_base_t):
            self.__dcache = cache
        elif isinstance(cache, types.StringTypes):
            self.__dcache = declarations_cache.file_cache_t(cache)
        else:
            self.__dcache = declarations_cache.dummy_cache_t()
        self.__decl_factory = decl_factory
        if not decl_factory:
            self.__decl_factory = pygccxml.declarations.decl_factory_t()

        self.logger = utils.loggers.gccxml
Exemple #3
0
    def __init__( self, config, cache=None, decl_factory=None):
        """
        :param config: GCCXML configuration
        :type config: :class:config_t

        :param cache: declaration cache, by default a cache functionality will not be used
        :type cache: :class:`cache_base_t` instance or `str`

        :param decl_factory: declaration factory
        :type decl_factory: :class:`decl_factory_t`
        """
        self.__config = config
        self.__dcache = None
        if isinstance( cache, declarations_cache.cache_base_t ):
            self.__dcache = cache
        elif isinstance( cache, types.StringTypes ):
            self.__dcache = declarations_cache.file_cache_t(cache)
        else:
            self.__dcache = declarations_cache.dummy_cache_t()
        self.__decl_factory = decl_factory
        if not decl_factory:
            self.__decl_factory = pygccxml.declarations.decl_factory_t()

        self.logger = utils.loggers.gccxml