OpenMAMA
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
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 using namespace std;
32 
33 namespace Wombat
34 {
35 
36  class MamaMsgFieldImpl;
37  class MamaFieldDescriptor;
38  class MamaDateTime;
39  class MamaPrice;
40  class MamaMsg;
41 
45  class MAMACPPExpDLL MamaMsgField
46  {
47  public:
48  ~MamaMsgField ();
49 
50  MamaMsgField (void);
51 
52  MamaMsgField (
53  mamaMsgField field);
54 
58  void clear ();
59 
63  void set (
64  mamaMsgField field);
65 
66  const MamaFieldDescriptor* getDescriptor () const;
67 
73  mama_fid_t getFid () const;
74 
80  const char* getName () const;
81 
87  mamaFieldType getType () const;
88 
95  const char* getTypeName () const;
96 
101  mama_bool_t getBool () const;
102 
107  char getChar () const;
108 
113  mama_i8_t getI8 () const;
114 
119  mama_u8_t getU8 () const;
120 
125  mama_i16_t getI16 () const;
126 
131  mama_u16_t getU16 () const;
132 
137  mama_i32_t getI32 () const;
138 
143  mama_u32_t getU32 () const;
144 
149  mama_i64_t getI64 () const;
150 
155  mama_u64_t getU64 () const;
156 
161  mama_f32_t getF32 () const;
162 
167  mama_f64_t getF64 () const;
168 
173  const char* getString () const;
174 
179  const void* getOpaque (
180  mama_size_t& size) const;
181 
186  void getDateTime (
187  MamaDateTime& result) const;
188 
193  void getPrice (
194  MamaPrice& result) const;
195 
200  void getMsg (
201  MamaMsg& result) const;
202 
208  void getVectorChar (
209  const char*& result,
210  mama_size_t& resultLen) const;
211 
217  void getVectorI8 (
218  const mama_i8_t*& result,
219  mama_size_t& resultLen) const;
220 
226  void getVectorU8 (
227  const mama_u8_t*& result,
228  mama_size_t& resultLen) const;
229 
235  void getVectorI16 (
236  const mama_i16_t*& result,
237  mama_size_t& resultLen) const;
238 
244  void getVectorU16 (
245  const mama_u16_t*& result,
246  mama_size_t& resultLen) const;
247 
253  void getVectorI32 (
254  const mama_i32_t*& result,
255  mama_size_t& resultLen) const;
256 
262  void getVectorU32 (
263  const mama_u32_t*& result,
264  mama_size_t& resultLen) const;
265 
271  void getVectorI64 (
272  const mama_i64_t*& result,
273  mama_size_t& resultLen) const;
274 
280  void getVectorU64 (
281  const mama_u64_t*& result,
282  mama_size_t& resultLen) const;
283 
289  void getVectorF32 (
290  const mama_f32_t*& result,
291  mama_size_t& resultLen) const;
292 
298  void getVectorF64 (
299  const mama_f64_t*& result,
300  mama_size_t& resultLen) const;
301 
307  void getVectorString (
308  const char**& result,
309  mama_size_t& resultLen) const;
310 
321  void getVectorMsg (
322  const MamaMsg**& result,
323  mama_size_t& resultLen) const;
324 
332  void getVectorMsgDetached (
333  const MamaMsg**& result,
334  mama_size_t& resultLen) const;
335 
341  void getAsString (
342  char* result,
343  mama_size_t maxResultLen) const;
344 
356  void updateBool (
357  mama_bool_t value);
358 
370  void updateChar (
371  char value);
372 
384  void updateI8 (
385  mama_i8_t value);
386 
398  void updateU8 (
399  mama_u8_t value);
400 
412  void updateI16 (
413  mama_i16_t value);
414 
426  void updateU16 (
427  mama_u16_t value);
428 
440  void updateI32 (
441  mama_i32_t value);
442 
454  void updateU32 (
455  mama_u32_t value);
456 
468  void updateI64 (
469  mama_i64_t value);
470 
482  void updateU64 (
483  mama_u64_t value);
484 
496  void updateF32 (
497  mama_f32_t value);
498 
510  void updateF64 (
511  mama_f64_t value);
512 
524  void updateDateTime (
525  const mamaDateTime value);
526 
539  void updateDateTime (
540  const MamaDateTime value);
541 
553  void updatePrice (
554  const mamaPrice value);
555 
567  void updatePrice (
568  const MamaPrice value);
569 
570  bool operator==(const MamaMsgField&) const;
571  bool operator!=(const MamaMsgField&) const;
572 
573  private:
574  mamaMsgField mField;
575  mutable MamaFieldDescriptor* mFieldDesc;
576  mutable const MamaMsg** mLastVectorMsg;
577  mutable mama_size_t mLastVectorMsgLen;
578 
579  void destroyLastVectorMsg () const;
580  };
581 
582 } // namespace Wombat
583 #endif // MAMA_MSG_FIELD_CPP_H__


© 2012 Linux Foundation