EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OmmArray.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_OmmArray_h
10 #define __thomsonreuters_ema_access_OmmArray_h
11 
70 #include "Access/Include/Data.h"
71 #include "Access/Include/OmmReal.h"
73 #include "Access/Include/OmmQos.h"
75 
76 namespace thomsonreuters {
77 
78 namespace ema {
79 
80 namespace access {
81 
82 class OmmArrayDecoder;
83 class OmmArrayEncoder;
84 
86 {
87 public :
88 
90 
91 
93  OmmArray();
95 
97 
98 
100  virtual ~OmmArray();
102 
104 
105 
108  DataType::DataTypeEnum getDataType() const;
109 
113  Data::DataCode getCode() const;
114 
118  const EmaBuffer& getAsHex() const;
119 
123  const EmaString& toString() const;
124 
128  bool hasFixedWidth() const;
129 
133  UInt16 getFixedWidth() const;
134 
139  bool forth() const;
140 
145  const OmmArrayEntry& getEntry() const;
146 
149  void reset() const;
151 
153 
154 
158  OmmArray& clear();
159 
196  OmmArray& fixedWidth( UInt16 width );
197 
203  OmmArray& addInt( Int64 value );
204 
210  OmmArray& addUInt( UInt64 value );
211 
218  OmmArray& addReal( Int64 mantissa, OmmReal::MagnitudeType magnitudeType );
219 
226  OmmArray& addRealFromDouble( double value, OmmReal::MagnitudeType magnitudeType = OmmReal::Exponent0Enum );
227 
233  OmmArray& addFloat( float value );
234 
240  OmmArray& addDouble( double value );
241 
250  OmmArray& addDate( UInt16 year, UInt8 month, UInt8 day );
251 
263  OmmArray& addTime( UInt8 hour = 0, UInt8 minute = 0, UInt8 second = 0,
264  UInt16 millisecond = 0, UInt16 microsecond = 0, UInt16 nanosecond = 0 );
265 
280  OmmArray& addDateTime( UInt16 year, UInt8 month, UInt8 day,
281  UInt8 hour = 0, UInt8 minute = 0, UInt8 second = 0,
282  UInt16 millisecond = 0, UInt16 microsecond = 0, UInt16 nanosecond = 0 );
283 
290  OmmArray& addQos( UInt32 timeliness = OmmQos::RealTimeEnum, UInt32 rate = OmmQos::TickByTickEnum );
291 
300  OmmArray& addState( OmmState::StreamState streamState = OmmState::OpenEnum,
302  UInt8 statusCode = OmmState::NoneEnum,
303  const EmaString& statusText = EmaString() );
304 
310  OmmArray& addEnum( UInt16 value );
311 
317  OmmArray& addBuffer( const EmaBuffer& value );
318 
324  OmmArray& addAscii( const EmaString& value );
325 
331  OmmArray& addUtf8( const EmaBuffer& value );
332 
338  OmmArray& addRmtes( const EmaBuffer& value );
339 
344  OmmArray& addCodeInt();
345 
350  OmmArray& addCodeUInt();
351 
356  OmmArray& addCodeReal();
357 
362  OmmArray& addCodeFloat();
363 
368  OmmArray& addCodeDouble();
369 
374  OmmArray& addCodeDate();
375 
380  OmmArray& addCodeTime();
381 
386  OmmArray& addCodeDateTime();
387 
392  OmmArray& addCodeQos();
393 
398  OmmArray& addCodeState();
399 
404  OmmArray& addCodeEnum();
405 
410  OmmArray& addCodeBuffer();
411 
416  OmmArray& addCodeAscii();
417 
422  OmmArray& addCodeUtf8();
423 
428  OmmArray& addCodeRmtes();
429 
433  const OmmArray& complete();
435 
436 private :
437 
438  Decoder& getDecoder();
439  bool hasDecoder() const;
440 
441  const Encoder& getEncoder() const;
442  bool hasEncoder() const;
443 
444  const EmaString& toString( UInt64 indent ) const;
445 
446  mutable EmaString _toString;
447  OmmArrayEntry _entry;
448  OmmArrayDecoder* _pDecoder;
449  mutable OmmArrayEncoder* _pEncoder;
450 
451  OmmArray( const OmmArray& );
452  OmmArray& operator=( const OmmArray& );
453 };
454 
455 }
456 
457 }
458 
459 }
460 
461 #endif // __thomsonreuters_ema_access_OmmArray_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
#define EMA_ACCESS_API
Definition: Common.h:95
OmmArrayEntry represents an entry of OmmArray.
Definition: OmmArrayEntry.h:77
OmmArray is a homogeneous container of primitive data type entries.
Definition: OmmArray.h:85
Data class is a parent abstract class defining common interfaces for all Data type classes...
Definition: Data.h:38
unsigned char UInt8
represents 8-bit unsigned integer
Definition: Common.h:32