|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #ifndef POOL_STORAGESVC_DBBLOB_H
7 #define POOL_STORAGESVC_DBBLOB_H 1
17 #if !(defined(WIN32) || defined(_WIN32))
19 #define _swab(source, target, radix) swab(source, target, radix)
122 if (
m_length < len ) new_len += len;
134 #ifdef USE_STREAM_ANALYSER
135 #define STREAM_ANALYSE(data, len) if ( 0 != m_analyzer ) m_analyzer(&data, len, typeid(data))
137 #define STREAM_ANALYSE(data, len)
270 #undef STREAM_ANALYSE
278 #if defined(__alpha) && !defined(__VMS)
280 #elif defined(__sun) && defined(__SVR4) && defined(__i386)
282 #elif defined(__linux) && !defined(__powerpc)
284 #elif defined(BORLAND) || defined(_WIN32) || defined(WIN32)
286 #elif defined(__APPLE__) && defined(__i386__)
288 #elif defined(__APPLE__)
299 const char*
src =
reinterpret_cast<const char*
> (
source);
308 for(
int i = 0,j = siz-1;
i<siz;
i++,j--)
tar[j] =
src[
i];
331 for(
int i = 0,j = siz-1;
i<siz;
i++,j--)
tar[j] =
src[
i];
344 template <
class T>
inline
346 int len = (
int)
v.size();
348 for (
typename std::vector<T>::const_iterator
i =
v.begin();
i !=
v.end(); ++
i ) {
355 template <
class T>
inline
360 for (
i = 0;
i < len;
i++ ) {
369 template <
class T>
inline
371 int len = (
int)
l.size();
373 for (
typename std::list<T>::const_iterator
i =
l.begin();
i !=
l.end(); ++
i ) {
380 template <
class T>
inline
385 for (
i = 0;
i < len;
i++ ) {
394 #endif // POOL_STORAGESVC_DBBLOB_H
DbBlob & operator>>(short &data)
Input Streamer
DbBlob & operator>>(long long int &data)
Input Streamer
Analyzer m_analyzer
Hook function for analysis of data to the stream.
DbBlob & operator<<(double data)
Output Streamer
DbBlob & operator<<(short data)
Output Streamer
int buffPointer() const
Retrieve current buffer pointer.
void setAnalyzer(Analyzer fun=0)
Enable user analysis function.
DbBlob & operator<<(unsigned short data)
Output Streamer
DbBlob(bool do_swap=true)
Standard constructor.
DbBlob & operator<<(const std::string &data)
Streamer to write strings in (std::string) format.
DbBlob & operator<<(const char *data)
Streamer to write strings in (char*) format.
char * m_buffer
Pointer to heap buffer.
void swapFromBuffer(void *target, int siz)
Swap buffers: int, long, short, float and double.
DbBlob & operator>>(long &data)
Input Streamer
bool isWriting() const
Get stream buffer state.
DbBlob & operator>>(double &data)
Input Streamer
void adopt(char *memory, int len)
Adopt an external memory buffer.
void setBuffPointer(int ptr)
Retrieve current buffer pointer.
bool m_swapEnabled
Flag indicating swapping.
DbBlob & operator<<(long long int data)
Output Streamer
virtual ~DbBlob()
Standard destructor.
DbBlob & operator<<(unsigned long data)
Output Streamer
#define STREAM_ANALYSE(data, len)
DbBlob & operator>>(char &data)
Input Streamer
DbBlob & operator<<(int data)
Output Streamer
void extend(int len)
Extend the buffer.
void setMode(Mode m)
Set mode of the stream and allocate buffer.
void reserve(int len)
Reserve buffer space; Default: 16 k buffer size.
DbBlob(const DbBlob &)=delete
DbBlob & operator>>(std::string &data)
Streamer to read strings in (std::string) format.
Mode m_mode
Boolean indicating wether the stream is in read or write mode.
DbBlob & operator<<(char data)
Output Streamer
bool isReading() const
Get stream buffer state.
char * data()
write access to data buffer
SwapAction swapBuffer(int siz) const
Check for byte swapping.
DbBlob & writeBytes(const char *str, int len)
Write string to output stream.
State
Link state defintions.
DbBlob & operator>>(char *data)
Streamer to read strings in (char*) format.
DbBlob & operator=(const DbBlob &)=delete
DbBlob & operator<<(DbBlob &s, const std::vector< T > &v)
DbBlob & operator<<(unsigned int data)
Output Streamer
const char * data() const
Read access to data buffer.
DbBlob & operator>>(float &data)
Input Streamer
DbBlob & operator>>(int &data)
Input Streamer
void(* Analyzer)(const void *data, int siz, const std::type_info &type)
Definition of the buffer analyzer.
DbBlob & operator>>(DbBlob &s, std::vector< T > &v)
DbBlob & operator>>(unsigned long &data)
Input Streamer
SwapAction
Data Sawp actions.
DbBlob & operator<<(float data)
Output Streamer
DbBlob & operator>>(unsigned char &data)
Input Streamer
DbBlob & operator<<(long data)
Output Streamer
DbBlob & operator<<(unsigned char data)
Output Streamer
int size() const
Total buffer size.
int m_length
Total buffer length.
#define _swab(source, target, radix)
void erase()
Reset the buffer.
DbBlob & operator>>(unsigned short &data)
Input Streamer
void swapToBuffer(const void *source, int siz)
Swap buffers: int, long, short, float and double.
DbBlob & operator>>(unsigned int &data)
Input Streamer
int m_pointer
Current buffer pointer.