22 #ifndef MAMA_PRICE_CPP_H__
23 #define MAMA_PRICE_CPP_H__
25 #include <mama/price.h>
27 static const int MAX_PRICE_STR_LEN = 32;
48 mamaPricePrecision precision = MAMA_PRICE_PREC_100);
57 bool operator== (
const MamaPrice& rhs)
const;
58 bool operator== (
double rhs)
const;
61 return ! operator== (rhs);
63 bool operator!= (
double rhs)
const
65 return ! operator== (rhs);
67 bool operator< (
const MamaPrice& rhs)
const;
68 bool operator< (
double rhs)
const;
69 bool operator> (
const MamaPrice& rhs)
const;
70 bool operator> (
double rhs)
const;
121 double compare (
const MamaPrice& rhs)
const;
125 void set (
double priceValue,
126 mamaPriceHints hints = 0);
127 void setValue (
double value);
128 void setPrecision (mamaPricePrecision precision);
129 void setHints (mamaPriceHints hints);
130 void setIsValidPrice (
bool valid);
132 double getValue ()
const;
133 mamaPricePrecision getPrecision ()
const;
134 mamaPriceHints getHints ()
const;
135 bool getIsValidPrice ()
const;
138 void setFromString (
const char* str);
139 void getAsString (
char* result,
140 mama_size_t maxLen)
const;
148 const char* getAsString ()
const;
159 bool isZero ()
const;
165 static mamaPricePrecision decimals2Precision (mama_i32_t places);
171 static mamaPricePrecision denom2Precision (mama_i32_t denominator);
176 static mama_i32_t precision2Decimals (mamaPricePrecision precision);
181 static mama_i32_t precision2Denom (mamaPricePrecision precision);
183 mamaPrice getCValue();
184 const mamaPrice getCValue()
const;
188 mutable char* mStrRep;
194 #endif // MAMA_PRICE_CPP_H__
Definition: MamaBasicSubscription.h:27
MamaPrice is a special data type for representing floating point numbers that often require special f...
Definition: MamaPrice.h:43
mamaPricePrecision getPrecision() const