OpenMAMA C++ API
MamaFieldCacheFieldTypes.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_FIELD_CACHE_FIELD_TYPES_CPP_H__
23 #define MAMA_FIELD_CACHE_FIELD_TYPES_CPP_H__
24 
25 #include <mama/mamacpp.h>
27 #include <mama/MamaPrice.h>
28 #include <mama/MamaDateTime.h>
29 #include <stdexcept>
30 
31 namespace Wombat
32 {
33 
38 template <typename T, mamaFieldType fieldType>
40 {
41 public:
43 
50  void set(MamaFieldCacheField& field, const T& value);
57  T get(const MamaFieldCacheField& field) const;
58 
59 protected:
60  void checkType(const MamaFieldCacheField& field) const
61  {
62  if (field.getType() != fieldType)
63  throw std::invalid_argument("MamaFieldCacheFieldBasic");
64  }
65 };
66 
67 // Basic single-value types
140 
141 // Special single-value types
147 {
148 public:
155  void set(MamaFieldCacheField& field, const char* value, mama_size_t len = 0);
162  const char* get(const MamaFieldCacheField& field) const;
163 
164 protected:
165  void checkType(const MamaFieldCacheField& field) const
166  {
167  if (field.getType() != MAMA_FIELD_TYPE_STRING)
168  throw std::invalid_argument("MamaFieldCacheFieldString");
169  }
170 };
171 
177 {
178 public:
185  void set(MamaFieldCacheField& field, const MamaPrice& value);
192  const MamaPrice& get(const MamaFieldCacheField& field) const;
193 
194 protected:
195  void checkType(const MamaFieldCacheField& field) const
196  {
197  if (field.getType() != MAMA_FIELD_TYPE_PRICE)
198  throw std::invalid_argument("MamaFieldCacheFieldPrice");
199  }
200 
201 private:
202  mutable MamaPrice mPrice;
203 };
204 
210 {
211 public:
218  void set(MamaFieldCacheField& field, const MamaDateTime& value);
225  const MamaDateTime& get(const MamaFieldCacheField& field) const;
226 
227 protected:
228  void checkType(const MamaFieldCacheField& field) const
229  {
230  if (field.getType() != MAMA_FIELD_TYPE_TIME)
231  throw std::invalid_argument("MamaFieldCacheFieldDateTime");
232  }
233 
234 private:
235  mutable MamaDateTime mDateTime;
236 };
237 
238 
243 template <typename T, mamaFieldType fieldType>
245 {
246 public:
254  void set(MamaFieldCacheField& field, const T* values, mama_size_t size);
262  void get(const MamaFieldCacheField& field, const T*& values, mama_size_t& size) const;
270  const T& get(const MamaFieldCacheField& field, mama_size_t index) const;
271 
272 protected:
273  void checkType(const MamaFieldCacheField& field) const
274  {
275  if (field.getType() != fieldType)
276  throw std::invalid_argument("MamaFieldCacheFieldVectorBasic");
277  }
278 };
279 
352 
353 
354 // Special vector types
359  : public MamaFieldCacheFieldBase
360 {
361 public:
369  void set(MamaFieldCacheField& field, const char** values, mama_size_t size);
377  void get(const MamaFieldCacheField& field, const char**& values, mama_size_t& size) const;
385  const char* get(const MamaFieldCacheField& field, mama_size_t index) const;
386 
387 protected:
388  void checkType(const MamaFieldCacheField& field) const
389  {
390  if (field.getType() != MAMA_FIELD_TYPE_VECTOR_STRING)
391  throw std::invalid_argument("MamaFieldCacheFieldStringVector");
392  }
393 };
394 
395 
396 template <typename T>
398 {
399 protected:
401  : mValues(NULL)
402  , mSize(0)
403  {
404  }
406  {
407  if (!mValues || !mSize)
408  {
409  return;
410  }
411  delete[] mValues;
412  }
413 
414  void grow(mama_size_t newSize) const
415  {
416  if (newSize <= mSize)
417  return;
418 
419  T* newVector = new T[newSize];
420  for (mama_size_t i = 0; i < mSize; ++i)
421  {
422  newVector[i] = mValues[i];
423  }
424 
425  if (mValues)
426  delete[] mValues;
427 
428  mValues = newVector;
429  mSize = newSize;
430  }
431 
432 protected:
433  mutable T* mValues;
435 };
436 
441  : public MamaFieldCacheFieldBase
442  , public MamaFieldCacheFieldVector<MamaPrice>
443 {
444 public:
452  void set(MamaFieldCacheField& field, const MamaPrice* values, mama_size_t size);
460  void get(const MamaFieldCacheField& field, const MamaPrice*& values, mama_size_t& size) const;
468  const MamaPrice* get(const MamaFieldCacheField& field, mama_size_t index) const;
469 
470 protected:
471  void checkType(const MamaFieldCacheField& field) const
472  {
473  if (field.getType() != MAMA_FIELD_TYPE_VECTOR_PRICE)
474  throw std::invalid_argument("MamaFieldCacheFieldPriceVector");
475  }
476 
477 private:
478  mutable MamaPrice mValue;
479 };
480 
485  : public MamaFieldCacheFieldBase
486  , public MamaFieldCacheFieldVector<MamaDateTime>
487 {
488 public:
496  void set(MamaFieldCacheField& field, const MamaDateTime* values, mama_size_t size);
504  void get(const MamaFieldCacheField& field, const MamaDateTime*& values, mama_size_t& size) const;
512  const MamaDateTime* get(const MamaFieldCacheField& field, mama_size_t index) const;
513 
514 protected:
515  void checkType(const MamaFieldCacheField& field) const
516  {
517  if (field.getType() != MAMA_FIELD_TYPE_VECTOR_TIME)
518  throw std::invalid_argument("MamaFieldCacheFieldTimeVector");
519  }
520 
521 private:
522  mutable MamaDateTime mValue;
523 };
524 
525 
532 void setFieldValue(MamaFieldCacheField& field, const char* value);
533 
540 void setFieldValue(MamaFieldCacheField& field, const MamaPrice& value);
541 
548 void setFieldValue(MamaFieldCacheField& field, const MamaDateTime& value);
549 
550 
551 template <mamaFieldType fieldType>
552 class Type
553 {
554 };
555 
556 template <typename T>
557 void setV(Type<MAMA_FIELD_TYPE_CHAR> type, MamaFieldCacheField& field, const T& value)
558 {
559  MamaFieldCacheFieldChar setField;
560  setField.set(field, value);
561 }
562 
563 template <typename T>
564 void setV(Type<MAMA_FIELD_TYPE_BOOL> type, MamaFieldCacheField& field, const T& value)
565 {
566  MamaFieldCacheFieldBool setField;
567  setField.set(field, value);
568 }
569 
570 template <typename T>
571 void setV(Type<MAMA_FIELD_TYPE_I8> type, MamaFieldCacheField& field, const T& value)
572 {
573  MamaFieldCacheFieldI8 setField;
574  setField.set(field, value);
575 }
576 template <typename T>
577 void setV(Type<MAMA_FIELD_TYPE_U8> type, MamaFieldCacheField& field, const T& value)
578 {
579  MamaFieldCacheFieldU8 setField;
580  setField.set(field, value);
581 }
582 
583 template <typename T>
584 void setV(Type<MAMA_FIELD_TYPE_I16> type, MamaFieldCacheField& field, const T& value)
585 {
586  MamaFieldCacheFieldI16 setField;
587  setField.set(field, value);
588 }
589 template <typename T>
590 void setV(Type<MAMA_FIELD_TYPE_U16> type, MamaFieldCacheField& field, const T& value)
591 {
592  MamaFieldCacheFieldU16 setField;
593  setField.set(field, value);
594 }
595 
596 template <typename T>
597 void setV(Type<MAMA_FIELD_TYPE_I32> type, MamaFieldCacheField& field, const T& value)
598 {
599  MamaFieldCacheFieldI32 setField;
600  setField.set(field, value);
601 }
602 template <typename T>
603 void setV(Type<MAMA_FIELD_TYPE_U32> type, MamaFieldCacheField& field, const T& value)
604 {
605  MamaFieldCacheFieldU32 setField;
606  setField.set(field, value);
607 }
608 
609 template <typename T>
611 {
612  MamaFieldCacheFieldI64 setField;
613  setField.set(field, value);
614 }
615 template <typename T>
616 void setV(Type<MAMA_FIELD_TYPE_U64> type, MamaFieldCacheField& field, const T& value)
617 {
618  MamaFieldCacheFieldU64 setField;
619  setField.set(field, value);
620 }
621 
622 template <typename T>
623 void setV(Type<MAMA_FIELD_TYPE_F32> type, MamaFieldCacheField& field, const T& value)
624 {
625  MamaFieldCacheFieldF32 setField;
626  setField.set(field, value);
627 }
628 template <typename T>
629 void setV(Type<MAMA_FIELD_TYPE_F64> type, MamaFieldCacheField& field, const T& value)
630 {
631  MamaFieldCacheFieldF64 setField;
632  setField.set(field, value);
633 }
634 
635 template <typename T>
636 void getV(Type<MAMA_FIELD_TYPE_CHAR> type, const MamaFieldCacheField& field, T& value)
637 {
638  MamaFieldCacheFieldChar getField;
639  value = getField.get(field);
640 }
641 
642 template <typename T>
643 void getV(Type<MAMA_FIELD_TYPE_BOOL> type, const MamaFieldCacheField& field, T& value)
644 {
645  MamaFieldCacheFieldBool getField;
646  value = getField.get(field);
647 }
648 
649 template <typename T>
650 void getV(Type<MAMA_FIELD_TYPE_I8> type, const MamaFieldCacheField& field, T& value)
651 {
652  MamaFieldCacheFieldI8 getField;
653  value = getField.get(field);
654 }
655 template <typename T>
656 void getV(Type<MAMA_FIELD_TYPE_U8> type, const MamaFieldCacheField& field, T& value)
657 {
658  MamaFieldCacheFieldU8 getField;
659  value = getField.get(field);
660 }
661 
662 template <typename T>
663 void getV(Type<MAMA_FIELD_TYPE_I16> type, const MamaFieldCacheField& field, T& value)
664 {
665  MamaFieldCacheFieldI16 getField;
666  value = getField.get(field);
667 }
668 template <typename T>
669 void getV(Type<MAMA_FIELD_TYPE_U16> type, const MamaFieldCacheField& field, T& value)
670 {
671  MamaFieldCacheFieldU16 getField;
672  value = getField.get(field);
673 }
674 
675 template <typename T>
676 void getV(Type<MAMA_FIELD_TYPE_I32> type, const MamaFieldCacheField& field, T& value)
677 {
678  MamaFieldCacheFieldI32 getField;
679  value = getField.get(field);
680 }
681 template <typename T>
682 void getV(Type<MAMA_FIELD_TYPE_U32> type, const MamaFieldCacheField& field, T& value)
683 {
684  MamaFieldCacheFieldU32 getField;
685  value = getField.get(field);
686 }
687 
688 template <typename T>
689 void getV(Type<MAMA_FIELD_TYPE_I64> type, const MamaFieldCacheField& field, T& value)
690 {
691  MamaFieldCacheFieldI64 getField;
692  value = getField.get(field);
693 }
694 template <typename T>
695 void getV(Type<MAMA_FIELD_TYPE_U64> type, const MamaFieldCacheField& field, T& value)
696 {
697  MamaFieldCacheFieldU64 getField;
698  value = getField.get(field);
699 }
700 
701 template <typename T>
702 void getV(Type<MAMA_FIELD_TYPE_F32> type, const MamaFieldCacheField& field, T& value)
703 {
704  MamaFieldCacheFieldF32 getField;
705  value = getField.get(field);
706 }
707 template <typename T>
708 void getV(Type<MAMA_FIELD_TYPE_F64> type, const MamaFieldCacheField& field, T& value)
709 {
710  MamaFieldCacheFieldF64 getField;
711  value = getField.get(field);
712 }
713 
720 template <typename T>
721 void setFieldValue(MamaFieldCacheField& field, const T& value)
722 {
723  switch(field.getType())
724  {
725  case MAMA_FIELD_TYPE_CHAR:
726  {
727  setV(Type<MAMA_FIELD_TYPE_CHAR>(), field, value);
728  break;
729  }
730  case MAMA_FIELD_TYPE_BOOL:
731  {
732  setV(Type<MAMA_FIELD_TYPE_BOOL>(), field, value);
733  break;
734  }
735  case MAMA_FIELD_TYPE_I8:
736  {
737  setV(Type<MAMA_FIELD_TYPE_I8>(), field, value);
738  break;
739  }
740  case MAMA_FIELD_TYPE_U8:
741  {
742  setV(Type<MAMA_FIELD_TYPE_U8>(), field, value);
743  break;
744  }
745  case MAMA_FIELD_TYPE_I16:
746  {
747  setV(Type<MAMA_FIELD_TYPE_I16>(), field, value);
748  break;
749  }
750  case MAMA_FIELD_TYPE_U16:
751  {
752  setV(Type<MAMA_FIELD_TYPE_U16>(), field, value);
753  break;
754  }
755  case MAMA_FIELD_TYPE_I32:
756  {
757  setV(Type<MAMA_FIELD_TYPE_I32>(), field, value);
758  break;
759  }
760  case MAMA_FIELD_TYPE_U32:
761  {
762  setV(Type<MAMA_FIELD_TYPE_U32>(), field, value);
763  break;
764  }
765  case MAMA_FIELD_TYPE_I64:
766  {
767  setV(Type<MAMA_FIELD_TYPE_I64>(), field, value);
768  break;
769  }
770  case MAMA_FIELD_TYPE_U64:
771  {
772  setV(Type<MAMA_FIELD_TYPE_U64>(), field, value);
773  break;
774  }
775  case MAMA_FIELD_TYPE_F32:
776  {
777  setV(Type<MAMA_FIELD_TYPE_F32>(), field, value);
778  break;
779  }
780  case MAMA_FIELD_TYPE_F64:
781  {
782  setV(Type<MAMA_FIELD_TYPE_F64>(), field, value);
783  break;
784  }
785  default:
786  break;
787  }
788 }
789 
796 void getFieldValue(const MamaFieldCacheField& field, const char*& value);
797 
804 void getFieldValue(const MamaFieldCacheField& field, MamaPrice& value);
805 
812 void getFieldValue(const MamaFieldCacheField& field, MamaDateTime& value);
813 
820 template <typename T>
821 void getFieldValue(const MamaFieldCacheField& field, T& value)
822 {
823  switch(field.getType())
824  {
825  case MAMA_FIELD_TYPE_CHAR:
826  {
827  getV(Type<MAMA_FIELD_TYPE_CHAR>(), field, value);
828  break;
829  }
830  case MAMA_FIELD_TYPE_BOOL:
831  {
832  getV(Type<MAMA_FIELD_TYPE_BOOL>(), field, value);
833  break;
834  }
835  case MAMA_FIELD_TYPE_I8:
836  {
837  getV(Type<MAMA_FIELD_TYPE_I8>(), field, value);
838  break;
839  }
840  case MAMA_FIELD_TYPE_U8:
841  {
842  getV(Type<MAMA_FIELD_TYPE_U8>(), field, value);
843  break;
844  }
845  case MAMA_FIELD_TYPE_I16:
846  {
847  getV(Type<MAMA_FIELD_TYPE_I16>(), field, value);
848  break;
849  }
850  case MAMA_FIELD_TYPE_U16:
851  {
852  getV(Type<MAMA_FIELD_TYPE_U16>(), field, value);
853  break;
854  }
855  case MAMA_FIELD_TYPE_I32:
856  {
857  getV(Type<MAMA_FIELD_TYPE_I32>(), field, value);
858  break;
859  }
860  case MAMA_FIELD_TYPE_U32:
861  {
862  getV(Type<MAMA_FIELD_TYPE_U32>(), field, value);
863  break;
864  }
865  case MAMA_FIELD_TYPE_I64:
866  {
867  getV(Type<MAMA_FIELD_TYPE_I64>(), field, value);
868  break;
869  }
870  case MAMA_FIELD_TYPE_U64:
871  {
872  getV(Type<MAMA_FIELD_TYPE_U64>(), field, value);
873  break;
874  }
875  case MAMA_FIELD_TYPE_F32:
876  {
877  getV(Type<MAMA_FIELD_TYPE_F32>(), field, value);
878  break;
879  }
880  case MAMA_FIELD_TYPE_F64:
881  {
882  getV(Type<MAMA_FIELD_TYPE_F64>(), field, value);
883  break;
884  }
885  default:
886  break;
887  }
888 }
889 
897 template <typename T>
898 void setFieldValue(MamaFieldCacheField& field, const T* values, mama_size_t size)
899 {
900  switch(field.getType())
901  {
902  case MAMA_FIELD_TYPE_VECTOR_BOOL:
903  {
905  getField.set(field, (const mama_bool_t*)values, size);
906  break;
907  }
908  case MAMA_FIELD_TYPE_VECTOR_CHAR:
909  {
911  getField.set(field, (const char*)values, size);
912  break;
913  }
914  case MAMA_FIELD_TYPE_VECTOR_I8:
915  {
917  getField.set(field, (const mama_i8_t*)values, size);
918  break;
919  }
920  case MAMA_FIELD_TYPE_VECTOR_U8:
921  {
923  getField.set(field, (const mama_u8_t*)values, size);
924  break;
925  }
926  case MAMA_FIELD_TYPE_VECTOR_I16:
927  {
929  getField.set(field, (const mama_i16_t*)values, size);
930  break;
931  }
932  case MAMA_FIELD_TYPE_VECTOR_U16:
933  {
935  getField.set(field, (const mama_u16_t*)values, size);
936  break;
937  }
938  case MAMA_FIELD_TYPE_VECTOR_I32:
939  {
941  getField.set(field, (const mama_i32_t*)values, size);
942  break;
943  }
944  case MAMA_FIELD_TYPE_VECTOR_U32:
945  {
947  getField.set(field, (const mama_u32_t*)values, size);
948  break;
949  }
950  case MAMA_FIELD_TYPE_VECTOR_I64:
951  {
953  getField.set(field, (const mama_i64_t*)values, size);
954  break;
955  }
956  case MAMA_FIELD_TYPE_VECTOR_U64:
957  {
959  getField.set(field, (const mama_u64_t*)values, size);
960  break;
961  }
962  case MAMA_FIELD_TYPE_VECTOR_F32:
963  {
965  getField.set(field, (const mama_f32_t*)values, size);
966  break;
967  }
968  case MAMA_FIELD_TYPE_VECTOR_F64:
969  {
971  getField.set(field, (const mama_f64_t*)values, size);
972  break;
973  }
974  case MAMA_FIELD_TYPE_VECTOR_STRING:
975  {
977  getField.set(field, (const char**)values, size);
978  break;
979  }
980  case MAMA_FIELD_TYPE_VECTOR_PRICE:
981  {
983  getField.set(field, (const MamaPrice*)values, size);
984  break;
985  }
986  case MAMA_FIELD_TYPE_VECTOR_TIME:
987  {
989  getField.set(field, (const MamaDateTime*)values, size);
990  break;
991  }
992  default:
993  break;
994  }
995 }
996 
1004 void getFieldValue(const MamaFieldCacheField& field, const char**& values, mama_size_t& size);
1005 
1006 // TODO: NOT IMPLEMENTED YET
1007 // Need to fix the C++ MamaPrice and MamaDateTime interface to allow replacing
1008 // the inner C structure (otherwise a copy is needed causing either a memory leak
1009 // or an early delete.
1010 void getFieldValue(const MamaFieldCacheField& field, const MamaPrice*& values, mama_size_t& size);
1011 
1012 void getFieldValue(const MamaFieldCacheField& field, const mamaDateTime*& values, mama_size_t& size);
1013 
1021 template <typename T>
1022 void getFieldValue(const MamaFieldCacheField& field, const T*& values, mama_size_t& size)
1023 {
1024  switch(field.getType())
1025  {
1026  case MAMA_FIELD_TYPE_VECTOR_BOOL:
1027  {
1029  getField.get(field, (const mama_bool_t*&)values, size);
1030  break;
1031  }
1032  case MAMA_FIELD_TYPE_VECTOR_CHAR:
1033  {
1035  getField.get(field, (const char*&)values, size);
1036  break;
1037  }
1038  case MAMA_FIELD_TYPE_VECTOR_I8:
1039  {
1040  MamaFieldCacheFieldI8Vector getField;
1041  getField.get(field, (const mama_i8_t*&)values, size);
1042  break;
1043  }
1044  case MAMA_FIELD_TYPE_VECTOR_U8:
1045  {
1046  MamaFieldCacheFieldU8Vector getField;
1047  getField.get(field, (const mama_u8_t*&)values, size);
1048  break;
1049  }
1050  case MAMA_FIELD_TYPE_VECTOR_I16:
1051  {
1053  getField.get(field, (const mama_i16_t*&)values, size);
1054  break;
1055  }
1056  case MAMA_FIELD_TYPE_VECTOR_U16:
1057  {
1059  getField.get(field, (const mama_u16_t*&)values, size);
1060  break;
1061  }
1062  case MAMA_FIELD_TYPE_VECTOR_I32:
1063  {
1065  getField.get(field, (const mama_i32_t*&)values, size);
1066  break;
1067  }
1068  case MAMA_FIELD_TYPE_VECTOR_U32:
1069  {
1071  getField.get(field, (const mama_u32_t*&)values, size);
1072  break;
1073  }
1074  case MAMA_FIELD_TYPE_VECTOR_I64:
1075  {
1077  getField.get(field, (const mama_i64_t*&)values, size);
1078  break;
1079  }
1080  case MAMA_FIELD_TYPE_VECTOR_U64:
1081  {
1083  getField.get(field, (const mama_u64_t*&)values, size);
1084  break;
1085  }
1086  case MAMA_FIELD_TYPE_VECTOR_F32:
1087  {
1089  getField.get(field, (const mama_f32_t*&)values, size);
1090  break;
1091  }
1092  case MAMA_FIELD_TYPE_VECTOR_F64:
1093  {
1095  getField.get(field, (const mama_f64_t*&)values, size);
1096  break;
1097  }
1098  default:
1099  break;
1100  }
1101 }
1102 
1103 void mamaFieldCacheFieldFromString(MamaFieldCacheField& field, const std::string& value);
1104 
1105 } // namespace Wombat
1106 
1107 #endif // MAMA_FIELD_CACHE_FIELD_TYPES_CPP_H__
MamaFieldCacheFieldBasic< mama_u16_t, MAMA_FIELD_TYPE_U16 > MamaFieldCacheFieldU16
MamaFieldCacheFieldU16.
Definition: MamaFieldCacheFieldTypes.h:103
MamaFieldCacheFieldBasic< char, MAMA_FIELD_TYPE_CHAR > MamaFieldCacheFieldChar
MamaFieldCacheFieldChar.
Definition: MamaFieldCacheFieldTypes.h:73
MamaFieldCacheFieldBasic< mama_i64_t, MAMA_FIELD_TYPE_I64 > MamaFieldCacheFieldI64
MamaFieldCacheFieldI64.
Definition: MamaFieldCacheFieldTypes.h:121
MamaFieldCacheField: Price vector field.
Definition: MamaFieldCacheFieldTypes.h:440
void getFieldValue(const MamaFieldCacheField &field, const char *&value)
Helper function to get the value of a string field.
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:471
MamaFieldCacheField: String vector field.
Definition: MamaFieldCacheFieldTypes.h:358
MamaFieldCacheFieldBasic< mama_i8_t, MAMA_FIELD_TYPE_I8 > MamaFieldCacheFieldI8
MamaFieldCacheFieldI8.
Definition: MamaFieldCacheFieldTypes.h:85
MamaFieldCacheFieldVectorBasic< mama_f64_t, MAMA_FIELD_TYPE_VECTOR_F64 > MamaFieldCacheFieldF64Vector
MamaFieldCacheFieldF64Vector.
Definition: MamaFieldCacheFieldTypes.h:351
MamaFieldCacheFieldBasic< mama_i16_t, MAMA_FIELD_TYPE_I16 > MamaFieldCacheFieldI16
MamaFieldCacheFieldI16.
Definition: MamaFieldCacheFieldTypes.h:97
MamaFieldCacheFieldVectorBasic< mama_i64_t, MAMA_FIELD_TYPE_VECTOR_I64 > MamaFieldCacheFieldI64Vector
MamaFieldCacheFieldI64Vector.
Definition: MamaFieldCacheFieldTypes.h:333
MamaFieldCacheField: DateTime vector field.
Definition: MamaFieldCacheFieldTypes.h:484
MamaFieldCacheFieldVectorBasic< mama_i16_t, MAMA_FIELD_TYPE_VECTOR_I16 > MamaFieldCacheFieldI16Vector
MamaFieldCacheFieldI16Vector.
Definition: MamaFieldCacheFieldTypes.h:309
virtual ~MamaFieldCacheFieldBasic()
Definition: MamaFieldCacheFieldTypes.h:42
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:388
MamaFieldCacheFieldString.
Definition: MamaFieldCacheFieldTypes.h:146
void set(MamaFieldCacheField &field, const T *values, mama_size_t size)
Set the field value.
MamaFieldCacheFieldDateTime.
Definition: MamaFieldCacheFieldTypes.h:209
void grow(mama_size_t newSize) const
Definition: MamaFieldCacheFieldTypes.h:414
T * mValues
Definition: MamaFieldCacheFieldTypes.h:433
void set(MamaFieldCacheField &field, const char **values, mama_size_t size)
Set the values of a string vector field.
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:195
void mamaFieldCacheFieldFromString(MamaFieldCacheField &field, const std::string &value)
void setV(Type< MAMA_FIELD_TYPE_CHAR > type, MamaFieldCacheField &field, const T &value)
Definition: MamaFieldCacheFieldTypes.h:557
Definition: MamaConnection.h:29
T get(const MamaFieldCacheField &field) const
Return the value of the field.
MamaFieldCacheFieldBasic.
Definition: MamaFieldCacheFieldTypes.h:39
MamaFieldCacheFieldVectorBasic< mama_u16_t, MAMA_FIELD_TYPE_VECTOR_U16 > MamaFieldCacheFieldU16Vector
MamaFieldCacheFieldU16Vector.
Definition: MamaFieldCacheFieldTypes.h:315
MamaFieldCacheFieldVectorBasic< mama_u32_t, MAMA_FIELD_TYPE_VECTOR_U32 > MamaFieldCacheFieldU32Vector
MamaFieldCacheFieldU32Vector.
Definition: MamaFieldCacheFieldTypes.h:327
void set(MamaFieldCacheField &field, const MamaPrice *values, mama_size_t size)
Set the values of a MamaPrice vector field.
MamaFieldCacheFieldPrice.
Definition: MamaFieldCacheFieldTypes.h:176
void setFieldValue(MamaFieldCacheField &field, const char *value)
Helper function to set the value of a String field.
MamaFieldCacheFieldBasic< mama_u64_t, MAMA_FIELD_TYPE_U64 > MamaFieldCacheFieldU64
MamaFieldCacheFieldU64.
Definition: MamaFieldCacheFieldTypes.h:127
MamaFieldCacheFieldBasic< mama_bool_t, MAMA_FIELD_TYPE_BOOL > MamaFieldCacheFieldBool
MamaFieldCacheFieldBool.
Definition: MamaFieldCacheFieldTypes.h:79
MamaFieldCacheFieldVectorBasic< mama_u64_t, MAMA_FIELD_TYPE_VECTOR_U64 > MamaFieldCacheFieldU64Vector
MamaFieldCacheFieldU64Vector.
Definition: MamaFieldCacheFieldTypes.h:339
MamaFieldCacheFieldVectorBasic< mama_u8_t, MAMA_FIELD_TYPE_VECTOR_U8 > MamaFieldCacheFieldU8Vector
MamaFieldCacheFieldU8Vector.
Definition: MamaFieldCacheFieldTypes.h:303
void getV(Type< MAMA_FIELD_TYPE_CHAR > type, const MamaFieldCacheField &field, T &value)
Definition: MamaFieldCacheFieldTypes.h:636
MamaPrice is a special data type for representing floating point numbers that often require special f...
Definition: MamaPrice.h:43
void get(const MamaFieldCacheField &field, const T *&values, mama_size_t &size) const
Return the field values.
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:273
MamaFieldCacheFieldBasic< mama_i32_t, MAMA_FIELD_TYPE_I32 > MamaFieldCacheFieldI32
MamaFieldCacheFieldI32.
Definition: MamaFieldCacheFieldTypes.h:109
MamaFieldCacheFieldVectorBasic< char, MAMA_FIELD_TYPE_VECTOR_CHAR > MamaFieldCacheFieldCharVector
MamaFieldCacheFieldCharVector.
Definition: MamaFieldCacheFieldTypes.h:291
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:60
A date/time representation with additional hints for precision, advanced output formatting and suppor...
Definition: MamaDateTime.h:67
virtual mamaFieldType getType() const
Return the field type.
MamaFieldCacheFieldVectorBasic< mama_f32_t, MAMA_FIELD_TYPE_VECTOR_F32 > MamaFieldCacheFieldF32Vector
MamaFieldCacheFieldF32Vector.
Definition: MamaFieldCacheFieldTypes.h:345
MamaFieldCacheFieldVector()
Definition: MamaFieldCacheFieldTypes.h:400
~MamaFieldCacheFieldVector()
Definition: MamaFieldCacheFieldTypes.h:405
MamaFieldCacheFieldBasic< mama_f32_t, MAMA_FIELD_TYPE_F32 > MamaFieldCacheFieldF32
MamaFieldCacheFieldF32.
Definition: MamaFieldCacheFieldTypes.h:133
void set(MamaFieldCacheField &field, const MamaDateTime *values, mama_size_t size)
Set the values of MamDateTime vector field.
MamaFieldCacheFieldBasic< mama_u32_t, MAMA_FIELD_TYPE_U32 > MamaFieldCacheFieldU32
MamaFieldCacheFieldU32.
Definition: MamaFieldCacheFieldTypes.h:115
void set(MamaFieldCacheField &field, const T &value)
Set the field value.
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:515
MamaFieldCacheFieldVectorBasic< mama_bool_t, MAMA_FIELD_TYPE_VECTOR_BOOL > MamaFieldCacheFieldBoolVector
MamaFieldCacheFieldBoolVector.
Definition: MamaFieldCacheFieldTypes.h:285
Definition: MamaFieldCacheFieldTypes.h:397
MamaFieldCacheFieldVectorBasic< mama_i8_t, MAMA_FIELD_TYPE_VECTOR_I8 > MamaFieldCacheFieldI8Vector
MamaFieldCacheFieldI8Vector.
Definition: MamaFieldCacheFieldTypes.h:297
MamaFieldCacheFieldVectorBasic< mama_i32_t, MAMA_FIELD_TYPE_VECTOR_I32 > MamaFieldCacheFieldI32Vector
MamaFieldCacheFieldI32Vector.
Definition: MamaFieldCacheFieldTypes.h:321
Definition: MamaFieldCacheFieldTypes.h:552
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:165
The MamaFieldCacheField class is used to store the information on the type of a field and its value(s...
Definition: MamaFieldCacheField.h:41
MamaFieldCacheFieldVectorBasic.
Definition: MamaFieldCacheFieldTypes.h:244
MamaFieldCacheFieldBasic< mama_u8_t, MAMA_FIELD_TYPE_U8 > MamaFieldCacheFieldU8
MamaFieldCacheFieldU8.
Definition: MamaFieldCacheFieldTypes.h:91
Base type for fields.
Definition: MamaFieldCacheField.h:201
mama_size_t mSize
Definition: MamaFieldCacheFieldTypes.h:434
MamaFieldCacheFieldBasic< mama_f64_t, MAMA_FIELD_TYPE_F64 > MamaFieldCacheFieldF64
MamaFieldCacheFieldF64.
Definition: MamaFieldCacheFieldTypes.h:139
void checkType(const MamaFieldCacheField &field) const
Definition: MamaFieldCacheFieldTypes.h:228