OpenMAMA
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
price.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamaPriceH__
23 #define MamaPriceH__
24 
25 #include <mama/config.h>
26 #include <mama/status.h>
27 #include <mama/types.h>
28 
29 
30 #if defined(__cplusplus)
31 extern "C" {
32 #endif
33 
34 
35 typedef enum mamaPricePrecision_
36 {
66 
68 #define MAMA_PRICE_HINTS_NONE ((mamaPriceHints)0x00)
69 
70 #define MAMA_PRICE_MAX_STR_LEN (32)
71 
72 
76 #define MAMA_PRICE_EPSILON ((mama_f64_t)0.00000000001)
77 
78 
84 MAMAExpDLL
85 extern mama_status
87 
93 MAMAExpDLL
94 extern mama_status
96 
102 MAMAExpDLL
103 extern mama_status
104 mamaPrice_clear (mamaPrice price);
105 
113 MAMAExpDLL
114 extern mama_status
116  const mamaPrice src);
117 
125 MAMAExpDLL
126 extern mama_status
128  const mamaPrice rhs);
129 
137 MAMAExpDLL
138 extern mama_status
140  const mamaPrice rhs);
141 
148 MAMAExpDLL
149 extern int
150 mamaPrice_equal (const mamaPrice lhs,
151  const mamaPrice rhs);
152 
161 MAMAExpDLL
162 extern double
163 mamaPrice_compare (const mamaPrice lhs,
164  const mamaPrice rhs);
165 
172 MAMAExpDLL
173 extern mama_status
175  double value);
176 
183 MAMAExpDLL
184 extern mama_status
186  mamaPricePrecision precision);
187 
194 MAMAExpDLL
195 extern mama_status
197  mama_bool_t valid);
198 
199 
206 MAMAExpDLL
207 extern mama_status
209  mamaPriceHints hints);
210 
218 MAMAExpDLL
219 extern mama_status
221  double value,
222  mamaPriceHints hints);
223 
231 MAMAExpDLL
232 extern mama_status
234  const char* str);
235 
242 MAMAExpDLL
243 extern mama_status
244 mamaPrice_getValue(const mamaPrice price,
245  double* value);
246 
257 MAMAExpDLL
260  const mamaPricePrecision precision,
261  double* value);
262 
269 MAMAExpDLL
270 extern mama_status
272  mamaPricePrecision* precision);
273 
280 MAMAExpDLL
281 extern mama_status
283  mama_bool_t* valid);
284 
291 MAMAExpDLL
292 extern mama_status
293 mamaPrice_getHints(const mamaPrice price,
294  mamaPriceHints* hints);
295 
303 MAMAExpDLL
304 extern mama_status
306  double* value,
307  mamaPricePrecision* precision);
308 
317 MAMAExpDLL
318 extern mama_status
319 mamaPrice_getAsString(const mamaPrice price,
320  char* str,
321  mama_size_t maxLen);
322 
326 MAMAExpDLL
327 extern mama_status
329 
334 MAMAExpDLL
335 extern mama_status
336 mamaPrice_isZero(const mamaPrice price,
337  mama_bool_t* result);
338 
343 MAMAExpDLL
344 extern mamaPricePrecision
346 
351 MAMAExpDLL
352 extern mamaPricePrecision
354 
358 MAMAExpDLL
359 extern mama_i32_t
361 
365 MAMAExpDLL
366 extern mama_i32_t
368 
369 #if defined(__cplusplus)
370 }
371 #endif
372 
373 #endif


© 2012 Linux Foundation