summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-03 05:37:21 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-03 05:37:21 -0400
commit3a0f096cb64f581f0d8513c8b67ca41659982afa (patch)
treeff2a92227399554069911e88464da9d9b0916faf /src/account.cc
parent30479c0e1283201f905e2129970ad4784c9c5ba2 (diff)
downloadfork-ledger-3a0f096cb64f581f0d8513c8b67ca41659982afa.tar.gz
fork-ledger-3a0f096cb64f581f0d8513c8b67ca41659982afa.tar.bz2
fork-ledger-3a0f096cb64f581f0d8513c8b67ca41659982afa.zip
Added new "addr" value expression function
It returns the address of the given object as an integer. This can be used to uniquely compare entities.
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index 8d4341e7..e577c48e 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -218,6 +218,10 @@ namespace {
return true;
}
+ value_t get_addr(account_t& account) {
+ return long(&account);
+ }
+
value_t get_depth_spacer(account_t& account)
{
std::size_t depth = 0;
@@ -296,6 +300,8 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
return WRAP_FUNCTOR(get_wrapper<&get_account>);
else if (name == "account_base")
return WRAP_FUNCTOR(get_wrapper<&get_account_base>);
+ else if (name == "addr")
+ return WRAP_FUNCTOR(get_wrapper<&get_addr>);
else if (name == "any")
return WRAP_FUNCTOR(&fn_any);
else if (name == "all")