6 #ifndef CMR_COMM_BUFFER_INCLUDED
7 #define CMR_COMM_BUFFER_INCLUDED
41 class DictionaryManager
50 DictionaryManager(
const DictionaryManager&);
53 int get_element_pos(
const AString& elmt)
const;
54 AString get_element_at(
int pos)
const;
55 bool add_element(
const AString& elmt);
58 return attributes.size();
63 void splice(DictionaryManager& src);
67 mutable DictionaryManager dictionary_manager_;
100 Byte flags_[NB_FLAGS];
106 enum { DECLARED_DATA_SIZE = 4 };
107 Byte s_[DECLARED_DATA_SIZE];
115 static bool decodeHeader(
Byte* header ,
int* version,
Byte flag[],
size_t* size,
int* chunkTag);
117 void update_header();
118 bool update_from_header();
119 void set_is_last_page(
bool value)
121 is_last_page_ = value;
123 bool is_last_page()
const
125 return is_last_page_;
128 bool push_flag(
Byte flag);
129 void clear_flag(
Byte flag);
130 bool has_flag(
Byte flag);
133 size_t get_size()
const
148 Pos() : current_page_(0), current_pos_(0), on_first_page_(
true) {}
169 void set_size(
size_t size)
178 bool is_ascii()
const
182 void set_is_ascii(
bool is_ascii)
184 is_ascii_ = is_ascii;
186 void update_ascii_flags();
189 void update_headers();
198 Byte* allocate(
size_t& size);
205 Byte* allocate_in_new_page(
size_t size,
bool reserveHeader);
211 size_t add_size(
size_t size);
217 void splice(CommBuffer& x);
230 long write_byte(
const Byte* b,
size_t size);
231 long write_raw(
const Byte* b,
size_t size);
232 long read_byte(
Byte* b,
size_t size)
const;
234 long write_using_dictionary(
const AString& v);
235 long write(
const AString& v);
236 long write(
const String& v);
237 long write(
const StringBuffer& v);
238 long write(
const Blob& v);
239 long write(
const TimePeriod& v);
240 long write(
const TimeDate& v);
241 long write(
const Symbol& v);
242 long write(
const Tuple& v);
243 long write(
const Bool& v);
244 long write(
const Int& v);
245 long write(
const UInt& v);
246 long write(
const long& v);
247 long write(
const unsigned long& v);
248 long write(
const Long& v);
249 long write(
const ULong& v);
250 long write(
const Short& v);
251 long write(
const UShort& v);
252 long write(
const Float& v);
253 long write(
const Double& v);
254 long write(
const ArrayInt& v);
255 long write(
const ArrayLong& v);
256 long write(
const ArrayFloat& v);
257 long write(
const ArrayDouble& v);
258 long write(
const ListBool& v);
259 long write(
const ListInt& v);
260 long write(
const ListUInt& v);
261 long write(
const ListLong& v);
262 long write(
const ListULong& v);
263 long write(
const ListShort& v);
264 long write(
const ListUShort& v);
265 long write(
const ListFloat& v);
266 long write(
const ListDouble& v);
267 long write(
const ListAString& v);
268 long write(
const ListString& v);
269 long write(
const ListStringBuffer& v);
270 long write(
const ListTimePeriod& v);
271 long write(
const ListTimeDate& v);
272 long write(
const ListBlob& v);
273 long write(
const ListSymbol& v);
274 long write(
const ListTuple& v);
275 long write(
const ListArrayInt& v);
276 long write(
const ListArrayLong& v);
277 long write(
const ListArrayFloat& v);
278 long write(
const ListArrayDouble& v);
281 long read_using_dictionary(AString& v)
const;
282 long read(AString& v)
const;
283 long read(String& v)
const;
284 long read(StringBuffer& v)
const;
285 long read(Blob& v)
const;
286 long read(TimePeriod& v)
const;
287 long read(TimeDate& v)
const;
288 long read(Symbol& v)
const;
289 long read(Tuple& v)
const;
290 long read(Bool& v)
const;
291 long read(Int& v)
const;
292 long read(UInt& v)
const;
293 long read(
long& v)
const;
294 long read(
unsigned long& v)
const;
295 long read(Long& v)
const;
296 long read(ULong& v)
const;
297 long read(Short& v)
const;
298 long read(UShort& v)
const;
299 long read(Float& v)
const;
300 long read(Double& v)
const;
301 long read(ArrayInt& v)
const;
302 long read(ArrayLong& v)
const;
303 long read(ArrayFloat& v)
const;
304 long read(ArrayDouble& v)
const;
305 long read(ListBool& v)
const;
306 long read(ListInt& v)
const;
307 long read(ListUInt& v)
const;
308 long read(ListLong& v)
const;
309 long read(ListULong& v)
const;
310 long read(ListShort& v)
const;
311 long read(ListUShort& v)
const;
312 long read(ListFloat& v)
const;
313 long read(ListDouble& v)
const;
314 long read(ListAString& v)
const;
315 long read(ListString& v)
const;
316 long read(ListStringBuffer& v)
const;
317 long read(ListTimePeriod& v)
const;
318 long read(ListTimeDate& v)
const;
319 long read(ListBlob& v)
const;
320 long read(ListSymbol& v)
const;
321 long read(ListTuple& v)
const;
322 long read(ListArrayInt& v)
const;
323 long read(ListArrayLong& v)
const;
324 long read(ListArrayFloat& v)
const;
325 long read(ListArrayDouble& v)
const;
327 void set_pos(
const Pos& pos);
328 long write(OBStream& o)
const;
329 long read(IBStream& o);
330 long write_file(
const Path& file_name)
const;
331 long read_file(
const Path& file_name);
333 AString to_string()
const;
336 void add_page_(
bool reserveHeader);
337 void add_page_(
size_t size,
bool reserveHeader);
340 size_t default_page_size_;
356 DEFAULT_PAGE_SIZE = 4096,
Definition: CommBuffer.h:151
Definition: CommBuffer.h:78
Definition: CommBuffer.h:28
Definition: CommBuffer.h:143
unsigned char Byte
Definition: Type.h:64