sbuild  1.7.1
custom.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_CUSTOM_H
20 #define SBUILD_CHROOT_FACET_CUSTOM_H
21 
22 #include <sbuild/chroot/chroot.h>
23 #include <sbuild/chroot/facet/facet.h>
24 #include <sbuild/chroot/facet/storage.h>
25 
26 namespace sbuild
27 {
28  namespace chroot
29  {
30  namespace facet
31  {
32 
43  class custom : public facet,
44  public storage
45  {
46  public:
49 
51  typedef std::shared_ptr<custom> ptr;
52 
54  typedef std::shared_ptr<const custom> const_ptr;
55 
56  protected:
58  custom ();
59 
61  custom (const custom& rhs);
62 
63  void
65  bool copy);
66 
67  friend class chroot;
68 
69  public:
71  virtual ~custom ();
72 
73  virtual std::string const&
74  get_name () const;
75 
81  static ptr
82  create ();
83 
85  clone () const;
86 
94  void
95  set_session_cloneable (bool cloneable);
96 
104  void
105  set_session_purgeable (bool purgeable);
106 
112  bool
113  get_session_purgeable () const;
114 
122  void
123  set_source_cloneable (bool cloneable);
124 
125  std::string
126  get_path () const;
127 
128  virtual session_flags
129  get_session_flags () const;
130 
131  protected:
132  virtual void
133  setup_lock (chroot::setup_type type,
134  bool lock,
135  int status);
136 
137  virtual void
138  get_used_keys (string_list& used_keys) const;
139 
140  virtual void
141  get_keyfile (keyfile& keyfile) const;
142 
143  virtual void
144  set_keyfile (const keyfile& keyfile);
145 
146  private:
147  bool purgeable;
148  };
149 
150  }
151  }
152 }
153 
154 #endif /* SBUILD_CHROOT_FACET_CUSTOM_H */
155 
156 /*
157  * Local Variables:
158  * mode:C++
159  * End:
160  */