Loading...
Searching...
No Matches
libdar::mem_ui Class Reference
Private

class mem_ui to keep a copy of a user_interaction object More...

`#include <mem_ui.hpp>`

Inherited by libdar::archive::i_archive, libdar::catalogue, libdar::crypto_asym, libdar::database::i_database, libdar::entrepot_libssh, libdar::fichier_global, libdar::filesystem_hard_link_read`[protected]`, libdar::filesystem_hard_link_write`[protected]`, libdar::libdar_xform::i_libdar_xform, libdar::sar`[protected]`, libdar::semaphore, libdar::trivial_sar`[protected]`, libdar::tuyau`[protected]`, and libdar::zapette`[protected]`.

## Public Member Functions

| mem_ui (const std::shared_ptr< user_interaction > &dialog)
| constructor
| mem_ui (const mem_ui &ref)=default
| the copy constructor
| mem_ui (mem_ui &&ref) noexcept=default
| the move constructor
mem_ui & | operator= (const mem_ui &ref)=default
| assignement operator
mem_ui & | operator= (mem_ui &&ref) noexcept=default
| move operator
virtual | ~mem_ui () noexcept(false)
| destructor

## Protected Member Functions

user_interaction & | get_ui () const
| get access to the user_interaction object
std::shared_ptr< user_interaction > | get_pointer () const
| get access to the shared_ptr pointing to the user_interaction
void | change_ui (const std::shared_ptr< user_interaction > &new_dialog)
| change the user_interaction object

## Private Attributes

std::shared_ptr< user_interaction > | ui

## Detailed Description

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.

## Constructor & Destructor Documentation

## mem_ui() [1/2]

libdar::mem_ui::mem_ui | ( | const std::shared_ptr< user_interaction > & | dialog | ) |

constructor

Parameters

  [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

Referenced by libdar::crypto_asym::crypto_asym(), libdar::fichier_global::fichier_global(), mem_ui(), mem_ui(), operator=(), operator=(), and libdar::semaphore::semaphore().

## mem_ui() [2/2]

libdar::mem_ui::mem_ui | ( | const mem_ui & | ref | ) |

default

the copy constructor

need to be called from the copy constructor of any inherited class that explicitely define one

References mem_ui().

## ~mem_ui()

virtual libdar::mem_ui::~mem_ui | ( |  | ) |

inline virtual

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.

## Member Function Documentation

## change_ui()

void libdar::mem_ui::change_ui | ( | const std::shared_ptr< user_interaction > & | new_dialog | ) |

inline protected

change the user_interaction object

Definition at line 100 of file mem_ui.hpp.

## get_pointer()

std::shared_ptr< user_interaction > libdar::mem_ui::get_pointer | ( |  | ) | const

inline protected

get access to the shared_ptr pointing to the user_interaction

Definition at line 97 of file mem_ui.hpp.

## get_ui()

user_interaction & libdar::mem_ui::get_ui | ( |  | ) | const

inline protected

get access to the user_interaction object

Returns
  a reference to the clone object.

Definition at line 94 of file mem_ui.hpp.

Referenced by libdar::database::i_database::check_order(), and libdar::crypto_asym::get_ui().

## operator=()

mem_ui & libdar::mem_ui::operator= | ( | const mem_ui & | ref | ) |

default

assignement operator

you need to call it from the inherited class assignement operator if the inherited class explicitely defines its own one.

References mem_ui().

## Member Data Documentation

## ui

std::shared_ptr<user_interaction> libdar::mem_ui::ui

private

Definition at line 103 of file mem_ui.hpp.

The documentation for this class was generated from the following file:

- mem_ui.hpp