Disk ARchive
2.7.15
Full featured and portable backup and archiving tool
|
class mem_ui to keep a copy of a user_interaction object More...
#include <mem_ui.hpp>
Public Member Functions | |
mem_ui (const std::shared_ptr< user_interaction > &dialog) | |
constructor More... | |
mem_ui (const mem_ui &ref)=default | |
the copy constructor More... | |
mem_ui (mem_ui &&ref) noexcept=default | |
the move constructor | |
mem_ui & | operator= (const mem_ui &ref)=default |
assignement operator More... | |
mem_ui & | operator= (mem_ui &&ref) noexcept=default |
move operator | |
virtual | ~mem_ui () noexcept(false) |
destructor More... | |
Protected Member Functions | |
user_interaction & | get_ui () const |
get access to the user_interaction object More... | |
std::shared_ptr< user_interaction > | get_pointer () const |
get access to the shared_ptr pointing to the user_interaction | |
Private Attributes | |
std::shared_ptr< user_interaction > | ui |
class mem_ui to keep a copy of a user_interaction object
this class is targeted for inheritance (it is advised to use a "protected" inheritance, not a "public" one). Instead of having all the stuf of managing, cloning, releasing a pointer on user_interaction a class simply put itslef as inherited from mem_ui to take the benefit of this implementation, once and for all. Use this class with caution espetially for class which will generate a ton of objects, as this will duplicate the user_interaction object in the same number. sometimes it is more efficient to have the user_interaction object as parameter of the constructor, using it if necessary while constructing the object only. In that situation, if the user_interaction is not need any further after construction, no need to make the class inherit from mem_ui.
Definition at line 54 of file mem_ui.hpp.
libdar::mem_ui::mem_ui | ( | const std::shared_ptr< user_interaction > & | dialog | ) |
constructor
[in] | dialog | the user_interaction object to clone and store If you plan to use mem_ui, you should pass the user_interaction to its constructor for you later be able to call get_ui() at any time from the inherited class |
|
default |
the copy constructor
need to be called from the copy constructor of any inherited class that explicitely define one
|
inlinevirtualnoexcept |
destructor
it is declared as virtual, for precaution, as it may not be very frequent to release an object having just a mem_ui pointer on it.
Definition at line 87 of file mem_ui.hpp.
|
inlineprotected |
get access to the user_interaction object
Definition at line 94 of file mem_ui.hpp.
Referenced by libdar::crypto_asym::get_ui().
assignement operator
you need to call it from the inherited class assignement operator if the inherited class explicitely defines its own one.