sbuild  1.6.4
sbuild-chroot-facet.h
1 /* Copyright © 2005-2009 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_H
20 #define SBUILD_CHROOT_FACET_H
21 
22 #include <sbuild/sbuild-environment.h>
23 #include <sbuild/sbuild-format-detail.h>
24 #include <sbuild/sbuild-keyfile.h>
25 #include <sbuild/sbuild-types.h>
26 #include <sbuild/sbuild-chroot.h>
27 
28 #include <string>
29 
30 namespace sbuild
31 {
32 
41  {
42  public:
44  typedef std::shared_ptr<chroot_facet> ptr;
45 
47  typedef std::shared_ptr<const chroot_facet> const_ptr;
48 
49  protected:
51  chroot_facet(): owner(0) {};
52 
58  void
60  {
61  this->owner = &chroot;
62  }
63 
64  friend class chroot;
65 
66  public:
68  virtual ~chroot_facet () {};
69 
75  virtual ptr
76  clone () const = 0;
77 
83  virtual std::string const&
84  get_name () const = 0;
85 
93  virtual void
94  setup_env (chroot const& chroot,
95  environment& env) const = 0;
96 
104  virtual chroot::session_flags
105  get_session_flags (chroot const& chroot) const = 0;
106 
113  virtual void
114  get_details (chroot const& chroot,
115  format_detail& detail) const = 0;
116 
125  virtual void
126  get_keyfile (chroot const& chroot,
127  keyfile& keyfile) const = 0;
128 
138  virtual void
140  keyfile const& keyfile,
141  string_list& used_keys) = 0;
142 
143  protected:
146  };
147 
148 }
149 
150 #endif /* SBUILD_CHROOT_FACET_H */
151 
152 /*
153  * Local Variables:
154  * mode:C++
155  * End:
156  */