41 #include "qofevent-p.h" 50 coll_destroy (gpointer col)
62 g_hash_table_new_full (g_str_hash, g_str_equal,
65 book->
data_tables = g_hash_table_new (g_str_hash, g_str_equal);
67 g_hash_table_new (g_str_hash, g_str_equal);
84 LEAVE (
"book=%p", book);
89 book_final (gpointer key, gpointer value, gpointer booq)
91 QofBookFinalCB cb = value;
94 gpointer user_data = g_hash_table_lookup (book->
data_tables, key);
95 (*cb) (book, key, user_data);
103 ENTER (
"book=%p", book);
110 qof_object_book_end (book);
119 LEAVE (
"book=%p", book);
127 if (book_1 == book_2)
129 if (!book_1 || !book_2)
140 return (book->
inst.dirty || qof_object_is_dirty (book));
149 book->
inst.dirty = FALSE;
150 qof_object_mark_clean (book);
174 ENTER (
"book=%p be=%p", book, be);
184 book->
inst.dirty = TRUE;
195 g_hash_table_insert (book->
data_tables, (gpointer) key, data);
200 gpointer data, QofBookFinalCB cb)
204 g_hash_table_insert (book->
data_tables, (gpointer) key, data);
216 return g_hash_table_lookup (book->
data_tables, (gpointer) key);
224 if (!book || !entity_type)
243 foreach_cb (gpointer key __attribute__ ((unused)), gpointer item, gpointer arg)
245 struct _iterate *qiter = arg;
248 qiter->fn (col, qiter->data);
252 qof_book_foreach_collection (
QofBook * book,
255 struct _iterate qiter;
257 g_return_if_fail (book);
258 g_return_if_fail (cb);
260 qiter.data = user_data;
305 qof_book_set_version (
QofBook * book, gint32 version)
307 if (!book && version < 0)
315 qof_book_set_idata (
QofBook * book, guint32 idata)
317 if (!book && idata == 0)
334 PWARN (
"No book!!!");
337 if (!counter_name || *counter_name ==
'\0')
339 PWARN (
"Invalid counter name.");
344 if (be && be->counter)
345 return ((be->counter) (be, counter_name));
350 PWARN (
"Book has no KVP_Frame");
367 value = kvp_value_new_gint64 (counter);
379 {QOF_PARAM_GUID, QOF_TYPE_GUID,
385 {NULL, NULL, NULL, NULL, NULL},
GHashTable * hash_of_collections
gint32 qof_book_get_version(QofBook *book)
QofCollection * qof_book_get_collection(QofBook *book, QofIdType entity_type)
void qof_book_mark_saved(QofBook *book)
void(* QofCollectionForeachCB)(QofCollection *, gpointer user_data)
gboolean qof_book_equal(QofBook *book_1, QofBook *book_2)
gboolean qof_book_register(void)
void qof_object_book_begin(QofBook *book)
#define QOF_EVENT_DESTROY
gpointer qof_book_get_data(QofBook *book, const gchar *key)
void qof_class_register(QofIdTypeConst obj_name, QofSortFunc default_sort_function, const QofParam *params)
registers a new object class with the Qof subsystem.
struct _KvpFrame KvpFrame
QofBook * qof_book_new(void)
void qof_book_mark_closed(QofBook *book)
void kvp_frame_set_slot_path(KvpFrame *frame, const KvpValue *new_value, const gchar *first_key,...)
gint64 qof_book_get_counter(QofBook *book, const gchar *counter_name)
#define LEAVE(format, args...)
Private QofBook interface.
void qof_event_gen(QofEntity *entity, QofEventId event_id, gpointer event_data)
Invoke all registered event handlers using the given arguments.
the Core Object Registration/Lookup Private Interface
gint64 kvp_value_get_gint64(const KvpValue *value)
struct QofCollection_s QofCollection
struct _KvpValue KvpValue
GHashTable * data_table_finalizers
guint32 qof_book_get_idata(QofBook *book)
KvpFrame * qof_instance_get_slots(QofInstance *inst)
gpointer qof_util_string_cache_insert(gconstpointer key)
void qof_util_string_cache_remove(gconstpointer key)
void qof_book_set_backend(QofBook *book, QofBackend *be)
Set the backend used by this book.
gboolean qof_book_not_saved(QofBook *book)
void qof_book_set_data_fin(QofBook *book, const gchar *key, gpointer data, QofBookFinalCB cb)
gboolean qof_book_shutting_down(QofBook *book)
void qof_book_set_data(QofBook *book, const gchar *key, gpointer data)
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
KvpValue * kvp_frame_get_slot_path(KvpFrame *frame, const gchar *first_key,...)
gchar qof_book_get_open_marker(QofBook *book)
void qof_book_kvp_changed(QofBook *book)
private api for data storage backend
#define PWARN(format, args...)
void qof_collection_destroy(QofCollection *col)
const GUID * qof_entity_get_guid(QofEntity *ent)
QofCollection * qof_collection_new(QofIdType type)
void qof_instance_release(QofInstance *inst)
QofBackend * qof_book_get_backend(QofBook *book)
Retrieve the backend used by this book.
void qof_instance_init(QofInstance *inst, QofIdType type, QofBook *book)
void kvp_value_delete(KvpValue *value)
#define qof_book_get_slots(book)
#define ENTER(format, args...)
const gchar * QofLogModule
void qof_book_destroy(QofBook *book)