EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Map.h
Go to the documentation of this file.
1 /*|-----------------------------------------------------------------------------
2  *| This source code is provided under the Apache 2.0 license --
3  *| and is provided AS IS with no warranty or guarantee of fit for purpose. --
4  *| See the project's LICENSE.md for details. --
5  *| Copyright (C) 2019 Refinitiv. All rights reserved. --
6  *|-----------------------------------------------------------------------------
7  */
8 
9 #ifndef __thomsonreuters_ema_access_Map_h
10 #define __thomsonreuters_ema_access_Map_h
11 
110 #include "Access/Include/OmmReal.h"
111 #include "Access/Include/OmmState.h"
112 #include "Access/Include/MapEntry.h"
114 
115 namespace thomsonreuters {
116 
117 namespace ema {
118 
119 namespace access {
120 
121 class MapDecoder;
122 class MapEncoder;
123 
125 {
126 public :
127 
129 
130 
132  Map();
134 
136 
137 
139  virtual ~Map();
141 
143 
144 
147  DataType::DataTypeEnum getDataType() const;
148 
152  Data::DataCode getCode() const;
153 
157  const EmaBuffer& getAsHex() const;
158 
162  const EmaString& toString() const;
163 
167  bool forth() const;
168 
171  void reset() const;
172 
177  const MapEntry& getEntry() const;
178 
182  bool hasKeyFieldId() const;
183 
187  bool hasTotalCountHint() const;
188 
193  Int16 getKeyFieldId() const;
194 
199  UInt32 getTotalCountHint() const;
200 
205  const SummaryData& getSummaryData() const;
207 
209 
210 
214  Map& clear();
215 
221  Map& keyFieldId( Int16 fieldId );
222 
228  Map& totalCountHint( UInt32 totalCountHint );
229 
237  Map& summaryData( const ComplexType& summaryData );
238 
246  Map& keyType( DataType::DataTypeEnum keyPrimitiveType );
247 
256  Map& addKeyInt( Int64 key, MapEntry::MapAction action,
257  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
258 
266  Map& addKeyInt( Int64 key, MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
267 
276  Map& addKeyUInt( UInt64 key, MapEntry::MapAction action,
277  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
278 
286  Map& addKeyUInt( UInt64 key, MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
287 
297  Map& addKeyReal( Int64 mantissa, OmmReal::MagnitudeType magnitudeType, MapEntry::MapAction action,
298  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
299 
308  Map& addKeyReal( Int64 mantissa, OmmReal::MagnitudeType magnitudeType, MapEntry::MapAction action,
309  const EmaBuffer& permissionData = EmaBuffer() );
310 
320  Map& addKeyRealFromDouble( double key, MapEntry::MapAction action,
321  const ComplexType& value,
323  const EmaBuffer& permissionData = EmaBuffer() );
324 
333  Map& addKeyRealFromDouble( double key, MapEntry::MapAction action,
335  const EmaBuffer& permissionData = EmaBuffer() );
336 
345  Map& addKeyFloat( float key, MapEntry::MapAction action,
346  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
347 
355  Map& addKeyFloat( float key, MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
356 
365  Map& addKeyDouble( double key, MapEntry::MapAction action,
366  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
367 
375  Map& addKeyDouble(double key, MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer());
376 
388  Map& addKeyDate( UInt16 year, UInt8 month, UInt8 day, MapEntry::MapAction action,
389  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
390 
401  Map& addKeyDate( UInt16 year, UInt8 month, UInt8 day, MapEntry::MapAction action,
402  const EmaBuffer& permissionData = EmaBuffer() );
403 
418  Map& addKeyTime( UInt8 hour, UInt8 minute, UInt8 second,
419  UInt16 millisecond, UInt16 microsecond, UInt16 nanosecond,
420  MapEntry::MapAction action,
421  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
422 
436  Map& addKeyTime( UInt8 hour, UInt8 minute, UInt8 second,
437  UInt16 millisecond, UInt16 microsecond, UInt16 nanosecond,
438  MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
439 
457  Map& addKeyDateTime( UInt16 year, UInt8 month, UInt8 day,
458  UInt8 hour, UInt8 minute, UInt8 second,
459  UInt16 millisecond, UInt16 microsecond, UInt16 nanosecond,
460  MapEntry::MapAction action,
461  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
462 
479  Map& addKeyDateTime( UInt16 year, UInt8 month, UInt8 day,
480  UInt8 hour, UInt8 minute, UInt8 second,
481  UInt16 millisecond, UInt16 microsecond, UInt16 nanosecond,
482  MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
483 
493  Map& addKeyQos( UInt32 timeliness, UInt32 rate, MapEntry::MapAction action,
494  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
495 
504  Map& addKeyQos( UInt32 timeliness, UInt32 rate, MapEntry::MapAction action,
505  const EmaBuffer& permissionData = EmaBuffer() );
506 
518  Map& addKeyState( OmmState::StreamState streamState, OmmState::DataState dataState, UInt8 statusCode, const EmaString& statusText,
519  MapEntry::MapAction action,
520  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
521 
532  Map& addKeyState( OmmState::StreamState streamState, OmmState::DataState dataState, UInt8 statusCode, const EmaString& statusText,
533  MapEntry::MapAction action, const EmaBuffer& permissionData = EmaBuffer() );
534 
543  Map& addKeyEnum( UInt16 key, MapEntry::MapAction action,
544  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
545 
553  Map& addKeyEnum( UInt16 key, MapEntry::MapAction action,
554  const EmaBuffer& permissionData = EmaBuffer() );
555 
564  Map& addKeyBuffer( const EmaBuffer& key, MapEntry::MapAction action,
565  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
566 
574  Map& addKeyBuffer( const EmaBuffer& key, MapEntry::MapAction action,
575  const EmaBuffer& permissionData = EmaBuffer() );
576 
585  Map& addKeyAscii( const EmaString& key, MapEntry::MapAction action,
586  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
587 
595  Map& addKeyAscii( const EmaString& key, MapEntry::MapAction action,
596  const EmaBuffer& permissionData = EmaBuffer() );
597 
606  Map& addKeyUtf8( const EmaBuffer& key, MapEntry::MapAction action,
607  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
608 
616  Map& addKeyUtf8( const EmaBuffer& key, MapEntry::MapAction action,
617  const EmaBuffer& permissionData = EmaBuffer() );
618 
627  Map& addKeyRmtes( const EmaBuffer& key, MapEntry::MapAction action,
628  const ComplexType& value, const EmaBuffer& permissionData = EmaBuffer() );
629 
637  Map& addKeyRmtes( const EmaBuffer& key, MapEntry::MapAction action,
638  const EmaBuffer& permissionData = EmaBuffer() );
639 
644  const Map& complete();
646 
647 private :
648 
649  Decoder& getDecoder();
650  bool hasDecoder() const;
651 
652  const Encoder& getEncoder() const;
653  bool hasEncoder() const;
654 
655  const EmaString& toString( UInt64 indent ) const;
656 
657  mutable EmaString _toString;
658  MapEntry _entry;
659  SummaryData _summary;
660  MapDecoder* _pDecoder;
661  mutable MapEncoder* _pEncoder;
662 
663  Map( const Map& );
664  Map& operator=( const Map& );
665 };
666 
667 }
668 
669 }
670 
671 }
672 
673 #endif // __thomsonreuters_ema_access_Map_h
long long Int64
represents 64-bit signed integer
Definition: Common.h:74
unsigned short UInt16
represents 16-bit unsigned integer
Definition: Common.h:44
unsigned long long UInt64
represents 64-bit unsigned integer
Definition: Common.h:68
unsigned int UInt32
represents 32-bit unsigned integer
Definition: Common.h:56
EmaString class is a container of a null terminated Ascii character string.
Definition: EmaString.h:56
EmaBuffer represents a general use binary buffer.
Definition: EmaBuffer.h:32
SummaryData is used to convey Omm SummaryData information optionally present on Map, Series and Vector.
Definition: SummaryData.h:98
#define EMA_ACCESS_API
Definition: Common.h:95
ComplexType class is a parent class from whom all complex data types inherit.
Definition: ComplexType.h:33
MapEntry represents an entry of Map.
Definition: MapEntry.h:95
Map is a homogeneous container of complex data type entries.
Definition: Map.h:124
unsigned char UInt8
represents 8-bit unsigned integer
Definition: Common.h:32
short Int16
represents 16-bit signed integer
Definition: Common.h:50