25 DatabaseCallback dbcb;
28 static DatabaseCallback MARKED_DELETED;
48 return type == other.type && dbcb.same_function_as(other.dbcb);
51 return type == other.type && dbcb == other.dbcb;
69 #if defined(ASSERTION_USED)
73 bool empty()
const {
return callbacks.empty(); }
75 void add(
const CB& newcb) {
82 template <
typename PRED>
84 bool prev_running =
false;
86 for (itertype
cb = callbacks.begin();
cb != callbacks.end(); ) {
87 bool this_running =
cb->running;
89 if (shallRemove(*
cb)) {
90 if (prev_running || this_running) {
91 cb->spec.mark_for_removal();
95 cb = callbacks.erase(
cb);
101 prev_running = this_running;
117 running(other.running)
135 spec(with, matchingType);
151 bool need_del =
false;
154 need_del =
cb->call(with, typemask) || need_del;
195 #error gb_cb.h included twice
listtype::iterator itertype
const CB * get_tail() const
void add_unchecked(const CB &cb)
bool contains_unremoved_callback(const CB &like) const
bool is_marked_for_removal() const
void gb_add_ref_gb_transaction_save(gb_transaction_save *ts)
bool call(GBDATA *with, GB_CB_TYPE typemask)
bool is_equal_to(const TypedDatabaseCallback &other) const
gb_transaction_save * old
gb_callback(const gb_callback &other)
TypedDatabaseCallback spec
bool may_be_removed() const
TypedDatabaseCallback(const DatabaseCallback &cb, GB_CB_TYPE type_)
bool sig_is_equal_to(const TypedDatabaseCallback &other) const
void call_and_forget(GB_CB_TYPE allowedTypes)
void remove_callbacks_that(PRED shallRemove)
DECLARE_ASSIGNMENT_OPERATOR(gb_callback)
GB_CB_TYPE get_type() const
DECLARE_ASSIGNMENT_OPERATOR(gb_triggered_callback)
gb_triggered_callback(const gb_triggered_callback &other)
TypedDatabaseCallback with_type_changed_to(GB_CB_TYPE type_) const
bool call(GBDATA *with, GB_CB_TYPE typemask)
void operator()(GBDATA *gbd, GB_CB_TYPE type_) const
gb_callback(const TypedDatabaseCallback &spec_)
listtype::const_iterator const_itertype
gb_triggered_callback(GBDATA *gbd_, gb_transaction_save *old_, const TypedDatabaseCallback &spec_)
void gb_del_ref_gb_transaction_save(gb_transaction_save *ts)
TypedDatabaseCallback spec
void add(const CB &newcb)
std::list< cbtype > listtype