paludis Version 3.0.2
The one true package mangler
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< Environment > create (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)
const Singleton & operator= (const Singleton &)=delete

Friends

class Singleton< EnvironmentFactory >

Additional Inherited Members

static EnvironmentFactory * get_instance () PALUDIS_ATTRIBUTE((warn_unused_result))
static void destroy_instance ()

Detailed Description

Factory for Environment creation.

Since
0.30

Member Function Documentation

◆ add_environment_format()

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.

◆ 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).

References PALUDIS_ATTRIBUTE.


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