00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "amqp_types.h"
00022
00023 #ifndef _Buffer_
00024 #define _Buffer_
00025
00026 namespace qpid {
00027 namespace framing {
00028
00029 class Content;
00030 class FieldTable;
00031
00032 class Buffer
00033 {
00034 const uint32_t size;
00035 const bool owner;
00036 char* data;
00037 uint32_t position;
00038 uint32_t limit;
00039 uint32_t r_position;
00040 uint32_t r_limit;
00041
00042 public:
00043
00044 Buffer(uint32_t size);
00045 Buffer(char* data, uint32_t size);
00046 ~Buffer();
00047
00048 void flip();
00049 void clear();
00050 void compact();
00051 void record();
00052 void restore();
00053 uint32_t available();
00054 char* start();
00055 void move(uint32_t bytes);
00056
00057 void putOctet(uint8_t i);
00058 void putShort(uint16_t i);
00059 void putLong(uint32_t i);
00060 void putLongLong(uint64_t i);
00061
00062 uint8_t getOctet();
00063 uint16_t getShort();
00064 uint32_t getLong();
00065 uint64_t getLongLong();
00066
00067 void putShortString(const string& s);
00068 void putLongString(const string& s);
00069 void getShortString(string& s);
00070 void getLongString(string& s);
00071
00072 void putFieldTable(const FieldTable& t);
00073 void getFieldTable(FieldTable& t);
00074
00075 void putContent(const Content& c);
00076 void getContent(Content& c);
00077
00078 void putRawData(const string& s);
00079 void getRawData(string& s, uint32_t size);
00080
00081 };
00082
00083 }}
00084
00085
00086 #endif