OpenMAMA C++ API
MamaMsgField.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 MAMA_MSG_FIELD_CPP_H__
23 #define MAMA_MSG_FIELD_CPP_H__
24 
25 #include <mama/mamacpp.h>
26 
27 #include <vector>
28 #include <functional>
29 
30 
31 namespace Wombat
32 {
33 
34  class MamaMsgFieldImpl;
35  class MamaFieldDescriptor;
36  class MamaDateTime;
37  class MamaPrice;
38  class MamaMsg;
39 
43  class MAMACPPExpDLL MamaMsgField
44  {
45  public:
46  ~MamaMsgField ();
47 
48  MamaMsgField (void);
49 
50  MamaMsgField (
51  mamaMsgField field);
52 
56  void clear ();
57 
61  void set (
62  mamaMsgField field);
63 
64  const MamaFieldDescriptor* getDescriptor () const;
65 
71  mama_fid_t getFid () const;
72 
78  const char* getName () const;
79 
85  mamaFieldType getType () const;
86 
93  const char* getTypeName () const;
94 
99  mama_bool_t getBool () const;
100 
105  char getChar () const;
106 
111  mama_i8_t getI8 () const;
112 
117  mama_u8_t getU8 () const;
118 
123  mama_i16_t getI16 () const;
124 
129  mama_u16_t getU16 () const;
130 
135  mama_i32_t getI32 () const;
136 
141  mama_u32_t getU32 () const;
142 
147  mama_i64_t getI64 () const;
148 
153  mama_u64_t getU64 () const;
154 
159  mama_f32_t getF32 () const;
160 
165  mama_f64_t getF64 () const;
166 
171  const char* getString () const;
172 
177  const void* getOpaque (
178  mama_size_t& size) const;
179 
184  void getDateTime (
185  MamaDateTime& result) const;
186 
191  void getPrice (
192  MamaPrice& result) const;
193 
198  void getMsg (
199  MamaMsg& result) const;
200 
206  void getVectorBool (
207  const mama_bool_t*& result,
208  mama_size_t& resultLen) const;
209 
215  void getVectorChar (
216  const char*& result,
217  mama_size_t& resultLen) const;
218 
224  void getVectorI8 (
225  const mama_i8_t*& result,
226  mama_size_t& resultLen) const;
227 
233  void getVectorU8 (
234  const mama_u8_t*& result,
235  mama_size_t& resultLen) const;
236 
242  void getVectorI16 (
243  const mama_i16_t*& result,
244  mama_size_t& resultLen) const;
245 
251  void getVectorU16 (
252  const mama_u16_t*& result,
253  mama_size_t& resultLen) const;
254 
260  void getVectorI32 (
261  const mama_i32_t*& result,
262  mama_size_t& resultLen) const;
263 
269  void getVectorU32 (
270  const mama_u32_t*& result,
271  mama_size_t& resultLen) const;
272 
278  void getVectorI64 (
279  const mama_i64_t*& result,
280  mama_size_t& resultLen) const;
281 
287  void getVectorU64 (
288  const mama_u64_t*& result,
289  mama_size_t& resultLen) const;
290 
296  void getVectorF32 (
297  const mama_f32_t*& result,
298  mama_size_t& resultLen) const;
299 
305  void getVectorF64 (
306  const mama_f64_t*& result,
307  mama_size_t& resultLen) const;
308 
314  void getVectorString (
315  const char**& result,
316  mama_size_t& resultLen) const;
317 
328  void getVectorMsg (
329  const MamaMsg**& result,
330  mama_size_t& resultLen) const;
331 
339  void getVectorMsgDetached (
340  const MamaMsg**& result,
341  mama_size_t& resultLen) const;
342 
348  void getAsString (
349  char* result,
350  mama_size_t maxResultLen) const;
351 
363  void updateBool (
364  mama_bool_t value);
365 
377  void updateChar (
378  char value);
379 
391  void updateI8 (
392  mama_i8_t value);
393 
405  void updateU8 (
406  mama_u8_t value);
407 
419  void updateI16 (
420  mama_i16_t value);
421 
433  void updateU16 (
434  mama_u16_t value);
435 
447  void updateI32 (
448  mama_i32_t value);
449 
461  void updateU32 (
462  mama_u32_t value);
463 
475  void updateI64 (
476  mama_i64_t value);
477 
489  void updateU64 (
490  mama_u64_t value);
491 
503  void updateF32 (
504  mama_f32_t value);
505 
517  void updateF64 (
518  mama_f64_t value);
519 
531  void updateDateTime (
532  const mamaDateTime value);
533 
546  void updateDateTime (
547  const MamaDateTime value);
548 
560  void updatePrice (
561  const mamaPrice value);
562 
574  void updatePrice (
575  const MamaPrice value);
576 
577  bool operator==(const MamaMsgField&) const;
578  bool operator!=(const MamaMsgField&) const;
579 
580  private:
581  mamaMsgField mField;
582  mutable MamaFieldDescriptor* mFieldDesc;
583  mutable const MamaMsg** mLastVectorMsg;
584  mutable mama_size_t mLastVectorMsgLen;
585 
586  void destroyLastVectorMsg () const;
587  };
588 
589 } // namespace Wombat
590 #endif // MAMA_MSG_FIELD_CPP_H__
MAMA message representation.
Definition: MamaMsg.h:112
Definition: MamaConnection.h:29
MamaPrice is a special data type for representing floating point numbers that often require special f...
Definition: MamaPrice.h:43
A date/time representation with additional hints for precision, advanced output formatting and suppor...
Definition: MamaDateTime.h:67
MamaMsg field representation.
Definition: MamaMsgField.h:43
The MamaFieldDescriptor class describes a field within a MamaDictionary
Definition: MamaFieldDescriptor.h:39