summaryrefslogtreecommitdiff
path: root/src/numerics/commodity.h
diff options
context:
space:
mode:
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;
};