This is a pure virtual class that is used by libdar when interaction with the user is required.
More...
#include <user_interaction.hpp>
Inherited by , , libdar::user_interaction_blind, and libdar::user_interaction_blind.
|
|
| user_interaction (const user_interaction &ref)=default |
|
| user_interaction (user_interaction &&ref) noexcept=default |
|
user_interaction & | operator= (const user_interaction &ref)=default |
|
user_interaction & | operator= (user_interaction &&ref) noexcept=default |
|
void | message (const std::string &message) |
|
void | pause (const std::string &message) |
|
std::string | get_string (const std::string &message, bool echo) |
|
secu_string | get_secu_string (const std::string &message, bool echo) |
| virtual void | printf (const char *format,...) |
| | libdar uses this call to format output before sending to the message() method.
|
|
bool | cancellation_requested () const |
| | known whether cancellation was requested for the current thread or an added thread
|
| void | add_thread_to_monitor (pthread_t tid) |
| | add a thread to monitor
|
|
void | remove_thread_from_monitor (pthread_t tid) |
| | remove a thread from monitoring
|
|
| user_interaction (const user_interaction &ref)=default |
|
| user_interaction (user_interaction &&ref) noexcept=default |
|
user_interaction & | operator= (const user_interaction &ref)=default |
|
user_interaction & | operator= (user_interaction &&ref) noexcept=default |
|
void | message (const std::string &message) |
|
void | pause (const std::string &message) |
|
std::string | get_string (const std::string &message, bool echo) |
|
secu_string | get_secu_string (const std::string &message, bool echo) |
| virtual void | printf (const char *format,...) |
| | libdar uses this call to format output before sending to the message() method.
|
|
bool | cancellation_requested () const |
| | known whether cancellation was requested for the current thread or an added thread
|
| void | add_thread_to_monitor (pthread_t tid) |
| | add a thread to monitor
|
|
void | remove_thread_from_monitor (pthread_t tid) |
| | remove a thread from monitoring
|
This is a pure virtual class that is used by libdar when interaction with the user is required.
You can base your own class on it using C++ inheritance or use the predifined inherited classes user_interaction_callback which implements the interaction based on callback functions.
Definition at line 57 of file dar64-2.8.3-win64/include/dar/user_interaction.hpp.
◆ user_interaction() [1/2]
| libdar::user_interaction::user_interaction |
( |
| ) |
|
|
inline |
◆ user_interaction() [2/2]
| libdar::user_interaction::user_interaction |
( |
| ) |
|
|
inline |
◆ add_thread_to_monitor() [1/2]
| void libdar::user_interaction::add_thread_to_monitor |
( |
pthread_t | tid | ) |
|
add a thread to monitor
when a thread cancellation is requested for a thread libdar do no more pause() but assume negative answer and invoke message() with the context and question. However the user_interaction object may run in a different thread than a libdar thread, it is thus necessary to inform the user interaction object of the additional thread_id to monitor for thread cancellation request and adapt the behavior of this object. This is the purpose of this call, in addition to the thread the user_interaction is running in, at the time of any pause() request the user_interaction will call message() if the current thread or any of the added thread_id are under a cancellation request
◆ add_thread_to_monitor() [2/2]
| void libdar::user_interaction::add_thread_to_monitor |
( |
pthread_t | tid | ) |
|
add a thread to monitor
when a thread cancellation is requested for a thread libdar do no more pause() but assume negative answer and invoke message() with the context and question. However the user_interaction object may run in a different thread than a libdar thread, it is thus necessary to inform the user interaction object of the additional thread_id to monitor for thread cancellation request and adapt the behavior of this object. This is the purpose of this call, in addition to the thread the user_interaction is running in, at the time of any pause() request the user_interaction will call message() if the current thread or any of the added thread_id are under a cancellation request
◆ inherited_get_secu_string() [1/2]
| virtual secu_string libdar::user_interaction::inherited_get_secu_string |
( |
const std::string & | message, |
|
|
bool | echo ) |
|
protectedpure virtual |
◆ inherited_get_secu_string() [2/2]
| virtual secu_string libdar::user_interaction::inherited_get_secu_string |
( |
const std::string & | message, |
|
|
bool | echo ) |
|
protectedpure virtual |
◆ inherited_get_string() [1/2]
| virtual std::string libdar::user_interaction::inherited_get_string |
( |
const std::string & | message, |
|
|
bool | echo ) |
|
protectedpure virtual |
◆ inherited_get_string() [2/2]
| virtual std::string libdar::user_interaction::inherited_get_string |
( |
const std::string & | message, |
|
|
bool | echo ) |
|
protectedpure virtual |
◆ inherited_message() [1/2]
| virtual void libdar::user_interaction::inherited_message |
( |
const std::string & | message | ) |
|
|
protectedpure virtual |
◆ inherited_message() [2/2]
| virtual void libdar::user_interaction::inherited_message |
( |
const std::string & | message | ) |
|
|
protectedpure virtual |
◆ inherited_pause() [1/2]
| virtual bool libdar::user_interaction::inherited_pause |
( |
const std::string & | message | ) |
|
|
protectedpure virtual |
◆ inherited_pause() [2/2]
| virtual bool libdar::user_interaction::inherited_pause |
( |
const std::string & | message | ) |
|
|
protectedpure virtual |
◆ printf() [1/2]
| virtual void libdar::user_interaction::printf |
( |
const char * | format, |
|
|
| ... ) |
|
virtual |
libdar uses this call to format output before sending to the message() method.
This is not a virtual method, it has not to be overwritten, it is just a sublayer over warning() Supported masks for the format string are:
- %s %c %d %% (normal behavior)
- %i (matches infinint *)
- %S (matches std::string *)
◆ printf() [2/2]
| virtual void libdar::user_interaction::printf |
( |
const char * | format, |
|
|
| ... ) |
|
virtual |
libdar uses this call to format output before sending to the message() method.
This is not a virtual method, it has not to be overwritten, it is just a sublayer over warning() Supported masks for the format string are:
- %s %c %d %% (normal behavior)
- %i (matches infinint *)
- %S (matches std::string *)
The documentation for this class was generated from the following files: