EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ElementList.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_ElementList_h
10 #define __thomsonreuters_ema_access_ElementList_h
11 
143 #include "Access/Include/OmmReal.h"
144 #include "Access/Include/OmmState.h"
145 #include "Access/Include/OmmQos.h"
147 
148 namespace thomsonreuters {
149 
150 namespace ema {
151 
152 namespace access {
153 
154 class EmaString;
155 class EmaBuffer;
156 class ReqMsg;
157 class RefreshMsg;
158 class StatusMsg;
159 class UpdateMsg;
160 class GenericMsg;
161 class PostMsg;
162 class AckMsg;
163 class FieldList;
164 class Map;
165 class Vector;
166 class Series;
167 class FilterList;
168 class OmmArray;
169 class OmmOpaque;
170 class OmmXml;
171 class OmmAnsiPage;
172 
173 class ElementListDecoder;
174 class ElementListEncoder;
175 
177 {
178 public :
179 
181 
182 
184  ElementList();
186 
188 
189 
191  virtual ~ElementList();
193 
195 
196 
199  DataType::DataTypeEnum getDataType() const;
200 
204  Data::DataCode getCode() const;
205 
209  const EmaBuffer& getAsHex() const;
210 
214  const EmaString& toString() const;
215 
219  bool hasInfo() const;
220 
225  Int16 getInfoElementListNum() const;
226 
231  bool forth() const;
232 
238  bool forth( const EmaString& name ) const;
239 
245  bool forth( const Data& data ) const;
246 
251  const ElementEntry& getEntry() const;
252 
255  void reset() const;
257 
259 
260 
264  ElementList& clear();
265 
272  ElementList& info( Int16 elementListNum );
273 
280  ElementList& addReqMsg( const EmaString& name, const ReqMsg& value );
281 
288  ElementList& addRefreshMsg( const EmaString& name, const RefreshMsg& value );
289 
296  ElementList& addStatusMsg( const EmaString& name, const StatusMsg& value );
297 
304  ElementList& addUpdateMsg( const EmaString& name, const UpdateMsg& value );
305 
312  ElementList& addPostMsg( const EmaString& name, const PostMsg& value );
313 
320  ElementList& addAckMsg( const EmaString& name, const AckMsg& value );
321 
328  ElementList& addGenericMsg( const EmaString& name, const GenericMsg& value );
329 
336  ElementList& addFieldList( const EmaString& name, const FieldList& value );
337 
344  ElementList& addElementList( const EmaString& name, const ElementList& value );
345 
352  ElementList& addMap( const EmaString& name, const Map& value );
353 
360  ElementList& addVector( const EmaString& name, const Vector& value );
361 
368  ElementList& addSeries( const EmaString& name, const Series& value );
369 
376  ElementList& addFilterList( const EmaString& name, const FilterList& value );
377 
384  ElementList& addOpaque( const EmaString& name, const OmmOpaque& value );
385 
392  ElementList& addXml( const EmaString& name, const OmmXml& value );
393 
400  ElementList& addAnsiPage( const EmaString& name, const OmmAnsiPage& value );
401 
408  ElementList& addInt( const EmaString& name, Int64 value );
409 
416  ElementList& addUInt( const EmaString& name, UInt64 value );
417 
425  ElementList& addReal( const EmaString& name, Int64 mantissa, OmmReal::MagnitudeType magnitudeType );
426 
434  ElementList& addRealFromDouble( const EmaString& name, double value,
436 
443  ElementList& addFloat( const EmaString& name, float value );
444 
451  ElementList& addDouble( const EmaString& name, double value );
452 
462  ElementList& addDate( const EmaString& name, UInt16 year, UInt8 month, UInt8 day );
463 
476  ElementList& addTime( const EmaString& name, UInt8 hour = 0, UInt8 minute = 0, UInt8 second = 0,
477  UInt16 millisecond = 0, UInt16 microsecond = 0, UInt16 nanosecond = 0 );
478 
494  ElementList& addDateTime( const EmaString& name,
495  UInt16 year, UInt8 month, UInt8 day,
496  UInt8 hour = 0, UInt8 minute = 0, UInt8 second = 0,
497  UInt16 millisecond = 0, UInt16 microsecond = 0, UInt16 nanosecond = 0 );
498 
506  ElementList& addQos( const EmaString& name,
507  UInt32 timeliness = OmmQos::RealTimeEnum,
509 
519  ElementList& addState( const EmaString& name,
522  UInt8 statusCode = OmmState::NoneEnum,
523  const EmaString& statusText = EmaString() );
524 
531  ElementList& addEnum( const EmaString& name, UInt16 value );
532 
539  ElementList& addBuffer( const EmaString& name, const EmaBuffer& value );
540 
547  ElementList& addAscii( const EmaString& name, const EmaString& value );
548 
555  ElementList& addUtf8( const EmaString& name, const EmaBuffer& value );
556 
563  ElementList& addRmtes( const EmaString& name, const EmaBuffer& value );
564 
571  ElementList& addArray( const EmaString& name, const OmmArray& value );
572 
577  ElementList& addCodeInt( const EmaString& name );
578 
583  ElementList& addCodeUInt( const EmaString& name );
584 
589  ElementList& addCodeReal( const EmaString& name );
590 
595  ElementList& addCodeFloat( const EmaString& name );
596 
601  ElementList& addCodeDouble( const EmaString& name );
602 
607  ElementList& addCodeDate( const EmaString& name );
608 
613  ElementList& addCodeTime( const EmaString& name );
614 
619  ElementList& addCodeDateTime( const EmaString& name );
620 
625  ElementList& addCodeQos( const EmaString& name );
626 
631  ElementList& addCodeState( const EmaString& name );
632 
637  ElementList& addCodeEnum( const EmaString& name );
638 
643  ElementList& addCodeBuffer( const EmaString& name );
644 
649  ElementList& addCodeAscii( const EmaString& name );
650 
655  ElementList& addCodeUtf8( const EmaString& name );
656 
661  ElementList& addCodeRmtes( const EmaString& name );
662 
667  ElementList& add( const EmaString& name );
668 
673  const ElementList& complete();
675 
676 private :
677 
678  void getInfoXmlStr( EmaString& ) const;
679 
680  Decoder& getDecoder();
681  bool hasDecoder() const;
682 
683  const Encoder& getEncoder() const;
684  bool hasEncoder() const;
685 
686  const EmaString& toString( UInt64 indent ) const;
687 
688  mutable EmaString _toString;
689  ElementEntry _entry;
690  ElementListDecoder* _pDecoder;
691  mutable ElementListEncoder* _pEncoder;
692 
693  ElementList( const ElementList& );
694  ElementList& operator=( const ElementList& );
695 };
696 
697 }
698 
699 }
700 
701 }
702 
703 #endif // __thomsonreuters_ema_access_ElementList_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
FilterList is a heterogeneous container of complex data type entries.
Definition: FilterList.h:132
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
OmmOpaque represents Opaque data format in Omm.
Definition: OmmOpaque.h:72
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
ReqMsg allows consumer application to express its interest in an item.
Definition: ReqMsg.h:58
#define EMA_ACCESS_API
Definition: Common.h:95
Vector is a homogeneous container of complex data type entries.
Definition: Vector.h:121
ComplexType class is a parent class from whom all complex data types inherit.
Definition: ComplexType.h:33
StatusMsg conveys item state information.
Definition: StatusMsg.h:79
RefreshMsg conveys item image, state, permission and group information.
Definition: RefreshMsg.h:78
GenericMsg allows applications to bidirectionally send messages without any implied message semantics...
Definition: GenericMsg.h:86
ElementList is a heterogeneous container of complex and primitive data type entries.
Definition: ElementList.h:176
OmmXml represents XML data format in Omm.
Definition: OmmXml.h:72
OmmArray is a homogeneous container of primitive data type entries.
Definition: OmmArray.h:85
FieldList is a heterogeneous container of complex and primitive data type entries.
Definition: FieldList.h:178
UpdateMsg conveys changes to item data.
Definition: UpdateMsg.h:71
Series is a homogeneous container of complex data type entries.
Definition: Series.h:128
Map is a homogeneous container of complex data type entries.
Definition: Map.h:124
PostMsg allows consumer applications to contribute content.
Definition: PostMsg.h:61
Data class is a parent abstract class defining common interfaces for all Data type classes...
Definition: Data.h:38
AckMsg indicates success or failure of PostMsg.
Definition: AckMsg.h:67
unsigned char UInt8
represents 8-bit unsigned integer
Definition: Common.h:32
ElementEntry represents an entry of ElementList.
Definition: ElementEntry.h:96
OmmAnsiPage represents AnsiPage data format in Omm.
Definition: OmmAnsiPage.h:72
short Int16
represents 16-bit signed integer
Definition: Common.h:50