paludis  Version 2.6.0
Public Types | Public Member Functions | Friends | List of all members
paludis::EnvironmentFactory Class Reference

#include <environment_factory.hh>

+ Inheritance diagram for paludis::EnvironmentFactory:

Public Types

typedef std::function< const std::shared_ptr< Environment >const std::string &)> CreateFunction
 

Public Member Functions

const std::shared_ptr< Environmentcreate (const std::string &spec) const PALUDIS_ATTRIBUTE((warn_unused_result))
 
void add_environment_format (const std::shared_ptr< const Set< std::string > > &formats, const CreateFunction &create_function)
 
- Public Member Functions inherited from paludis::Singleton< EnvironmentFactory >
 Singleton ()=default
 
 Singleton (const Singleton &)=delete
 
const Singletonoperator= (const Singleton &)=delete
 

Friends

class Singleton< EnvironmentFactory >
 

Additional Inherited Members

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

Detailed Description

Factory for Environment creation.

Since
0.30

Member Function Documentation

void paludis::EnvironmentFactory::add_environment_format ( const std::shared_ptr< const Set< std::string > > &  formats,
const CreateFunction &  create_function 
)

Add a repository format.

Parameters
formatsmust have at least one value, and no value may be specified more than once across all invocations.
create_functionis used to implement EnvironmentFactory::create.
const std::shared_ptr<Environment> paludis::EnvironmentFactory::create ( const std::string &  spec) const

Create an Environment subclass from the specified spec.

Parameters
specThe environment spec, which is in the form env:suffix, where env is the string representing an Environment's kind (e.g. "paludis", "portage") and suffix is the information to pass to the constructing function (for paludis, a config suffix, and for portage, a location). If env is not specified, it defaults to trying paludis then portage. If suffix is not specified, it defaults to an empty string. If no colon is present, the supplied string is taken as env (this includes an empty string).

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