sbuild  1.7.2
session-clonable.h
1 /* Copyright © 2005-2013 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_CHROOT_FACET_SESSION_CLONABLE_H
20 #define SBUILD_CHROOT_FACET_SESSION_CLONABLE_H
21 
22 #include <sbuild/chroot/facet/facet.h>
23 
24 namespace sbuild
25 {
26  namespace chroot
27  {
28  namespace facet
29  {
30 
38  class session_clonable : public facet
39  {
40  public:
42  typedef std::shared_ptr<session_clonable> ptr;
43 
45  typedef std::shared_ptr<const session_clonable> const_ptr;
46 
47  private:
50 
51  public:
53  virtual ~session_clonable ();
54 
60  static ptr
61  create ();
62 
63  virtual facet::ptr
64  clone () const;
65 
66  virtual std::string const&
67  get_name () const;
68 
69  virtual session_flags
70  get_session_flags () const;
71 
81  virtual chroot::ptr
82  clone_session (const std::string& session_id,
83  const std::string& alias,
84  const std::string& user,
85  bool root) const;
86  };
87 
88  }
89  }
90 }
91 
92 #endif /* SBUILD_CHROOT_FACET_SESSION_CLONABLE_H */
93 
94 /*
95  * Local Variables:
96  * mode:C++
97  * End:
98  */
Debian source builder components.
Definition: ctty.cc:31
virtual chroot::ptr clone_session(const std::string &session_id, const std::string &alias, const std::string &user, bool root) const
Clone a session chroot.
Definition: session-clonable.cc:87
virtual ~session_clonable()
The destructor.
Definition: session-clonable.cc:64
std::shared_ptr< session_clonable > ptr
A shared_ptr to a chroot facet object.
Definition: session-clonable.h:42
session_clonable()
The constructor.
Definition: session-clonable.cc:59
std::shared_ptr< const session_clonable > const_ptr
A shared_ptr to a const chroot facet object.
Definition: session-clonable.h:45
session_flags
Chroot session properties.
Definition: facet.h:54
Chroot support for creation of sessions.
Definition: session-clonable.h:38
Base class for all facets.
Definition: facet.h:50
static ptr create()
Create a chroot facet.
Definition: session-clonable.cc:69
std::shared_ptr< chroot > ptr
A shared_ptr to a chroot object.
Definition: chroot.h:103
virtual facet::ptr clone() const
Copy the chroot facet.
Definition: session-clonable.cc:75
std::shared_ptr< facet > ptr
A shared_ptr to a chroot facet object.
Definition: facet.h:63
virtual std::string const & get_name() const
Get the name of the chroot facet.
Definition: session-clonable.cc:81
virtual session_flags get_session_flags() const
Get the session flags of the chroot.
Definition: session-clonable.cc:169