diff options
| author | Alan Conway <aconway@apache.org> | 2008-01-10 22:50:23 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-01-10 22:50:23 +0000 |
| commit | 6005ad88685a4bad8bdaa986a8b94fdffc51b31e (patch) | |
| tree | 3f263060806fa3e4d92265c3e43e0eba3c829d7a /cpp/src/qpid/framing/Buffer.h | |
| parent | 1b7c1ba40170027956d7df585eaae385d2511669 (diff) | |
| download | qpid-python-6005ad88685a4bad8bdaa986a8b94fdffc51b31e.tar.gz | |
Client always collects at least an entire frameset into a single buffer
when possible. Based on patch from Gordon Sim.
- Refactor Connector::writebuff, ::send as Connector::Writer
- Collect frames up to EOF notifying AIO write.
- Encode all available complete framesets into buffers as compactly as possible.
- Logging buffer size and frames encoded per write for client and broker.
- framing::Buffer added getPosition(), getSize(), default ctor, copy ctor.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@610972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing/Buffer.h')
| -rw-r--r-- | cpp/src/qpid/framing/Buffer.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/qpid/framing/Buffer.h b/cpp/src/qpid/framing/Buffer.h index fe33dbd366..5ab897d351 100644 --- a/cpp/src/qpid/framing/Buffer.h +++ b/cpp/src/qpid/framing/Buffer.h @@ -34,7 +34,7 @@ class FieldTable; class Buffer { - const uint32_t size; + uint32_t size; char* data; uint32_t position; uint32_t r_position; @@ -43,13 +43,16 @@ class Buffer public: - Buffer(char* data, uint32_t size); + Buffer(char* data=0, uint32_t size=0); void record(); void restore(bool reRecord = false); void reset(); - uint32_t available(); - + + uint32_t available() { return size - position; } + uint32_t getSize() { return size; } + uint32_t getPosition() { return position; } + void putOctet(uint8_t i); void putShort(uint16_t i); void putLong(uint32_t i); |
