summaryrefslogtreecommitdiff
path: root/src/numerics/commodity.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-23 00:36:26 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:39:07 -0400
commit84ead9153fe5d681276957688c5bf565bdf5b445 (patch)
treeecd0f330674f96a5557ae51ce6d45ef193693c9d /src/numerics/commodity.h
parent5054147043f10241ec11b41195ff682090edfd2a (diff)
downloadfork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.tar.gz
fork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.tar.bz2
fork-ledger-84ead9153fe5d681276957688c5bf565bdf5b445.zip
Just a few minor corrections.
Diffstat (limited to 'src/numerics/commodity.h')
-rw-r--r--src/numerics/commodity.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/numerics/commodity.h b/src/numerics/commodity.h
index 5389ed46..767023e8 100644
--- a/src/numerics/commodity.h
+++ b/src/numerics/commodity.h
@@ -39,14 +39,11 @@
* This file contains one of the most basic types in Ledger:
* commodity_t, and its annotated cousin, annotated_commodity_t.
*/
-
#ifndef _COMMODITY_H
#define _COMMODITY_H
namespace ledger {
-class annotated_commodity_t;
-
class commodity_t
: public delegates_flags<>,
public equality_comparable1<commodity_t, noncopyable>
@@ -128,9 +125,6 @@ public:
return *parent_;
}
- annotated_commodity_t& as_annotated();
- const annotated_commodity_t& as_annotated() const;
-
string base_symbol() const {
return base->symbol;
}
@@ -297,6 +291,16 @@ public:
const annotation_t& info);
};
+inline annotated_commodity_t&
+as_annotated_commodity(commodity_t& commodity) {
+ return downcast<annotated_commodity_t>(commodity);
+}
+inline const annotated_commodity_t&
+as_annotated_commodity(const commodity_t& commodity) {
+ return downcast<const annotated_commodity_t>(commodity);
+}
+
+
struct compare_amount_commodities {
bool operator()(const amount_t * left, const amount_t * right) const;
};