Disk ARchive  2.6.8
Full featured and portable backup and archiving tool
mem_ui.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2020 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21 
25 
26 #ifndef MEM_UI_HPP
27 #define MEM_UI_HPP
28 
29 #include "../my_config.h"
30 
31 #include "user_interaction.hpp"
32 #include <memory>
33 
34 namespace libdar
35 {
36 
39 
41 
53 
54  class mem_ui
55  {
56  public:
57 
59 
63  mem_ui(const std::shared_ptr<user_interaction> & dialog);
64 
66 
68  mem_ui(const mem_ui & ref) = default;
69 
71  mem_ui(mem_ui && ref) noexcept = default;
72 
74 
77  mem_ui & operator = (const mem_ui & ref) = default;
78 
80  mem_ui & operator = (mem_ui && ref) noexcept = default;
81 
82 
84 
87  virtual ~mem_ui() noexcept(false) {};
88 
89 
90  protected:
92 
95  user_interaction & get_ui() const { return *ui; };
96 
98  std::shared_ptr<user_interaction> get_pointer() const { return ui; };
99 
100  private:
101  std::shared_ptr<user_interaction> ui;
102  };
103 
105 
106 } // end of namespace
107 
108 
109 #endif
libdar::mem_ui::get_ui
user_interaction & get_ui() const
get access to the user_interaction object
Definition: mem_ui.hpp:95
libdar::user_interaction
This is a pure virtual class that is used by libdar when interaction with the user is required.
Definition: user_interaction.hpp:46
user_interaction.hpp
defines the interaction interface between libdar and users.
libdar::mem_ui::~mem_ui
virtual ~mem_ui() noexcept(false)
destructor
Definition: mem_ui.hpp:87
libdar::mem_ui
class mem_ui to keep a copy of a user_interaction object
Definition: mem_ui.hpp:54
libdar::mem_ui::mem_ui
mem_ui(const std::shared_ptr< user_interaction > &dialog)
constructor
libdar::mem_ui::get_pointer
std::shared_ptr< user_interaction > get_pointer() const
get access to the shared_ptr pointing to the user_interaction
Definition: mem_ui.hpp:98
libdar::mem_ui::operator=
mem_ui & operator=(const mem_ui &ref)=default
assignement operator
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:46