diff options
author | Roger Leigh <rleigh@debian.org> | 2009-07-18 23:40:08 +0100 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2009-07-18 23:40:08 +0100 |
commit | 1bfe9677972b48441909766740c9b05beccc7075 (patch) | |
tree | ab69069ea8fdc6dfe63b281be26492edd1a44656 /sbuild | |
parent | 8b194667255b47a2d44b8889764dbcc6c6b400c1 (diff) | |
download | schroot-1bfe9677972b48441909766740c9b05beccc7075.tar.gz |
[sbuild] define copy constructur in classes inheriting chroot_session
Since chroot_session is temporarily using virtual inheritance
until it can be refactored, copy constructurs much initialise
it first in the initialiser list or else it gets default
constructed.
Diffstat (limited to 'sbuild')
-rw-r--r-- | sbuild/sbuild-chroot-block-device.cc | 14 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-directory.cc | 9 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-directory.h | 3 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-file.cc | 11 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-file.h | 3 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-loopback.cc | 17 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-loopback.h | 3 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-lvm-snapshot.cc | 13 | ||||
-rw-r--r-- | sbuild/sbuild-chroot-lvm-snapshot.h | 3 |
9 files changed, 70 insertions, 6 deletions
diff --git a/sbuild/sbuild-chroot-block-device.cc b/sbuild/sbuild-chroot-block-device.cc index 827c9133..c9b17a53 100644 --- a/sbuild/sbuild-chroot-block-device.cc +++ b/sbuild/sbuild-chroot-block-device.cc @@ -32,6 +32,9 @@ using boost::format; using namespace sbuild; chroot_block_device::chroot_block_device (): +#ifdef SBUILD_FEATURE_UNION + chroot_session(), +#endif // SBUILD_FEATURE_UNION chroot_block_device_base() #ifdef SBUILD_FEATURE_UNION , chroot_union() @@ -44,13 +47,20 @@ chroot_block_device::~chroot_block_device () } chroot_block_device::chroot_block_device (const chroot_block_device& rhs): - chroot(rhs), +#ifdef SBUILD_FEATURE_UNION + chroot_session(rhs), +#endif // SBUILD_FEATURE_UNION chroot_block_device_base(rhs) +#ifdef SBUILD_FEATURE_UNION + , chroot_union(rhs) +#endif // SBUILD_FEATURE_UNION { } chroot_block_device::chroot_block_device (const chroot_lvm_snapshot& rhs): - chroot(rhs), +#ifdef SBUILD_FEATURE_UNION + chroot_session(rhs), +#endif // SBUILD_FEATURE_UNION chroot_block_device_base(rhs) { } diff --git a/sbuild/sbuild-chroot-directory.cc b/sbuild/sbuild-chroot-directory.cc index 7b0a89af..c923e478 100644 --- a/sbuild/sbuild-chroot-directory.cc +++ b/sbuild/sbuild-chroot-directory.cc @@ -40,6 +40,15 @@ chroot_directory::chroot_directory (): { } +chroot_directory::chroot_directory (const chroot_directory& rhs): + chroot_session(rhs), + chroot_directory_base(rhs) +#ifdef SBUILD_FEATURE_UNION + , chroot_union(rhs) +#endif // SBUILD_FEATURE_UNION +{ +} + chroot_directory::~chroot_directory () { } diff --git a/sbuild/sbuild-chroot-directory.h b/sbuild/sbuild-chroot-directory.h index cbb1bd6d..ca6c3057 100644 --- a/sbuild/sbuild-chroot-directory.h +++ b/sbuild/sbuild-chroot-directory.h @@ -42,6 +42,9 @@ namespace sbuild /// The constructor. chroot_directory (); + /// The copy constructor. + chroot_directory (const chroot_directory& rhs); + friend class chroot; public: diff --git a/sbuild/sbuild-chroot-file.cc b/sbuild/sbuild-chroot-file.cc index cd3332ee..365ddef7 100644 --- a/sbuild/sbuild-chroot-file.cc +++ b/sbuild/sbuild-chroot-file.cc @@ -31,14 +31,23 @@ using boost::format; using namespace sbuild; chroot_file::chroot_file (): - chroot(), chroot_session(), + chroot(), chroot_source(), file(), repack(false) { } +chroot_file::chroot_file (const chroot_file& rhs): + chroot_session(rhs), + chroot(rhs), + chroot_source(rhs), + file(rhs.file), + repack(rhs.repack) +{ +} + chroot_file::~chroot_file () { } diff --git a/sbuild/sbuild-chroot-file.h b/sbuild/sbuild-chroot-file.h index cbf38098..d32656c1 100644 --- a/sbuild/sbuild-chroot-file.h +++ b/sbuild/sbuild-chroot-file.h @@ -38,6 +38,9 @@ namespace sbuild /// The constructor. chroot_file (); + /// The copy constructor. + chroot_file (const chroot_file& rhs); + friend class chroot; public: diff --git a/sbuild/sbuild-chroot-loopback.cc b/sbuild/sbuild-chroot-loopback.cc index b8fc810a..163b9b18 100644 --- a/sbuild/sbuild-chroot-loopback.cc +++ b/sbuild/sbuild-chroot-loopback.cc @@ -32,10 +32,12 @@ using boost::format; using namespace sbuild; chroot_loopback::chroot_loopback (): +#ifdef SBUILD_FEATURE_UNION + chroot_session(), +#endif // SBUILD_FEATURE_UNION chroot(), chroot_mountable(), #ifdef SBUILD_FEATURE_UNION - chroot_session(), chroot_union(), #endif // SBUILD_FEATURE_UNION file() @@ -46,6 +48,19 @@ chroot_loopback::~chroot_loopback () { } +chroot_loopback::chroot_loopback (const chroot_loopback& rhs): +#ifdef SBUILD_FEATURE_UNION + chroot_session(rhs), +#endif // SBUILD_FEATURE_UNION + chroot(rhs), + chroot_mountable(rhs), +#ifdef SBUILD_FEATURE_UNION + chroot_union(rhs), +#endif // SBUILD_FEATURE_UNION + file(rhs.file) +{ +} + sbuild::chroot::ptr chroot_loopback::clone () const { diff --git a/sbuild/sbuild-chroot-loopback.h b/sbuild/sbuild-chroot-loopback.h index 5aa1992c..deb1c6da 100644 --- a/sbuild/sbuild-chroot-loopback.h +++ b/sbuild/sbuild-chroot-loopback.h @@ -48,6 +48,9 @@ namespace sbuild /// The constructor. chroot_loopback (); + /// The copy constructor. + chroot_loopback (const chroot_loopback& rhs); + friend class chroot; public: diff --git a/sbuild/sbuild-chroot-lvm-snapshot.cc b/sbuild/sbuild-chroot-lvm-snapshot.cc index 6e6b9aed..113d0f0b 100644 --- a/sbuild/sbuild-chroot-lvm-snapshot.cc +++ b/sbuild/sbuild-chroot-lvm-snapshot.cc @@ -1,4 +1,4 @@ -/* Copyright © 2005-2008 Roger Leigh <rleigh@debian.org> +/* Copyright © 2005-2009 Roger Leigh <rleigh@debian.org> * * schroot is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -33,14 +33,23 @@ using boost::format; using namespace sbuild; chroot_lvm_snapshot::chroot_lvm_snapshot (): - chroot_block_device_base(), chroot_session(), + chroot_block_device_base(), chroot_source(), snapshot_device(), snapshot_options() { } +chroot_lvm_snapshot::chroot_lvm_snapshot (const chroot_lvm_snapshot& rhs): + chroot_session(rhs), + chroot_block_device_base(rhs), + chroot_source(rhs), + snapshot_device(rhs.snapshot_device), + snapshot_options(rhs.snapshot_options) +{ +} + chroot_lvm_snapshot::~chroot_lvm_snapshot () { } diff --git a/sbuild/sbuild-chroot-lvm-snapshot.h b/sbuild/sbuild-chroot-lvm-snapshot.h index 0b66b002..277c45ae 100644 --- a/sbuild/sbuild-chroot-lvm-snapshot.h +++ b/sbuild/sbuild-chroot-lvm-snapshot.h @@ -39,6 +39,9 @@ namespace sbuild /// The constructor. chroot_lvm_snapshot (); + /// The copy constructor. + chroot_lvm_snapshot (const chroot_lvm_snapshot& rhs); + friend class chroot; public: |