26 #ifndef STATISTICS_HPP
27 #define STATISTICS_HPP
29 #include "../my_config.h"
47 #define LOCK_IN pthread_mutex_lock(&lock_mutex)
48 #define LOCK_OUT pthread_mutex_unlock(&lock_mutex)
49 #define LOCK_IN_CONST pthread_mutex_lock(const_cast<pthread_mutex_t *>(&lock_mutex))
50 #define LOCK_OUT_CONST pthread_mutex_unlock(const_cast<pthread_mutex_t *>(&lock_mutex))
54 #define LOCK_IN_CONST //
55 #define LOCK_OUT_CONST //
80 const statistics & operator = (
const statistics & ref) { detruit(); copy_from(ref);
return *
this; };
91 void incr_treated() { (this->*increment)(&treated); };
107 void sub_from_ea_treated(
const infinint & val) { (this->*sub_from)(&ea_treated, val); };
108 void sub_from_hard_links(
const infinint & val) { (this->*sub_from)(&hard_links, val); };
109 void sub_from_fsa_treated(
const infinint & val) { (this->*sub_from)(&fsa_treated, val); };
111 infinint get_treated()
const {
return (this->*returned)(&treated); };
139 pthread_mutex_t lock_mutex;
162 void increment_locked(
infinint * var)
169 void increment_unlocked(infinint * var)
174 void add_to_locked(infinint * var,
const infinint & val)
181 void add_to_unlocked(infinint *var,
const infinint & val)
186 infinint returned_locked(
const infinint * var)
const
197 infinint returned_unlocked(
const infinint * var)
const
202 void decrement_locked(infinint * var)
209 void decrement_unlocked(infinint * var)
214 void set_to_locked(infinint *var,
const infinint & val)
221 void set_to_unlocked(infinint *var,
const infinint & val)
226 void sub_from_unlocked(infinint *var,
const infinint & val)
231 void sub_from_locked(infinint *var,
const infinint & val)
239 void init(
bool lock);
void decr_deleted()
decrement by one the errored counter
infinint get_skipped() const
returns the current value of the hard_links counter
infinint get_deleted() const
returns the current value of the errored counter
void decr_errored()
decrement by one the toold counter
void decr_skipped()
decrement by one the hard_links counter
void clear()
reset counters to zero
void decr_tooold()
decrement by one the ignored counter
infinint get_fsa_treated() const
returns the current value of the byte_amount counter
void incr_deleted()
increment by one the errored counter
infinint get_ea_treated() const
returns the current value of the deleted counter
void add_to_ignored(const infinint &val)
increment by one the fsa treated counter
void sub_from_treated(const infinint &val)
increment the byte amount counter by a given value
void decr_hard_links()
decrement by one the treated counter
This is a pure virtual class that is used by libdar when interaction with the user is required...
infinint get_tooold() const
returns the current value of the ignored counter
void incr_ea_treated()
increment by one the deleted counter
statistics(bool lock=true)
constructor
void add_to_deleted(const infinint &val)
increment the errored counter by a given value
infinint get_byte_amount() const
returns the current value of the ea_treated counter
void incr_fsa_treated()
increment by one the ea_treated counter
infinint total() const
total number of file treated
void decr_treated()
returns the current value of the fsa_treated counter
void dump(user_interaction &dialog) const
set to the given value the byte_amount counter
defines the interaction between libdar and the user.Three classes are defined
void incr_ignored()
increment by one the skipped counter
void decr_ea_treated()
decrement by one the deleted counter
void incr_skipped()
increment by one the hard_links counter
void add_to_byte_amount(const infinint &val)
increment the deleted counter by a given value
void incr_hard_links()
increment by one the treated counter
void decr_fsa_treated()
decrement by one the ea_treated counter
void incr_errored()
increment by one the tooold counter
void incr_tooold()
increment by one the ignored counter
switch module to limitint (32 ou 64 bits integers) or infinint
infinint get_ignored() const
returns the current value of the skipped counter
infinint get_hard_links() const
returns the current value of the treated counter
the arbitrary large positive integer class
void set_byte_amount(const infinint &val)
decrement by one the fsa_treated counter
void decr_ignored()
decrement by one the skipped counter
infinint get_errored() const
returns the current value of the tooold counter
structure returned by libdar call to give a summary of the operation done in term of file treated ...
void add_to_errored(const infinint &val)
increment the ignored counter by a given value