diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-23 21:08:42 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-23 21:08:42 -0400 |
commit | c57bfb72c3fd0c40bab1c47503c7f22c6a79a643 (patch) | |
tree | 4b3965e5df8bc9a5c58160f6ac8e08a542466df0 /autoxact.cc | |
parent | 02580c2efbad9b364ab0dfa535c5fe0577cb818d (diff) | |
download | fork-ledger-c57bfb72c3fd0c40bab1c47503c7f22c6a79a643.tar.gz fork-ledger-c57bfb72c3fd0c40bab1c47503c7f22c6a79a643.tar.bz2 fork-ledger-c57bfb72c3fd0c40bab1c47503c7f22c6a79a643.zip |
moved entry hooking mechanism to journal_t; further improvements to "entry"
Diffstat (limited to 'autoxact.cc')
-rw-r--r-- | autoxact.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/autoxact.cc b/autoxact.cc index cc07ad2f..4de8122d 100644 --- a/autoxact.cc +++ b/autoxact.cc @@ -2,10 +2,10 @@ namespace ledger { -void automated_transaction_t::extend_entry(entry_t * entry) +void automated_transaction_t::extend_entry(entry_t& entry) { - transactions_deque initial_xacts(entry->transactions.begin(), - entry->transactions.end()); + transactions_deque initial_xacts(entry.transactions.begin(), + entry.transactions.end()); for (transactions_deque::iterator i = initial_xacts.begin(); i != initial_xacts.end(); @@ -23,13 +23,13 @@ void automated_transaction_t::extend_entry(entry_t * entry) transaction_t * xact = new transaction_t((*t)->account, amt, (*t)->flags | TRANSACTION_AUTO); - entry->add_transaction(xact); + entry.add_transaction(xact); } } automated_transactions_t * current_auto_xacts = NULL; -bool handle_auto_xacts(entry_t * entry) +bool handle_auto_xacts(entry_t& entry) { if (current_auto_xacts && ! current_auto_xacts->automated_transactions.empty()) @@ -39,3 +39,17 @@ bool handle_auto_xacts(entry_t * entry) } } // namespace ledger + +#ifdef USE_BOOST_PYTHON + +#include <boost/python.hpp> +#include <Python.h> + +using namespace boost::python; +using namespace ledger; + +void export_autoxact() { + def("handle_auto_xacts", handle_auto_xacts); +} + +#endif // USE_BOOST_PYTHON |