EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EmaBuffer.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_EmaBuffer_h
10 #define __thomsonreuters_ema_access_EmaBuffer_h
11 
22 #include "Access/Include/Common.h"
23 
24 namespace thomsonreuters {
25 
26 namespace ema {
27 
28 namespace access {
29 
30 class CastingOperatorContext;
31 
33 {
34 public :
35 
37 
38 
40  EmaBuffer();
41 
47  EmaBuffer( const char* buf, UInt32 length );
48 
53  EmaBuffer( const EmaBuffer& buf );
55 
57 
58 
60  virtual ~EmaBuffer();
62 
64 
65 
68  EmaBuffer& clear();
69 
75  EmaBuffer& operator=( const EmaBuffer& buf );
76 
83  EmaBuffer& setFrom( const char* buf, UInt32 length );
84 
90  EmaBuffer& append( const EmaBuffer& buf );
91 
97  EmaBuffer& append( char c );
98 
105  EmaBuffer& append( const char* buf, UInt32 length );
106 
112  EmaBuffer& operator+=( const EmaBuffer& buf );
113 
119  EmaBuffer& operator+=( char );
120 
126  char& operator[]( UInt32 index );
128 
130 
131 
134  const char* c_buf() const;
135 
139  UInt32 length() const;
140 
144  const char* asRawHexString() const;
145 
149  operator const char* () const;
150 
155  bool operator==( const EmaBuffer& buf ) const;
156 
162  char operator[]( UInt32 index ) const;
164 
165 protected:
166 
167  void markDirty() const;
168 
169  char* _pBuffer;
172  mutable CastingOperatorContext* _pCastingOperatorContext;
173 };
174 
180 EmaBuffer operator+( EmaBuffer buff_1, const EmaBuffer& buff_2 );
181 
182 }
183 
184 }
185 
186 }
187 
188 #endif // __thomsonreuters_ema_access_EmaBuffer_h
CastingOperatorContext * _pCastingOperatorContext
Definition: EmaBuffer.h:172
unsigned int UInt32
represents 32-bit unsigned integer
Definition: Common.h:56
EmaBuffer operator+(EmaBuffer buff_1, const EmaBuffer &buff_2)
EmaBuffer represents a general use binary buffer.
Definition: EmaBuffer.h:32
#define EMA_ACCESS_API
Definition: Common.h:95
Common.h file provides definitions of common variable types used in EMA.