ARB
Classes | Macros | Functions | Variables
ad_cb.cxx File Reference
#include "ad_cb.h"
#include "ad_hcb.h"
#include "gb_compress.h"
#include "gb_ta.h"
#include "gb_ts.h"
#include <arb_strarray.h>
#include <arb_strbuf.h>
Include dependency graph for ad_cb.cxx:

Go to the source code of this file.

Classes

struct  ShallBeDeleted
 
struct  IsCallback
 
struct  IsSpecificCallback
 
struct  IsSpecificHierarchyCallback
 

Macros

#define INVALIDATE_IF(cond)   do{ if (cond) { invalidate(); return; } }while(0)
 
#define appendcbtype(cbt)
 
#define CHECK_HIER_CB_CONDITION()
 

Functions

static void dummy_db_cb (GBDATA *, GB_CB_TYPE)
 
GB_MAIN_TYPEgb_get_main_during_cb ()
 
NOT4PERL bool GB_inside_callback (GBDATA *of_gbd, GB_CB_TYPE cbtype)
 
GBDATAGB_get_gb_main_during_cb ()
 
static GB_CSTR gb_read_pntr_ts (GBDATA *gbd, gb_transaction_save *ts)
 
NOT4PERL const void * GB_read_old_value ()
 
long GB_read_old_size ()
 
charcbtype2readable (GB_CB_TYPE type)
 
charGB_get_callback_info (GBDATA *gbd)
 
template<typename PRED >
void gb_remove_callbacks_that (GBDATA *gbd, PRED shallRemove)
 
void gb_remove_callbacks_marked_for_deletion (GBDATA *gbd)
 
void add_to_callback_chain (gb_callback_list *&head, const TypedDatabaseCallback &cbs)
 
void add_to_callback_chain (gb_hierarchy_callback_list *&head, const TypedDatabaseCallback &cbs, const gb_hierarchy_location &loc)
 
GB_ERROR gb_add_callback (GBDATA *gbd, const TypedDatabaseCallback &cbs)
 
