paludis  Version 2.6.0
Public Types | Public Member Functions | Friends | List of all members
paludis::RepositoryFactory Class Reference
+ Inheritance diagram for paludis::RepositoryFactory:

Public Types

typedef std::function< std::string(const std::string &)> KeyFunction
 
typedef std::function< const std::shared_ptr< Repository > Environment *const, const KeyFunction &)> CreateFunction
 
typedef std::function< const std::shared_ptr< const RepositoryNameSet > const Environment *const, const KeyFunction &)> DependenciesFunction
 
typedef std::function< const RepositoryName(const Environment *const, const KeyFunction &)> NameFunction
 
typedef std::function< int(const Environment *const, const KeyFunction &)> ImportanceFunction
 
typedef WrappedForwardIterator< ConstIteratorTag, const std::string > ConstIterator
 

Public Member Functions

const std::shared_ptr< Repositorycreate (Environment *const env, const KeyFunction &key_function) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
const RepositoryName name (const Environment *const env, const KeyFunction &key_function) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
int importance (const Environment *const env, const KeyFunction &key_function) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
const std::shared_ptr< const RepositoryNameSetdependencies (const Environment *const env, const KeyFunction &key_function) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
void add_repository_format (const std::shared_ptr< const Set< std::string > > &formats, const NameFunction &name_function, const ImportanceFunction &importance_function, const CreateFunction &create_function, const DependenciesFunction &dependencies_function)
 
ConstIterator begin_keys () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
ConstIterator end_keys () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
- Public Member Functions inherited from paludis::Singleton< RepositoryFactory >
 Singleton ()=default
 
 Singleton (const Singleton &)=delete
 
const Singletonoperator= (const Singleton &)=delete
 

Friends

class Singleton< RepositoryFactory >
 

Additional Inherited Members

- Static Public Member Functions inherited from paludis::Singleton< RepositoryFactory >
static RepositoryFactoryget_instance () PALUDIS_ATTRIBUTE((warn_unused_result))
 
static void destroy_instance ()
 

Member Function Documentation

void paludis::RepositoryFactory::add_repository_format ( const std::shared_ptr< const Set< std::string > > &  formats,
const NameFunction &  name_function,
const ImportanceFunction &  importance_function,
const CreateFunction &  create_function,
const DependenciesFunction &  dependencies_function 
)

Add a repository format.

Parameters
formatsmust have at least one value, and no value may be specified more than once across all invocations.
name_functionis used to implement RepositoryFactory::name.
importance_functionis used to implement RepositoryFactory::importance.
create_functionis used to implement RepositoryFactory::create.
dependencies_functionis used to implement RepositoryFactory::dependencies.
const std::shared_ptr<Repository> paludis::RepositoryFactory::create ( Environment *const  env,
const KeyFunction &  key_function 
) const

Construct a given repository, or throw ConfigurationError.

If the repository to be created has dependencies upon another repository, that repository must have been created and added to the environment's package database first.

The returned repository is not added to the Environment's package database.

Parameters
key_functionshould return the value for a given key. The 'format' key must return a value (e.g. 'ebuild'), which is used to select the return type. The 'repo_name' key's value should be the file that best describes the location of the file containing the repository config, if such a file exists. Other key names are repository defined, but typically include things like 'location' and 'sync'.
const std::shared_ptr<const RepositoryNameSet> paludis::RepositoryFactory::dependencies ( const Environment *const  env,
const KeyFunction &  key_function 
) const

Fetch the names of any repositories depended upon by a particular repository.

See also
RepositoryFactory::create for parameter documentation.
int paludis::RepositoryFactory::importance ( const Environment *const  env,
const KeyFunction &  key_function 
) const

Find the importance of the repository that would be constructed if the supplied parameters were passed to RepositoryFactory::create.

See also
RepositoryFactory::create for parameter documentation.
const RepositoryName paludis::RepositoryFactory::name ( const Environment *const  env,
const KeyFunction &  key_function 
) const

Find the name of the repository that would be constructed if the supplied parameters were passed to RepositoryFactory::create.

See also
RepositoryFactory::create for parameter documentation.

The documentation for this class was generated from the following file: