sbuild  1.7.1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sbuild::chroot::facet::session Class Reference

Chroot support for sessions. More...

#include <session.h>

+ Inheritance diagram for sbuild::chroot::facet::session:
+ Collaboration diagram for sbuild::chroot::facet::session:

Public Types

typedef chroot::error error
 Exception type.
 
typedef std::shared_ptr< sessionptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const
session
const_ptr
 A shared_ptr to a const chroot facet object.
 
- Public Types inherited from sbuild::chroot::facet::facet
enum  session_flags { SESSION_NOFLAGS = 0, SESSION_CREATE = 1 << 0, SESSION_CLONE = 1 << 1, SESSION_PURGE = 1 << 2 }
 Chroot session properties. More...
 
typedef std::shared_ptr< facetptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const
facet
const_ptr
 A shared_ptr to a const chroot facet object.
 

Public Member Functions

virtual ~session ()
 The destructor.
 
virtual facet::ptr clone () const
 Copy the chroot facet. More...
 
virtual std::string const & get_name () const
 Get the name of the chroot facet. More...
 
std::string const & get_original_name () const
 Get the original name of the chroot (prior to session cloning). More...
 
void set_original_name (const std::string &name)
 Set the original name of the chroot (prior to session cloning). More...
 
std::string const & get_selected_name () const
 Get the selected name of the chroot (alias used). More...
 
void set_selected_name (const std::string &name)
 Set the selected name of the chroot (alias used). More...
 
void setup_session_info (bool start)
 Set up persistent session information. More...
 
virtual void setup_env (environment &env) const
 Set environment. More...
 
virtual void get_details (format_detail &detail) const
 Get detailed information about the chroot for output. More...
 
virtual void get_used_keys (string_list &used_keys) const
 Get a list of the keys used during keyfile parsing. More...
 
virtual void get_keyfile (keyfile &keyfile) const
 Copy the chroot properties into a keyfile. More...
 
virtual void set_keyfile (const keyfile &keyfile)
 Set the chroot properties from a keyfile. More...
 
- Public Member Functions inherited from sbuild::chroot::facet::facet
virtual ~facet ()
 The destructor.
 
virtual session_flags get_session_flags () const
 Get the session flags of the chroot. More...
 

Static Public Member Functions

static ptr create ()
 Create a chroot facet. More...
 

Private Member Functions

 session ()
 The constructor.
 

Private Attributes

std::string original_chroot_name
 Original chroot name prior to session cloning.
 
std::string selected_chroot_name
 Selected chroot name.
 

Additional Inherited Members

- Protected Member Functions inherited from sbuild::chroot::facet::facet
 facet ()
 The constructor.
 
virtual void set_chroot (chroot &chroot, bool copy=false)
 Set containing chroot. More...
 
- Protected Attributes inherited from sbuild::chroot::facet::facet
chrootowner
 Chroot owning this facet.
 

Detailed Description

Chroot support for sessions.

A chroot may offer a "session" facet to signal restorable or parallel chroot environment usage. The presence of this facet indicates that the chroot is an active session.

Member Function Documentation

facet::ptr sbuild::chroot::facet::session::clone ( ) const
virtual

Copy the chroot facet.

This is a virtual copy constructor.

Returns
a shared_ptr to the new copy of the chroot facet.

Implements sbuild::chroot::facet::facet.

References session().

session::ptr sbuild::chroot::facet::session::create ( )
static

Create a chroot facet.

Returns
a shared_ptr to the new chroot facet.

References session().

Referenced by sbuild::chroot::facet::session_clonable::clone_session().

+ Here is the caller graph for this function:

void sbuild::chroot::facet::session::get_details ( format_detail detail) const
virtual

Get detailed information about the chroot for output.

Parameters
detailthe details to output to.

Reimplemented from sbuild::chroot::facet::facet.

References sbuild::_(), sbuild::format_detail::add(), sbuild::chroot::chroot::get_name(), get_original_name(), get_selected_name(), and sbuild::chroot::facet::facet::owner.

void sbuild::chroot::facet::session::get_keyfile ( keyfile keyfile) const
virtual

Copy the chroot properties into a keyfile.

The keyfile group with the name of the chroot will be set; if it already exists, it will be removed before setting it.

Parameters
keyfilethe keyfile to use.

Reimplemented from sbuild::chroot::facet::facet.

References sbuild::chroot::chroot::get_name(), get_original_name(), get_selected_name(), sbuild::chroot::facet::facet::owner, and sbuild::keyfile::set_object_value().

std::string const & sbuild::chroot::facet::session::get_name ( ) const
virtual

Get the name of the chroot facet.

Returns
the chroot facet name.

Implements sbuild::chroot::facet::facet.

std::string const & sbuild::chroot::facet::session::get_original_name ( ) const

Get the original name of the chroot (prior to session cloning).

Returns
the name.

References original_chroot_name.

Referenced by get_details(), get_keyfile(), and setup_env().

+ Here is the caller graph for this function:

std::string const & sbuild::chroot::facet::session::get_selected_name ( ) const

Get the selected name of the chroot (alias used).

Returns
the name.

References selected_chroot_name.

Referenced by get_details(), get_keyfile(), and setup_env().

+ Here is the caller graph for this function:

void sbuild::chroot::facet::session::get_used_keys ( string_list used_keys) const
virtual

Get a list of the keys used during keyfile parsing.

Returns
a list of key names.

Reimplemented from sbuild::chroot::facet::facet.

void sbuild::chroot::facet::session::set_keyfile ( const keyfile keyfile)
virtual

Set the chroot properties from a keyfile.

The chroot name must have previously been set, so that the correct keyfile group may be determined.

Parameters
keyfilethe keyfile to get the properties from.

Reimplemented from sbuild::chroot::facet::facet.

References sbuild::chroot::chroot::get_name(), sbuild::keyfile::get_object_value(), sbuild::chroot::facet::facet::owner, sbuild::keyfile::PRIORITY_OPTIONAL, set_original_name(), and set_selected_name().

void sbuild::chroot::facet::session::set_original_name ( const std::string &  name)

Set the original name of the chroot (prior to session cloning).

This will also set the selected name.

Parameters
namethe name.

References original_chroot_name, and selected_chroot_name.

Referenced by set_keyfile().

+ Here is the caller graph for this function:

void sbuild::chroot::facet::session::set_selected_name ( const std::string &  name)

Set the selected name of the chroot (alias used).

Parameters
namethe name.

References sbuild::chroot::config::get_namespace(), and selected_chroot_name.

Referenced by set_keyfile().

+ Here is the caller graph for this function:

void sbuild::chroot::facet::session::setup_env ( environment env) const
virtual

Set environment.

Set the environment that the setup scripts will see during execution.

Parameters
envthe environment to set.

Reimplemented from sbuild::chroot::facet::facet.

References sbuild::environment::add(), get_original_name(), and get_selected_name().

void sbuild::chroot::facet::session::setup_session_info ( bool  start)

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