sbuild  1.7.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
sbuild::chroot::facet::facet Class Referenceabstract

Base class for all facets. More...

#include <facet.h>

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

Public Types

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 ~facet ()
 The destructor.
 
virtual ptr clone () const =0
 Copy the chroot facet. More...
 
virtual std::string const & get_name () const =0
 Get the name of the chroot facet. More...
 
virtual void setup_env (environment &env) const
 Set environment. More...
 
virtual session_flags get_session_flags () const
 Get the session flags of the chroot. 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...
 

Protected Member Functions

 facet ()
 The constructor.
 
virtual void set_chroot (chroot &chroot, bool copy=false)
 Set containing chroot. More...
 

Protected Attributes

chrootowner
 Chroot owning this facet.
 

Friends

class ::sbuild::chroot::chroot
 

Detailed Description

Base class for all facets.

This class provides the basic interfaces and properties required for all facets. All facets must be derived from this type. Note that this class can not be used independently of a chroot, and most methods can not be called until the instance is installed in a chroot instance using chroot::add_facet() or related methods.

Member Enumeration Documentation

Chroot session properties.

Enumerator
SESSION_NOFLAGS 

No flags are set.

SESSION_CREATE 

The chroot supports session creation.

SESSION_CLONE 

The chroot supports cloning.

SESSION_PURGE 

The chroot should be purged.

Member Function Documentation

virtual ptr sbuild::chroot::facet::facet::clone ( ) const
pure virtual
void sbuild::chroot::facet::facet::get_details ( format_detail detail) const
virtual
void sbuild::chroot::facet::facet::get_keyfile ( keyfile keyfile) const
virtual
std::string const & sbuild::chroot::facet::facet::get_name ( ) const
pure virtual
facet::session_flags sbuild::chroot::facet::facet::get_session_flags ( ) const
virtual

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Parameters
chrootthe chroot to use.
Returns
the session flags.

Reimplemented in sbuild::chroot::facet::fsunion, sbuild::chroot::facet::source_clonable, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::file, sbuild::chroot::facet::custom, sbuild::chroot::facet::lvm_snapshot, and sbuild::chroot::facet::session_clonable.

References SESSION_NOFLAGS.

void sbuild::chroot::facet::facet::get_used_keys ( string_list used_keys) const
virtual
void sbuild::chroot::facet::facet::set_chroot ( chroot chroot,
bool  copy = false 
)
protectedvirtual

Set containing chroot.

The copy parameter is used to inform the facet if it is new or a copy; this is intended to allow additional facets to only be added if the facet is new, for example, to avoid re-adding removed facets when copying a chroot.

Parameters
chrootthe chroot containing this facet.
copytrue if the facet has been copied, or false if this is a new instance.

Reimplemented in sbuild::chroot::facet::block_device_base, sbuild::chroot::facet::custom, sbuild::chroot::facet::block_device, sbuild::chroot::facet::btrfs_snapshot, sbuild::chroot::facet::directory, sbuild::chroot::facet::file, sbuild::chroot::facet::loopback, and sbuild::chroot::facet::lvm_snapshot.

References owner.

Referenced by sbuild::chroot::facet::file::set_chroot(), sbuild::chroot::facet::loopback::set_chroot(), sbuild::chroot::facet::directory::set_chroot(), sbuild::chroot::facet::btrfs_snapshot::set_chroot(), sbuild::chroot::facet::custom::set_chroot(), and sbuild::chroot::facet::block_device_base::set_chroot().

+ Here is the caller graph for this function:

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

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