@@ -73,7 +73,7 @@ class APACHE_GEODE_EXPORT DataInput {
7373 */
7474 inline bool readBoolean () {
7575 _GEODE_CHECK_BUFFER_SIZE (1 );
76- return *(m_buf ++) == 1 ? true : false ;
76+ return *(buffer_ ++) == 1 ? true : false ;
7777 }
7878
7979 /* *
@@ -89,8 +89,8 @@ class APACHE_GEODE_EXPORT DataInput {
8989 inline void readBytesOnly (uint8_t * buffer, size_t len) {
9090 if (len > 0 ) {
9191 _GEODE_CHECK_BUFFER_SIZE (len);
92- std::memcpy (buffer, m_buf , len);
93- m_buf += len;
92+ std::memcpy (buffer, buffer_ , len);
93+ buffer_ += len;
9494 }
9595 }
9696
@@ -107,8 +107,8 @@ class APACHE_GEODE_EXPORT DataInput {
107107 inline void readBytesOnly (int8_t * buffer, size_t len) {
108108 if (len > 0 ) {
109109 _GEODE_CHECK_BUFFER_SIZE (len);
110- std::memcpy (buffer, m_buf , len);
111- m_buf += len;
110+ std::memcpy (buffer, buffer_ , len);
111+ buffer_ += len;
112112 }
113113 }
114114
@@ -129,8 +129,8 @@ class APACHE_GEODE_EXPORT DataInput {
129129 if (length > 0 ) {
130130 _GEODE_CHECK_BUFFER_SIZE (length);
131131 _GEODE_NEW (buffer, uint8_t [length]);
132- std::memcpy (buffer, m_buf , length);
133- m_buf += length;
132+ std::memcpy (buffer, buffer_ , length);
133+ buffer_ += length;
134134 }
135135 *bytes = buffer;
136136 }
@@ -152,8 +152,8 @@ class APACHE_GEODE_EXPORT DataInput {
152152 if (length > 0 ) {
153153 _GEODE_CHECK_BUFFER_SIZE (length);
154154 _GEODE_NEW (buffer, int8_t [length]);
155- std::memcpy (buffer, m_buf , length);
156- m_buf += length;
155+ std::memcpy (buffer, buffer_ , length);
156+ buffer_ += length;
157157 }
158158 *bytes = buffer;
159159 }
@@ -173,10 +173,10 @@ class APACHE_GEODE_EXPORT DataInput {
173173 */
174174 inline int32_t readInt32 () {
175175 _GEODE_CHECK_BUFFER_SIZE (4 );
176- int32_t tmp = *(m_buf ++);
177- tmp = (tmp << 8 ) | *(m_buf ++);
178- tmp = (tmp << 8 ) | *(m_buf ++);
179- tmp = (tmp << 8 ) | *(m_buf ++);
176+ int32_t tmp = *(buffer_ ++);
177+ tmp = (tmp << 8 ) | *(buffer_ ++);
178+ tmp = (tmp << 8 ) | *(buffer_ ++);
179+ tmp = (tmp << 8 ) | *(buffer_ ++);
180180 return tmp;
181181 }
182182
@@ -186,14 +186,14 @@ class APACHE_GEODE_EXPORT DataInput {
186186 inline int64_t readInt64 () {
187187 _GEODE_CHECK_BUFFER_SIZE (8 );
188188 int64_t tmp;
189- tmp = *(m_buf ++);
190- tmp = (tmp << 8 ) | *(m_buf ++);
191- tmp = (tmp << 8 ) | *(m_buf ++);
192- tmp = (tmp << 8 ) | *(m_buf ++);
193- tmp = (tmp << 8 ) | *(m_buf ++);
194- tmp = (tmp << 8 ) | *(m_buf ++);
195- tmp = (tmp << 8 ) | *(m_buf ++);
196- tmp = (tmp << 8 ) | *(m_buf ++);
189+ tmp = *(buffer_ ++);
190+ tmp = (tmp << 8 ) | *(buffer_ ++);
191+ tmp = (tmp << 8 ) | *(buffer_ ++);
192+ tmp = (tmp << 8 ) | *(buffer_ ++);
193+ tmp = (tmp << 8 ) | *(buffer_ ++);
194+ tmp = (tmp << 8 ) | *(buffer_ ++);
195+ tmp = (tmp << 8 ) | *(buffer_ ++);
196+ tmp = (tmp << 8 ) | *(buffer_ ++);
197197 return tmp;
198198 }
199199
@@ -396,33 +396,33 @@ class APACHE_GEODE_EXPORT DataInput {
396396 * as readonly and modification of contents using this internal pointer
397397 * has undefined behavior.
398398 */
399- inline const uint8_t * currentBufferPosition () const { return m_buf ; }
399+ inline const uint8_t * currentBufferPosition () const { return buffer_ ; }
400400
401401 /* * get the number of bytes read in the buffer */
402- inline size_t getBytesRead () const { return m_buf - m_bufHead ; }
402+ inline size_t getBytesRead () const { return buffer_ - bufferHead_ ; }
403403
404404 /* * get the number of bytes remaining to be read in the buffer */
405405 inline size_t getBytesRemaining () const {
406- return (m_bufLength - getBytesRead ());
406+ return (bufferLength_ - getBytesRead ());
407407 }
408408
409409 /* * advance the cursor by given offset */
410- inline void advanceCursor (size_t offset) { m_buf += offset; }
410+ inline void advanceCursor (size_t offset) { buffer_ += offset; }
411411
412412 /* * rewind the cursor by given offset */
413- inline void rewindCursor (size_t offset) { m_buf -= offset; }
413+ inline void rewindCursor (size_t offset) { buffer_ -= offset; }
414414
415415 /* * reset the cursor to the start of buffer */
416- inline void reset () { m_buf = m_bufHead ; }
416+ inline void reset () { buffer_ = bufferHead_ ; }
417417
418418 inline void setBuffer () {
419- m_buf = currentBufferPosition ();
420- m_bufLength = getBytesRemaining ();
419+ buffer_ = currentBufferPosition ();
420+ bufferLength_ = getBytesRemaining ();
421421 }
422422
423- inline void resetPdx (size_t offset) { m_buf = m_bufHead + offset; }
423+ inline void resetPdx (size_t offset) { buffer_ = bufferHead_ + offset; }
424424
425- inline size_t getPdxBytes () const { return m_bufLength ; }
425+ inline size_t getPdxBytes () const { return bufferLength_ ; }
426426
427427 static uint8_t * getBufferCopy (const uint8_t * from, size_t length) {
428428 uint8_t * result;
@@ -432,7 +432,7 @@ class APACHE_GEODE_EXPORT DataInput {
432432 return result;
433433 }
434434
435- inline void reset (size_t offset) { m_buf = m_bufHead + offset; }
435+ inline void reset (size_t offset) { buffer_ = bufferHead_ + offset; }
436436
437437 uint8_t * getBufferCopyFrom (const uint8_t * from, size_t length) {
438438 uint8_t * result;
@@ -452,19 +452,19 @@ class APACHE_GEODE_EXPORT DataInput {
452452 DataInput& operator =(DataInput&&) = default ;
453453
454454 protected:
455+ const uint8_t * buffer_;
456+ const uint8_t * bufferHead_;
457+ size_t bufferLength_;
458+ Pool* pool_;
459+ const CacheImpl* cache_;
460+
455461 /* * constructor given a pre-allocated byte array with size */
456462 DataInput (const uint8_t * buffer, size_t len, const CacheImpl* cache,
457463 Pool* pool);
458464
459465 virtual const SerializationRegistry& getSerializationRegistry () const ;
460466
461467 private:
462- const uint8_t * m_buf;
463- const uint8_t * m_bufHead;
464- size_t m_bufLength;
465- Pool* m_pool;
466- const CacheImpl* m_cache;
467-
468468 std::shared_ptr<Serializable> readObjectInternal (int8_t typeId = -1 );
469469
470470 template <typename mType >
@@ -502,21 +502,21 @@ class APACHE_GEODE_EXPORT DataInput {
502502
503503 inline char readPdxChar () { return static_cast <char >(readInt16 ()); }
504504
505- inline void _checkBufferSize (size_t size, int32_t line) {
506- if ((m_bufLength - (m_buf - m_bufHead )) < size) {
505+ virtual void _checkBufferSize (size_t size, int32_t line) {
506+ if ((bufferLength_ - (buffer_ - bufferHead_ )) < size) {
507507 throw OutOfRangeException (
508508 " DataInput: attempt to read beyond buffer at line " +
509509 std::to_string (line) + " : available buffer size " +
510- std::to_string (m_bufLength - (m_buf - m_bufHead )) +
510+ std::to_string (bufferLength_ - (buffer_ - bufferHead_ )) +
511511 " , attempted read of size " + std::to_string (size));
512512 }
513513 }
514514
515- inline int8_t readNoCheck () { return *(m_buf ++); }
515+ inline int8_t readNoCheck () { return *(buffer_ ++); }
516516
517517 inline int16_t readInt16NoCheck () {
518- int16_t tmp = *(m_buf ++);
519- tmp = static_cast <int16_t >((tmp << 8 ) | *(m_buf ++));
518+ int16_t tmp = *(buffer_ ++);
519+ tmp = static_cast <int16_t >((tmp << 8 ) | *(buffer_ ++));
520520 return tmp;
521521 }
522522
@@ -605,7 +605,7 @@ class APACHE_GEODE_EXPORT DataInput {
605605 value.assign (reinterpret_cast <const wchar_t *>(tmp.data ()), tmp.length ());
606606 }
607607
608- Pool* getPool () const { return m_pool ; }
608+ Pool* getPool () const { return pool_ ; }
609609
610610 friend Cache;
611611 friend CacheImpl;
0 commit comments