![]() |
ATLAS Offline Software
|
#include <pool/DbBlob.h>
Public Types | |
enum | Mode { UNINITIALIZED, READING, WRITING } |
Streamer mode. More... | |
enum | SwapAction { SINGLE_BYTE, SWAP, NOSWAP } |
Data Sawp actions. More... | |
enum | State { INVALID =-1, VALID } |
Link state defintions. More... | |
typedef void(* | Analyzer) (const void *data, int siz, const std::type_info &type) |
Definition of the buffer analyzer. More... | |
Public Member Functions | |
DbBlob (bool do_swap=true) | |
Standard constructor. More... | |
virtual | ~DbBlob () |
Standard destructor. More... | |
DbBlob (const DbBlob &)=delete | |
DbBlob & | operator= (const DbBlob &)=delete |
const char * | data () const |
Read access to data buffer. More... | |
char * | data () |
write access to data buffer More... | |
void | erase () |
Reset the buffer. More... | |
int | size () const |
Total buffer size. More... | |
bool | isReading () const |
Get stream buffer state. More... | |
bool | isWriting () const |
Get stream buffer state. More... | |
int | buffPointer () const |
Retrieve current buffer pointer. More... | |
void | setBuffPointer (int ptr) |
Retrieve current buffer pointer. More... | |
void | setAnalyzer (Analyzer fun=0) |
Enable user analysis function. More... | |
void | swapToBuffer (const void *source, int siz) |
Swap buffers: int, long, short, float and double. More... | |
void | swapFromBuffer (void *target, int siz) |
Swap buffers: int, long, short, float and double. More... | |
void | adopt (char *memory, int len) |
Adopt an external memory buffer. More... | |
void | reserve (int len) |
Reserve buffer space; Default: 16 k buffer size. More... | |
void | extend (int len) |
Extend the buffer. More... | |
void | setMode (Mode m) |
Set mode of the stream and allocate buffer. More... | |
DbBlob & | writeBytes (const char *str, int len) |
Write string to output stream. More... | |
DbBlob & | operator<< (long long int data) |
Output Streamer More... | |
DbBlob & | operator>> (long long int &data) |
Input Streamer More... | |
DbBlob & | operator<< (int data) |
Output Streamer More... | |
DbBlob & | operator>> (int &data) |
Input Streamer More... | |
DbBlob & | operator<< (unsigned int data) |
Output Streamer More... | |
DbBlob & | operator>> (unsigned int &data) |
Input Streamer More... | |
DbBlob & | operator<< (long data) |
Output Streamer More... | |
DbBlob & | operator>> (long &data) |
Input Streamer More... | |
DbBlob & | operator<< (unsigned long data) |
Output Streamer More... | |
DbBlob & | operator>> (unsigned long &data) |
Input Streamer More... | |
DbBlob & | operator<< (short data) |
Output Streamer More... | |
DbBlob & | operator>> (short &data) |
Input Streamer More... | |
DbBlob & | operator<< (unsigned short data) |
Output Streamer More... | |
DbBlob & | operator>> (unsigned short &data) |
Input Streamer More... | |
DbBlob & | operator<< (char data) |
Output Streamer More... | |
DbBlob & | operator>> (char &data) |
Input Streamer More... | |
DbBlob & | operator<< (unsigned char data) |
Output Streamer More... | |
DbBlob & | operator>> (unsigned char &data) |
Input Streamer More... | |
DbBlob & | operator<< (float data) |
Output Streamer More... | |
DbBlob & | operator>> (float &data) |
Input Streamer More... | |
DbBlob & | operator<< (double data) |
Output Streamer More... | |
DbBlob & | operator>> (double &data) |
Input Streamer More... | |
DbBlob & | operator>> (char *data) |
Streamer to read strings in (char*) format. More... | |
DbBlob & | operator<< (const char *data) |
Streamer to write strings in (char*) format. More... | |
DbBlob & | operator>> (std::string &data) |
Streamer to read strings in (std::string) format. More... | |
DbBlob & | operator<< (const std::string &data) |
Streamer to write strings in (std::string) format. More... | |
Protected Member Functions | |
SwapAction | swapBuffer (int siz) const |
Check for byte swapping. More... | |
Protected Attributes | |
Mode | m_mode |
Boolean indicating wether the stream is in read or write mode. More... | |
int | m_pointer |
Current buffer pointer. More... | |
int | m_length |
Total buffer length. More... | |
char * | m_buffer |
Pointer to heap buffer. More... | |
bool | m_swapEnabled |
Flag indicating swapping. More... | |
Analyzer | m_analyzer |
Hook function for analysis of data to the stream. More... | |
Description:
The stream buffer is a small object collecting object data. The basic idea behind the DbBlob is generic object conversion. The DbBlob acts as a byte stream (hence inheriting from a std::string) and stores any information streamed to the buffer. Since the information must be represented in a generic way on the fly byte swapping is performed. However, not only primitive data can be stored in the buffer, but also pointers to DataObjects (symbolic links) and pointers to contained objects. Automatically during serialization the persistent references to the corresponding objects and containers must be stored. These objects are accessible from the DbBlob object.
enum pool::DbBlob::Mode |
enum pool::DbBlob::State |
|
inline |
|
virtual |
Standard destructor.
void pool::DbBlob::adopt | ( | char * | memory, |
int | len | ||
) |
Adopt an external memory buffer.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Extend the buffer.
|
inline |
|
inline |
|
inline |
Streamer to write strings in (std::string) format.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Input Streamer
DbBlob& pool::DbBlob::operator>> | ( | char * | data | ) |
Streamer to read strings in (char*) format.
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
DbBlob& pool::DbBlob::operator>> | ( | std::string & | data | ) |
Streamer to read strings in (std::string) format.
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
|
inline |
Input Streamer
void pool::DbBlob::reserve | ( | int | len | ) |
Reserve buffer space; Default: 16 k buffer size.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |