qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r573213 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/framing: Buffer.cpp Buffer.h
Date Thu, 06 Sep 2007 10:36:18 GMT
Author: astitcher
Date: Thu Sep  6 03:36:17 2007
New Revision: 573213

URL: http://svn.apache.org/viewvc?rev=573213&view=rev
Log:
* Tidy up framing::Buffer class

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.cpp?rev=573213&r1=573212&r2=573213&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.cpp Thu Sep  6 03:36:17 2007
@@ -22,57 +22,24 @@
 #include "FramingContent.h" 
 #include "FieldTable.h" 
 
-//qpid::framing::Buffer::Buffer(uint32_t _size) : size(_size), owner(true), position(0),
limit(_size){
-//    data = new char[size];
-//}
-
-qpid::framing::Buffer::Buffer(char* _data, uint32_t _size) : size(_size), owner(false), data(_data),
position(0), limit(_size){
-}
-
-qpid::framing::Buffer::~Buffer(){
-    if(owner) delete[] data;
+qpid::framing::Buffer::Buffer(char* _data, uint32_t _size)
+    : size(_size), data(_data), position(0) {
 }
 
-//void qpid::framing::Buffer::flip(){
-//    limit = position;
-//    position = 0;
-//}
-
-//void qpid::framing::Buffer::clear(){
-//    limit = size;
-//    position = 0;
-//}
-
-//void qpid::framing::Buffer::compact(){
-//    uint32_t p = limit - position;
-//    //copy p chars from position to 0
-//    memmove(data, data + position, p);
-//    limit = size;
-//    position = p;
-//}
-
 void qpid::framing::Buffer::record(){
     r_position = position;
-    r_limit = limit;
 }
 
 void qpid::framing::Buffer::restore(){
     position = r_position;
-    limit = r_limit;
 }
 
 uint32_t qpid::framing::Buffer::available(){
-    return limit - position;
+    return size - position;
 }
 
-//char* qpid::framing::Buffer::start(){
-//    return data + position;
-//}
+///////////////////////////////////////////////////
 
-//void qpid::framing::Buffer::move(uint32_t bytes){
-//    position += bytes;
-//}
-    
 void qpid::framing::Buffer::putOctet(uint8_t i){
     data[position++] = i;
 }

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.h?rev=573213&r1=573212&r2=573213&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/framing/Buffer.h Thu Sep  6 03:36:17 2007
@@ -32,27 +32,17 @@
 class Buffer
 {
     const uint32_t size;
-    const bool owner;//indicates whether the data is owned by this instance
     char* data;
     uint32_t position;
-    uint32_t limit;
     uint32_t r_position;
-    uint32_t r_limit;
 
 public:
 
-    //Buffer(uint32_t size);
     Buffer(char* data, uint32_t size);
-    ~Buffer();
 
-    //void flip();
-    //void clear();
-    //void compact();
     void record();
     void restore();
     uint32_t available();
-    //char* start();
-    //void move(uint32_t bytes);
     
     void putOctet(uint8_t i);
     void putShort(uint16_t i);



Mime
View raw message