CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
cond::TBufferBlobTypeInfo Class Reference

#include <TBufferBlobStreamingService.h>

Public Member Functions

 TBufferBlobTypeInfo (const Reflex::Type &type)
 

Public Attributes

std::size_t m_arraySize
 length of the plain C array (zero otherwise) More...
 
TClass * m_class
 The class as seen by the ROOT streaming services. More...
 
unsigned int m_primitive
 the primitive C++ type if m_class is unset More...
 

Detailed Description

Definition at line 13 of file TBufferBlobStreamingService.h.

Constructor & Destructor Documentation

cond::TBufferBlobTypeInfo::TBufferBlobTypeInfo ( const Reflex::Type &  type)

Definition at line 53 of file TBufferBlobStreamingService.cc.

References edm::hlt::Exception, spr::find(), m_arraySize, m_class, m_primitive, nPrimitives, and primitives.

54  : m_arraySize(0), m_class(0), m_primitive(0)
55 {
56  static bool cintexInitialized = false;
57  if (!cintexInitialized) {
58  cintexInitialized = true;
59  ROOT::Cintex::Cintex::Enable();
60  }
61 
62  Reflex::Type type = type_;
63  while(true) {
64  type = type.FinalType();
65 
66  if (!type.IsArray())
67  break;
68 
69  if (!m_arraySize)
70  m_arraySize = 1;
71  m_arraySize *= type.ArrayLength();
72  type = type.ToType();
73  }
74 
75  if (type.IsClass()) {
76  const std::type_info &typeInfo = type.TypeInfo();
77  m_class = TClass::GetClass(typeInfo);
78  if (!m_class)
79  throw cond::Exception("TBufferBlobTypeInfo::TBufferBlobTypeInfo "
80  "No ROOT class registered for " + type.Name());
81  } else if (type.IsFundamental()) {
82  if (!m_arraySize)
83  throw cond::Exception("TBufferBlobTypeInfo::TBufferBlobTypeInfo "
84  "Only arrays of primitive types supported. "
85  "Please to not use a Blob for this member.");
86 
88  type.TypeInfo()) - primitives;
89  if (m_primitive >= nPrimitives)
90  throw cond::Exception("TBufferBlobTypeInfo::TBufferBlobTypeInfo "
91  "Cannot handle primitive type " + type.Name());
92  } else
93  throw cond::Exception("TBufferBlobTypeInfo::TBufferBlobTypeInfo "
94  "Cannot handle C++ type " + type.Name());
95 }
type
Definition: HCALResponse.h:22
std::size_t m_arraySize
length of the plain C array (zero otherwise)
TClass * m_class
The class as seen by the ROOT streaming services.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
unsigned int m_primitive
the primitive C++ type if m_class is unset
static const std::size_t nPrimitives
struct Primitive primitives[]

Member Data Documentation

std::size_t cond::TBufferBlobTypeInfo::m_arraySize

length of the plain C array (zero otherwise)

Definition at line 18 of file TBufferBlobStreamingService.h.

Referenced by cond::TBufferBlobStreamingService::read(), TBufferBlobTypeInfo(), and cond::TBufferBlobStreamingService::write().

TClass* cond::TBufferBlobTypeInfo::m_class

The class as seen by the ROOT streaming services.

Definition at line 21 of file TBufferBlobStreamingService.h.

Referenced by cond::TBufferBlobStreamingService::read(), TBufferBlobTypeInfo(), and cond::TBufferBlobStreamingService::write().

unsigned int cond::TBufferBlobTypeInfo::m_primitive

the primitive C++ type if m_class is unset

Definition at line 24 of file TBufferBlobStreamingService.h.

Referenced by cond::TBufferBlobStreamingService::read(), TBufferBlobTypeInfo(), and cond::TBufferBlobStreamingService::write().