The Gaudi Framework  v33r2 (a6f0ec87)
StreamBuffer.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_STREAMBUFFER_H
12 #define GAUDIKERNEL_STREAMBUFFER_H 1
13 
14 // STL include files
15 #include <algorithm>
16 #include <cstdlib>
17 #include <cstring>
18 #include <iostream>
19 #include <list>
20 #include <string>
21 #include <typeinfo>
22 #include <vector>
23 
24 #include "GaudiKernel/Kernel.h"
25 #include "GaudiKernel/swab.h"
26 
27 // forward declarations
28 class StreamBuffer;
29 class DataObject;
30 class ContainedObject;
31 
51 class StreamBuffer /* : public std::string */
52 {
53 public:
55  class DataIO {
56  public:
58  DataIO() = default;
60  virtual ~DataIO() = default;
62  void badStreamMode() { throw( "Not acceptable stream mode!" ); }
64  virtual void serialize( StreamBuffer& stream ) {
65  if ( stream.isReading() )
66  load( stream );
67  else if ( stream.isWriting() )
68  dump( stream );
69  else
70  badStreamMode();
71  }
73  virtual void load( StreamBuffer& ) { badStreamMode(); }
75  virtual void dump( StreamBuffer& ) { badStreamMode(); }
76  };
77 
79  class Istream : public DataIO {
82 
83  public:
85  Istream( std::istream& str ) : m_stream( &str ) {}
86 
88  void load( StreamBuffer& stream ) override {
89  // Generic implementation for istreams:
90  int len;
91  ( *m_stream ) >> len;
92  stream.erase();
93  stream.reserve( len );
94  m_stream->read( stream.data(), len );
95  }
96  };
98  class Ostream : public DataIO {
100 
101  public:
103  Ostream( std::ostream& str ) : m_stream( &str ) {}
105  virtual ~Ostream() = default;
106 
108  void dump( StreamBuffer& stream ) override {
109  // Generic implementation for ostreams:
110  ( *m_stream ) << stream.buffPointer();
111  m_stream->write( stream.data(), stream.buffPointer() );
112  }
113  };
114 
115 public:
121  enum State { INVALID = -1, VALID };
124  public:
125  ContainedObject* first = nullptr;
126  long second = INVALID;
127  long third = INVALID;
128  ContainedLink() = default;
129  ContainedLink( ContainedObject* pObj, long hint, long link ) : first( pObj ), second( hint ), third( link ) {}
130  };
133  public:
134  DataObject* first = nullptr;
135  long second = INVALID;
136  IdentifiedLink() = default;
137  IdentifiedLink( const IdentifiedLink& copy ) = default;
138  IdentifiedLink( DataObject* pObj, long hint ) : first( pObj ), second( hint ) {}
139  };
140 
145  typedef void ( *AnalyzeFunction )( const void* data, int siz, const std::type_info& type );
147  friend class DataObject;
148 
149 protected:
152 
154  mutable long m_pointer = 0;
155 
157  mutable long m_length = 0;
158 
160  mutable char* m_buffer = nullptr;
161 
163  bool m_swapEnabled = true;
164 
167 
170 
173 
175  SwapAction swapBuffer( int siz ) const;
176 
180  template <class TYPE>
181  StreamBuffer& getObjectPointer( const DataObject* /*pObject*/, TYPE*& refpObject ) {
183  DataObject* pObj = link.first;
185  refpObject = dynamic_cast<TYPE*>( pObj );
186  return *this;
187  }
191  template <class TYPE>
192  StreamBuffer& getObjectPointer( const ContainedObject* /*pObject*/, TYPE*& refpObject ) {
194  ContainedObject* pObj = link.first;
196  refpObject = dynamic_cast<TYPE*>( pObj );
197  return *this;
198  }
199 
200 public:
202  StreamBuffer( bool do_swap = true ) : m_swapEnabled( do_swap ) {}
204  virtual ~StreamBuffer() { ::free( m_buffer ); }
206  const char* data() const { return m_buffer; }
208  char* data() { return m_buffer; }
210  void erase() { m_pointer = 0; }
212  char* adopt() const {
213  char* ptr = m_buffer;
216  m_buffer = NULL; // char *
217  m_pointer = 0; // long
218  m_length = 0; // long
219  return ptr;
220  }
222  void reserve( long len ) {
223  if ( len > m_length ) {
224  m_length = ( len < 16384 ) ? 16384 : len;
225  m_buffer = (char*)::realloc( m_buffer, m_length );
226  }
227  }
229  void extend( long len ) {
230  if ( len + m_pointer > m_length ) {
231  // We have to be a bit generous here in order not to run too often
232  // into ::realloc().
233  long new_len = ( m_length < 16384 ) ? 16384 : 2 * m_length;
234  if ( m_length < len ) new_len += len;
235  reserve( new_len );
236  }
237  }
239  long size() const { return m_length; }
243  const ContainedLinks& containedLinks() const { return m_containedLinks; }
244 
249 
251  void setMode( Mode m ) {
252  m_mode = m;
253  m_pointer = 0;
256  }
257 
259  bool isReading() const { return m_mode == READING; }
260 
262  bool isWriting() const { return m_mode == WRITING; }
264  long buffPointer() const { return m_pointer; }
266  void setBuffPointer( long ptr ) { m_pointer = ptr; }
268  void setAnalyzer( AnalyzeFunction fun = nullptr ) { m_analyzer = fun; }
270  void swapToBuffer( const void* source, int siz );
271 
273  void swapFromBuffer( void* target, int siz );
274 
276  StreamBuffer& writeBytes( const char* str, long len ) {
277  extend( m_pointer + len + 4 );
278  *this << len;
279  std::copy_n( str, len, data() + buffPointer() );
280  m_pointer += len;
281  return *this;
282  }
283 
284  void getIdentifiedLink( DataObject*& pObject, long& hint ) {
286  pObject = l.first;
287  hint = l.second;
289  }
290  void addIdentifiedLink( const DataObject* pObject, long hint ) {
292  }
293 
294  void getContainedLink( ContainedObject*& pObject, long& hint, long& link ) {
296  pObject = l.first;
297  hint = l.second;
298  link = l.third;
300  }
301  void addContainedLink( const ContainedObject* pObject, long hint, long link ) {
302  m_containedLinks.push_back( ContainedLink( (ContainedObject*)pObject, hint, link ) );
303  }
304 
305 #ifdef USE_STREAM_ANALYSER
306 # define STREAM_ANALYSE( data, len ) \
307  if ( 0 != m_analyzer ) m_analyzer( &data, len, typeid( data ) )
308 #else
309 # define STREAM_ANALYSE( data, len )
310 #endif
311 
312 // Implement streamer macros for primivive data types.
313 #define IMPLEMENT_STREAMER( TYPE ) \
314  /* Output Streamer */ \
315  StreamBuffer& operator<<( TYPE data ) { \
316  swapToBuffer( &data, sizeof( data ) ); \
317  STREAM_ANALYSE( data, sizeof( data ) ); \
318  return *this; \
319  } \
320  /* Input Streamer */ \
321  StreamBuffer& operator>>( TYPE& data ) { \
322  swapFromBuffer( &data, sizeof( data ) ); \
323  return *this; \
324  }
325 // RootCint does not understand this macro....
326 // But we can easily live without it!
327 #undef IMPLEMENT_STREAMER
328 
330  StreamBuffer& operator<<( long long data ) {
331  swapToBuffer( &data, sizeof( data ) );
332  STREAM_ANALYSE( data, sizeof( data ) );
333  return *this;
334  }
336  StreamBuffer& operator>>( long long& data ) {
337  swapFromBuffer( &data, sizeof( data ) );
338  return *this;
339  }
342  swapToBuffer( &data, sizeof( data ) );
343  STREAM_ANALYSE( data, sizeof( data ) );
344  return *this;
345  }
348  swapFromBuffer( &data, sizeof( data ) );
349  return *this;
350  }
352  StreamBuffer& operator<<( unsigned int data ) {
353  swapToBuffer( &data, sizeof( data ) );
354  STREAM_ANALYSE( data, sizeof( data ) );
355  return *this;
356  }
358  StreamBuffer& operator>>( unsigned int& data ) {
359  swapFromBuffer( &data, sizeof( data ) );
360  return *this;
361  }
364  swapToBuffer( &data, sizeof( data ) );
365  STREAM_ANALYSE( data, sizeof( data ) );
366  return *this;
367  }
370  swapFromBuffer( &data, sizeof( data ) );
371  return *this;
372  }
374  StreamBuffer& operator<<( unsigned long data ) {
375  swapToBuffer( &data, sizeof( data ) );
376  STREAM_ANALYSE( data, sizeof( data ) );
377  return *this;
378  }
380  StreamBuffer& operator>>( unsigned long& data ) {
381  swapFromBuffer( &data, sizeof( data ) );
382  return *this;
383  }
386  swapToBuffer( &data, sizeof( data ) );
387  STREAM_ANALYSE( data, sizeof( data ) );
388  return *this;
389  }
392  swapFromBuffer( &data, sizeof( data ) );
393  return *this;
394  }
396  StreamBuffer& operator<<( unsigned short data ) {
397  swapToBuffer( &data, sizeof( data ) );
398  STREAM_ANALYSE( data, sizeof( data ) );
399  return *this;
400  }
402  StreamBuffer& operator>>( unsigned short& data ) {
403  swapFromBuffer( &data, sizeof( data ) );
404  return *this;
405  }
408  swapToBuffer( &data, sizeof( data ) );
409  STREAM_ANALYSE( data, sizeof( data ) );
410  return *this;
411  }
414  swapFromBuffer( &data, sizeof( data ) );
415  return *this;
416  }
418  StreamBuffer& operator<<( unsigned char data ) {
419  swapToBuffer( &data, sizeof( data ) );
420  STREAM_ANALYSE( data, sizeof( data ) );
421  return *this;
422  }
424  StreamBuffer& operator>>( unsigned char& data ) {
425  swapFromBuffer( &data, sizeof( data ) );
426  return *this;
427  }
430  swapToBuffer( &data, sizeof( data ) );
431  STREAM_ANALYSE( data, sizeof( data ) );
432  return *this;
433  }
436  swapFromBuffer( &data, sizeof( data ) );
437  return *this;
438  }
441  swapToBuffer( &data, sizeof( data ) );
442  STREAM_ANALYSE( data, sizeof( data ) );
443  return *this;
444  }
447  swapFromBuffer( &data, sizeof( data ) );
448  return *this;
449  }
452  long i, len;
453  *this >> len;
454  for ( i = 0, data[0] = 0; i < len; i++ ) { data[i] = m_buffer[m_pointer++]; }
455  return *this;
456  }
458  StreamBuffer& operator<<( const char* data ) {
459  const char* ptr = 0 == data ? "" : data;
460  int len = strlen( ptr ) + 1;
461  if ( 0 == m_analyzer )
462  writeBytes( ptr, len );
463  else {
464  STREAM_ANALYSE( data, len );
465  }
466  return *this;
467  }
470  long i, len;
471  *this >> len;
472  for ( i = 0, data = ""; i < len; i++ ) { data.append( 1, m_buffer[m_pointer++] ); }
473  return *this;
474  }
477  if ( 0 == m_analyzer ) {
478  const char* ptr = data.c_str();
479  long len = data.length();
480  writeBytes( ptr, len );
481  } else {
482  STREAM_ANALYSE( data, sizeof( data ) );
483  }
484  return *this;
485  }
492  template <class TYPE>
493  StreamBuffer& operator>>( TYPE*& refpObject ) {
494  return getObjectPointer( refpObject, refpObject );
495  }
496 
504  STREAM_ANALYSE( pObject, sizeof( pObject ) );
505  addContainedLink( pObject, INVALID, INVALID );
506  return *this;
507  }
508 
515  StreamBuffer& operator<<( const DataObject* pObject ) {
516  STREAM_ANALYSE( pObject, sizeof( pObject ) );
517  addIdentifiedLink( pObject, INVALID );
518  return *this;
519  }
520 
527  void serialize( DataIO& ioObject ) {
528  ioObject.serialize( *this );
529  m_pointer = 0;
530  }
531 };
532 
533 #undef STREAM_ANALYSE
534 
537  switch ( siz ) {
538  case 1:
539  return SINGLE_BYTE;
540  default:
541 #if defined( __alpha ) && !defined( __VMS )
542  // return m_swapEnabled ? SWAP : NOSWAP;
543  return NOSWAP;
544 #elif defined( __sun ) && defined( __SVR4 ) && defined( __i386 )
545  // return m_swapEnabled ? SWAP : NOSWAP;
546  return NOSWAP;
547 #elif defined( __APPLE__ )
548  // return m_swapEnabled ? SWAP : NOSWAP;
549  return SWAP;
550 #elif defined( __linux ) && !defined( __powerpc )
551  // return m_swapEnabled ? SWAP : NOSWAP;
552  return NOSWAP;
553 #elif defined( BORLAND ) || defined( _WIN32 ) || defined( WIN32 )
554  // return m_swapEnabled ? SWAP : NOSWAP;
555  return NOSWAP;
556 #else
557  return m_swapEnabled ? SWAP : NOSWAP;
558 // return NOSWAP;
559 #endif
560  }
561 }
562 
564 inline void StreamBuffer::swapToBuffer( const void* source, int siz ) {
565  char buff[8], *tar, *src = (char*)source;
566  extend( m_pointer + siz );
567  tar = m_buffer + m_pointer;
568  switch ( swapBuffer( siz ) ) {
569  case SINGLE_BYTE:
570  *tar = *src;
571  break;
572  case SWAP:
573 #ifdef __APPLE__
574  for ( int i = 0, j = siz - 1; i < siz; i++, j-- ) tar[j] = src[i];
575 #else
576  ::_swab( src, buff, siz );
577 #endif
578  src = buff;
579  [[fallthrough]];
580  case NOSWAP:
581  std::copy_n( src, siz, tar );
582  break;
583  default:
584  break;
585  }
586  m_pointer += siz;
587 }
588 
590 inline void StreamBuffer::swapFromBuffer( void* target, int siz ) {
591  char* tar = (char*)target;
592  char* src = m_buffer + m_pointer;
593  switch ( swapBuffer( siz ) ) {
594  case SINGLE_BYTE:
595  *tar = *src;
596  break;
597  case SWAP:
598 #ifdef __APPLE__
599  for ( int i = 0, j = siz - 1; i < siz; i++, j-- ) tar[j] = src[i];
600 #else
601  ::_swab( src, tar, siz );
602 #endif
603  break;
604  case NOSWAP:
605  std::copy_n( src, siz, tar );
606  break;
607  default:
608  break;
609  }
610  m_pointer += siz;
611 }
612 
613 // Output serialize a vector of items
614 template <class T>
616  s << v.size();
617  for ( const auto& i : v ) s << i;
618  return s;
619 }
620 
621 // Input serialize a vector of items
622 template <class T>
624  long i, len;
625  s >> len;
626  v.clear();
627  for ( i = 0; i < len; i++ ) {
628  T temp;
629  s >> temp;
630  v.push_back( temp );
631  }
632  return s;
633 }
634 
635 // Output serialize a list of items
636 template <class T>
638  s << l.size();
639  for ( const auto& i : l ) s << i;
640  return s;
641 }
642 
643 // Input serialize a list of items
644 template <class T>
646  long len;
647  s >> len;
648  l.clear();
649  for ( long i = 0; i < len; i++ ) {
650  T temp;
651  s >> temp;
652  l.push_back( temp );
653  }
654  return s;
655 }
656 #endif // GAUDIKERNEL_STREAMBUFFER_H
virtual void load(StreamBuffer &)
Template function to load stream data.
Definition: StreamBuffer.h:73
StreamBuffer & operator>>(long long &data)
Input Streamer.
Definition: StreamBuffer.h:336
bool isWriting() const
Get stream buffer state.
Definition: StreamBuffer.h:262
const IdentifiedLinks & identifiedLinks() const
CONST Access to identified links.
Definition: StreamBuffer.h:248
Writer for standard output streams.
Definition: StreamBuffer.h:98
StreamBuffer(bool do_swap=true)
Standard constructor.
Definition: StreamBuffer.h:202
std::ostream * m_stream
Definition: StreamBuffer.h:99
Mode
Streamer mode.
Definition: StreamBuffer.h:117
virtual void serialize(StreamBuffer &stream)
Serialization method: loads/dumps streambuffer content.
Definition: StreamBuffer.h:64
StreamBuffer & operator<<(const char *data)
Streamer to write strings in (char*) format.
Definition: StreamBuffer.h:458
StreamBuffer & operator<<(StreamBuffer &s, const std::vector< T > &v)
Definition: StreamBuffer.h:615
StreamBuffer & operator>>(long &data)
Input Streamer.
Definition: StreamBuffer.h:369
StreamBuffer & operator>>(unsigned short &data)
Input Streamer.
Definition: StreamBuffer.h:402
Ostream(std::ostream &str)
Standard constructor: pass reference to stream object.
Definition: StreamBuffer.h:103
StreamBuffer & operator<<(double data)
Output Streamer.
Definition: StreamBuffer.h:440
std::istream * m_stream
Reference to input stream.
Definition: StreamBuffer.h:81
DataIO()=default
Standard constructor.
StreamBuffer & operator<<(float data)
Output Streamer.
Definition: StreamBuffer.h:429
StreamBuffer & operator<<(const DataObject *pObject)
Streamer to write links to identified objects.
Definition: StreamBuffer.h:515
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:51
StreamBuffer & operator>>(float &data)
Input Streamer.
Definition: StreamBuffer.h:435
SwapAction
Data Sawp actions.
Definition: StreamBuffer.h:119
ContainedLinks m_containedLinks
Container with links to contained objects.
Definition: StreamBuffer.h:166
Istream(std::istream &str)
Constructor.
Definition: StreamBuffer.h:85
AnalyzeFunction m_analyzer
Hook function for analysis of data to the stream.
Definition: StreamBuffer.h:172
virtual void dump(StreamBuffer &)
Template function to save stream data.
Definition: StreamBuffer.h:75
long m_length
Total buffer length.
Definition: StreamBuffer.h:157
SwapAction swapBuffer(int siz) const
Check for byte swapping.
Definition: StreamBuffer.h:536
IdentifiedLinks & identifiedLinks()
Access to identified links.
Definition: StreamBuffer.h:246
virtual ~Ostream()=default
Standard Destructor.
char * m_buffer
Pointer to heap buffer.
Definition: StreamBuffer.h:160
void extend(long len)
Extend the buffer.
Definition: StreamBuffer.h:229
StreamBuffer & operator<<(const ContainedObject *pObject)
Streamer to write links to contained objects.
Definition: StreamBuffer.h:503
StreamBuffer & operator>>(char *data)
Streamer to read strings in (char*) format.
Definition: StreamBuffer.h:451
void swapToBuffer(const void *source, int siz)
Swap buffers: int, long, short, float and double.
Definition: StreamBuffer.h:564
T end(T... args)
std::vector< ContainedLink > ContainedLinks
Definition: StreamBuffer.h:141
StreamBuffer & operator<<(unsigned long data)
Output Streamer.
Definition: StreamBuffer.h:374
T copy_n(T... args)
StreamBuffer & operator<<(unsigned short data)
Output Streamer.
Definition: StreamBuffer.h:396
Reader for standard input streams.
Definition: StreamBuffer.h:79
STL class.
void setAnalyzer(AnalyzeFunction fun=nullptr)
Enable user analysis function.
Definition: StreamBuffer.h:268
char * data()
write access to data buffer
Definition: StreamBuffer.h:208
void setBuffPointer(long ptr)
Retrieve current buffer pointer.
Definition: StreamBuffer.h:266
StreamBuffer & operator>>(unsigned char &data)
Input Streamer.
Definition: StreamBuffer.h:424
STL class.
StreamBuffer & operator<<(int data)
Output Streamer.
Definition: StreamBuffer.h:341
void(* AnalyzeFunction)(const void *data, int siz, const std::type_info &type)
Definition of the buffer analyzer.
Definition: StreamBuffer.h:145
T push_back(T... args)
void reserve(long len)
Reserve buffer space; Default: 16 k buffer size.
Definition: StreamBuffer.h:222
StreamBuffer & operator>>(StreamBuffer &s, std::vector< T > &v)
Definition: StreamBuffer.h:623
Mode m_mode
Boolean indicating wether the stream is in read or write mode.
Definition: StreamBuffer.h:151
#define STREAM_ANALYSE(data, len)
Definition: StreamBuffer.h:309
ContainedLinks & containedLinks()
Access to contained links.
Definition: StreamBuffer.h:241
StreamBuffer & operator<<(long data)
Output Streamer.
Definition: StreamBuffer.h:363
constexpr double m
StreamBuffer & operator<<(unsigned char data)
Output Streamer.
Definition: StreamBuffer.h:418
long size() const
Total buffer size.
Definition: StreamBuffer.h:239
T erase(T... args)
T pop_back(T... args)
StreamBuffer & operator<<(short data)
Output Streamer.
Definition: StreamBuffer.h:385
StreamBuffer & getObjectPointer(const ContainedObject *, TYPE *&refpObject)
Helper to distinguish between identified pointers and contained pointers.
Definition: StreamBuffer.h:192
StreamBuffer & operator<<(const std::string &data)
Streamer to write strings in (std::string) format.
Definition: StreamBuffer.h:476
void badStreamMode()
Throw Exception.
Definition: StreamBuffer.h:62
T clear(T... args)
void load(StreamBuffer &stream) override
Data load method.
Definition: StreamBuffer.h:88
STL class.
StreamBuffer & operator>>(char &data)
Input Streamer.
Definition: StreamBuffer.h:413
StreamBuffer & operator>>(unsigned long &data)
Input Streamer.
Definition: StreamBuffer.h:380
#define _swab(source, target, radix)
Definition: swab.h:17
void addIdentifiedLink(const DataObject *pObject, long hint)
Definition: StreamBuffer.h:290
dictionary l
Definition: gaudirun.py:543
const char * data() const
Read access to data buffer.
Definition: StreamBuffer.h:206
bool isReading() const
Get stream buffer state.
Definition: StreamBuffer.h:259
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
virtual ~DataIO()=default
Standard destructor.
T size(T... args)
void dump(StreamBuffer &stream) override
Output dumper.
Definition: StreamBuffer.h:108
long m_pointer
Current buffer pointer.
Definition: StreamBuffer.h:154
T begin(T... args)
T write(T... args)
const ContainedLinks & containedLinks() const
CONST Access to contained links.
Definition: StreamBuffer.h:243
A small base class to handle generic data streaming.
Definition: StreamBuffer.h:55
T back(T... args)
string s
Definition: gaudirun.py:328
State
Link state defintions.
Definition: StreamBuffer.h:121
T read(T... args)
StreamBuffer & writeBytes(const char *str, long len)
Write string to output stream.
Definition: StreamBuffer.h:276
virtual ~StreamBuffer()
Standard destructor.
Definition: StreamBuffer.h:204
long buffPointer() const
Retrieve current buffer pointer.
Definition: StreamBuffer.h:264
void erase()
Reset the buffer.
Definition: StreamBuffer.h:210
StreamBuffer & operator<<(unsigned int data)
Output Streamer.
Definition: StreamBuffer.h:352
StreamBuffer & operator>>(std::string &data)
Streamer to read strings in (std::string) format.
Definition: StreamBuffer.h:469
char * adopt() const
Remove the data buffer and pass it to client. It's the client responsability to free the memory.
Definition: StreamBuffer.h:212
StreamBuffer & operator<<(char data)
Output Streamer.
Definition: StreamBuffer.h:407
void setMode(Mode m)
Set mode of the stream and allocate buffer.
Definition: StreamBuffer.h:251
StreamBuffer & getObjectPointer(const DataObject *, TYPE *&refpObject)
Helper to distinguish between identified pointers and contained pointers.
Definition: StreamBuffer.h:181
StreamBuffer & operator>>(unsigned int &data)
Input Streamer.
Definition: StreamBuffer.h:358
IdentifiedLinks m_identifiedLinks
Container with links to contained objects.
Definition: StreamBuffer.h:169
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:40
STL class.
StreamBuffer & operator>>(double &data)
Input Streamer.
Definition: StreamBuffer.h:446
void addContainedLink(const ContainedObject *pObject, long hint, long link)
Definition: StreamBuffer.h:301
void getContainedLink(ContainedObject *&pObject, long &hint, long &link)
Definition: StreamBuffer.h:294
StreamBuffer & operator>>(int &data)
Input Streamer.
Definition: StreamBuffer.h:347
std::vector< IdentifiedLink > IdentifiedLinks
Definition of the identifiable link set.
Definition: StreamBuffer.h:143
void serialize(DataIO &ioObject)
Serialize the buffer using an IO object.
Definition: StreamBuffer.h:527
bool m_swapEnabled
Flag indicating swapping.
Definition: StreamBuffer.h:163
StreamBuffer & operator>>(short &data)
Input Streamer.
Definition: StreamBuffer.h:391
void getIdentifiedLink(DataObject *&pObject, long &hint)
Definition: StreamBuffer.h:284
StreamBuffer & operator<<(long long data)
Output Streamer.
Definition: StreamBuffer.h:330
StreamBuffer & operator>>(TYPE *&refpObject)
Streamer to read links to contained or identified objects.
Definition: StreamBuffer.h:493
void swapFromBuffer(void *target, int siz)
Swap buffers: int, long, short, float and double.
Definition: StreamBuffer.h:590