GB_ERROR GB_add_callback (GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
 
void GB_remove_callback (GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
 
void GB_remove_all_callbacks_to (GBDATA *gbd, GB_CB_TYPE type, GB_CB func)
 
GB_ERROR GB_add_hierarchy_callback (GBDATA *gb_main, const char *db_path, GB_CB_TYPE type, const DatabaseCallback &dbcb)
 
GB_ERROR GB_remove_hierarchy_callback (GBDATA *gb_main, const char *db_path, GB_CB_TYPE type, const DatabaseCallback &dbcb)
 
GB_ERROR GB_ensure_callback (GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
 
void GB_atclose_callback (GBDATA *gbd, const DatabaseCallback &atClose)
 

Variables

static gb_triggered_callbackcurrently_called_back = NULp
 
static GB_MAIN_TYPEinside_callback_main = NULp
 

Macro Definition Documentation

#define INVALIDATE_IF (   cond)    do{ if (cond) { invalidate(); return; } }while(0)
#define appendcbtype (   cbt)
Value:
do { \
if (type&cbt) { \
septype.put(#cbt); \
} \
} while(0)
GB_TYPES type
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163
GB_CB_TYPE
Definition: arbdb_base.h:46

Referenced by cbtype2readable().

#define CHECK_HIER_CB_CONDITION ( )
Value:
if (get_transaction_level()<0) return "no hierarchy callbacks allowed in NO_TRANSACTION_MODE"; \
if (!loc.is_valid()) return "invalid hierarchy location"
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163

Definition at line 378 of file ad_cb.cxx.

Referenced by GB_MAIN_TYPE::add_hierarchy_cb(), and GB_MAIN_TYPE::remove_hierarchy_cb().

Function Documentation

static void dummy_db_cb ( GBDATA ,
GB_CB_TYPE   
)
static

Definition at line 105 of file ad_cb.cxx.

References gb_assert.

GB_MAIN_TYPE* gb_get_main_during_cb ( void  )
NOT4PERL bool GB_inside_callback ( GBDATA of_gbd,
GB_CB_TYPE  cbtype 
)
GBDATA* GB_get_gb_main_during_cb ( void  )
static GB_CSTR gb_read_pntr_ts ( GBDATA gbd,
gb_transaction_save ts 
)
static
NOT4PERL const void* GB_read_old_value ( void  )
long GB_read_old_size ( void  )
char* cbtype2readable ( GB_CB_TYPE  type)
inline
char* GB_get_callback_info ( GBDATA gbd)
template<typename PRED >
void gb_remove_callbacks_that ( GBDATA gbd,
PRED  shallRemove 
)
inline
void gb_remove_callbacks_marked_for_deletion ( GBDATA gbd)

Definition at line 295 of file ad_cb.cxx.

References gb_remove_callbacks_that().

Referenced by gb_do_callbacks().

void add_to_callback_chain ( gb_callback_list *&  head,
const TypedDatabaseCallback cbs 
)
inline

Definition at line 319 of file ad_cb.cxx.

References CallbackList< CB >::add().

Referenced by gb_add_callback(), and GB_atclose_callback().

void add_to_callback_chain ( gb_hierarchy_callback_list *&  head,
const TypedDatabaseCallback cbs,
const gb_hierarchy_location loc 
)
inline

Definition at line 323 of file ad_cb.cxx.

References CallbackList< CB >::add().

GB_ERROR gb_add_callback ( GBDATA gbd,
const TypedDatabaseCallback cbs 
)
inline
GB_ERROR GB_add_callback ( GBDATA gbd,
GB_CB_TYPE  type,
const DatabaseCallback &  dbcb 
)
void GB_remove_callback ( GBDATA gbd,
GB_CB_TYPE  type,
const DatabaseCallback &  dbcb 
)
void GB_remove_all_callbacks_to ( GBDATA gbd,
GB_CB_TYPE  type,
GB_CB  func 
)

Definition at line 364 of file ad_cb.cxx.

References gb_remove_callbacks_that().

Referenced by flush_taxonomy_cb(), and get_cached_taxonomy().

GB_ERROR GB_add_hierarchy_callback ( GBDATA gb_main,
const char db_path,
GB_CB_TYPE  type,
const DatabaseCallback &  dbcb 
)

same as overloaded GB_add_hierarchy_callback(), but using db_path instead of GBDATA to define hierarchy location. If the path starts with '/', the full path has to match to trigger the callback. Otherwise only the given path has to match (from bottom up), e.g. "gb_group" will trigger on any "gb_group" entry (regardless of its parent-path).

Definition at line 432 of file ad_cb.cxx.

References GB_MAIN_TYPE::add_hierarchy_cb(), and GB_MAIN().

Referenced by install_config_change_callbacks().

GB_ERROR GB_remove_hierarchy_callback ( GBDATA gb_main,
const char db_path,
GB_CB_TYPE  type,
const DatabaseCallback &  dbcb 
)

same as overloaded GB_remove_hierarchy_callback(), but using db_path instead of GBDATA to define hierarchy location

Definition at line 440 of file ad_cb.cxx.

References GB_MAIN(), and GB_MAIN_TYPE::remove_hierarchy_cb().

GB_ERROR GB_ensure_callback ( GBDATA gbd,
GB_CB_TYPE  type,
const DatabaseCallback &  dbcb 
)
void GB_atclose_callback ( GBDATA gbd,
const DatabaseCallback &  atClose 
)

Add a callback, which gets called directly before GB_close destroys all data. This is the recommended way to remove all callbacks from DB elements.

Definition at line 458 of file ad_cb.cxx.

References add_to_callback_chain(), GB_MAIN_TYPE::close_callbacks, GB_CB_DELETE, and GB_MAIN().

Referenced by GroupUIdata::GroupUIdata(), keepQuery(), mark_as_macro_executor(), start_SECEDIT_plugin(), and TreeAwarRegistry::TreeAwarRegistry().

Variable Documentation

gb_triggered_callback* currently_called_back = NULp
static

Definition at line 20 of file ad_cb.cxx.

GB_MAIN_TYPE* inside_callback_main = NULp
static

Definition at line 21 of file ad_cb.cxx.

Referenced by gb_get_main_during_cb().