From 1e572d508d27738142dd5e80ea6745043eed8f18 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 12 Apr 2012 02:39:23 -0500 Subject: Add 'data' member to account/journal objects --- src/account.h | 17 ++++++++++++++--- src/xact.cc | 3 +++ src/xact.h | 8 ++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/account.h b/src/account.h index fd98a9ac..c0e3e1f7 100644 --- a/src/account.h +++ b/src/account.h @@ -70,13 +70,20 @@ public: optional value_expr; mutable string _fullname; +#ifdef DOCUMENT_MODEL + mutable void * data; +#endif account_t(account_t * _parent = NULL, const string& _name = "", const optional& _note = none) : supports_flags<>(), scope_t(), parent(_parent), name(_name), note(_note), - depth(static_cast(parent ? parent->depth + 1 : 0)) { + depth(static_cast(parent ? parent->depth + 1 : 0)) +#ifdef DOCUMENT_MODEL + , data(NULL) +#endif + { TRACE_CTOR(account_t, "account_t *, const string&, const string&"); } account_t(const account_t& other) @@ -85,10 +92,14 @@ public: name(other.name), note(other.note), depth(other.depth), - accounts(other.accounts) { + accounts(other.accounts) +#ifdef DOCUMENT_MODEL + , data(NULL) +#endif + { TRACE_CTOR(account_t, "copy"); } - ~account_t(); + virtual ~account_t(); virtual string description() { return string(_("account ")) + fullname(); diff --git a/src/xact.cc b/src/xact.cc index 8085b104..3f4b753c 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -487,6 +487,9 @@ bool xact_base_t::verify() xact_t::xact_t(const xact_t& e) : xact_base_t(e), code(e.code), payee(e.payee) +#ifdef DOCUMENT_MODEL + , data(NULL) +#endif { TRACE_CTOR(xact_t, "copy"); } diff --git a/src/xact.h b/src/xact.h index 0000e9c6..59430285 100644 --- a/src/xact.h +++ b/src/xact.h @@ -110,10 +110,14 @@ public: string payee; #ifdef DOCUMENT_MODEL - void * data; + mutable void * data; #endif - xact_t() { + xact_t() +#ifdef DOCUMENT_MODEL + : data(NULL) +#endif + { TRACE_CTOR(xact_t, ""); } xact_t(const xact_t& e); -- cgit v1.2.3