CMS 3D CMS Logo

cond::TBufferBlobWriter Class Reference

#include <IOPool/CMSSealPlugins/plugins/TBufferBlobStreamer.h>

List of all members.

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.


Detailed Description

Definition at line 26 of file TBufferBlobStreamer.h.


Constructor & Destructor Documentation

cond::TBufferBlobWriter::TBufferBlobWriter ( const ROOT::Reflex::Type &  type  )  [explicit]

Constructor.

Definition at line 103 of file TBufferBlobStreamer.cc.

00104                                                                   :
00105   m_type(type),
00106   m_blob()
00107 {
}

cond::TBufferBlobWriter::~TBufferBlobWriter (  )  [virtual]

Empty destructor.

Definition at line 109 of file TBufferBlobStreamer.cc.

00111 {


Member Function Documentation

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;


Member Data Documentation

coral::Blob cond::TBufferBlobWriter::m_blob [private]

The blob data.

Definition at line 43 of file TBufferBlobStreamer.h.

Referenced by write().

TBufferBlobTypeInfo cond::TBufferBlobWriter::m_type [private]

The type information as seen by the blob streamer.

Definition at line 40 of file TBufferBlobStreamer.h.

Referenced by write().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:50 2009 for CMSSW by  doxygen 1.5.4