#include <IOPool/CMSSealPlugins/plugins/TBufferBlobStreamer.h>
Public Member Functions | |
TBufferBlobWriter (const ROOT::Reflex::Type &type) | |
Constructor. | |
const coral::Blob & | write (const void *addressOfInputData) |
Streams an object an returns by constant reference the underlying blob. | |
virtual | ~TBufferBlobWriter () |
Empty destructor. | |
Private Attributes | |
coral::Blob | m_blob |
The blob data. | |
TBufferBlobTypeInfo | m_type |
The type information as seen by the blob streamer. |
Definition at line 26 of file TBufferBlobStreamer.h.
cond::TBufferBlobWriter::TBufferBlobWriter | ( | const ROOT::Reflex::Type & | type | ) | [explicit] |
cond::TBufferBlobWriter::~TBufferBlobWriter | ( | ) | [virtual] |
const coral::Blob & cond::TBufferBlobWriter::write | ( | const void * | addressOfInputData | ) |
Streams an object an returns by constant reference the underlying blob.
Definition at line 113 of file TBufferBlobStreamer.cc.
References cond::TBufferBlobTypeInfo::m_arraySize, m_blob, cond::TBufferBlobTypeInfo::m_class, cond::TBufferBlobTypeInfo::m_primitive, m_type, primitives, size, and Primitive::writeArrayFn.
00115 { 00116 //std::cout<<"TBufferBlobWriter::write"<<std::endl; 00117 if (m_type.m_class && m_type.m_class->GetActualClass(addr) != m_type.m_class) 00118 throw cond::Exception("TBufferBlobWriter::write object to stream is " 00119 "not of actual class."); 00120 00121 CONDRootBuffer buffer(CONDRootBuffer::kWrite); 00122 buffer.InitMap(); 00123 00124 if (m_type.m_arraySize && !m_type.m_class) 00125 (buffer.*primitives[m_type.m_primitive].writeArrayFn)(addr, m_type.m_arraySize); 00126 else if (m_type.m_arraySize) 00127 buffer.WriteFastArray(const_cast<void*>(addr), m_type.m_class, m_type.m_arraySize); 00128 else 00129 buffer.StreamObject(const_cast<void*>(addr), m_type.m_class); 00130 00131 Int_t size = buffer.Length(); 00132 00133 m_blob.resize(size); 00134 void *startingAddress = m_blob.startingAddress(); 00135 00136 std::memcpy(startingAddress, buffer.Buffer(), size); 00137 00138 return m_blob;
coral::Blob cond::TBufferBlobWriter::m_blob [private] |
The type information as seen by the blob streamer.
Definition at line 40 of file TBufferBlobStreamer.h.
Referenced by write().