CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::RefCoreStreamer Class Reference

#include <RefCoreStreamer.h>

Inheritance diagram for edm::RefCoreStreamer:

Public Member Functions

TClassStreamer * Generate () const override
 
void operator() (TBuffer &R__b, void *objp) override
 
 RefCoreStreamer ()
 

Private Attributes

TClassRef cl_
 

Detailed Description

Definition at line 11 of file RefCoreStreamer.h.

Constructor & Destructor Documentation

edm::RefCoreStreamer::RefCoreStreamer ( )
inlineexplicit

Definition at line 13 of file RefCoreStreamer.h.

References Generate(), and operator()().

Referenced by Generate(), and edm::setRefCoreStreamerInTClass().

13 : cl_("edm::RefCore"){}

Member Function Documentation

TClassStreamer * edm::RefCoreStreamer::Generate ( ) const
override

Definition at line 67 of file RefCoreStreamer.cc.

References RefCoreStreamer().

Referenced by RefCoreStreamer(), and edm::RefCoreWithIndexStreamer::RefCoreWithIndexStreamer().

67  {
68  return new RefCoreStreamer(*this);
69  }
void edm::RefCoreStreamer::operator() ( TBuffer &  R__b,
void *  objp 
)
override

Definition at line 20 of file RefCoreStreamer.cc.

References cl_, Exception, edm::RefCore::id(), edm::errors::InvalidReference, edm::RefCore::isTransient(), haddnano::obj, and edm::ProductID::processIndex().

Referenced by RefCoreStreamer(), and edm::RefCoreWithIndexStreamer::RefCoreWithIndexStreamer().

20  {
21  if (R__b.IsReading()) {
22  cl_->ReadBuffer(R__b, objp);
23  } else {
24  //If transient, throw
25  RefCore* obj = static_cast<RefCore*>(objp);
26  if (obj->isTransient()) {
27  throw Exception(errors::InvalidReference,"Inconsistency")
28  << "RefCoreStreamer: transient Ref or Ptr cannot be made persistent.";
29  }
30 #if 1
31  R__b << cl_->GetClassVersion();
32 #else
33  R__b.WriteVersion(cl_, kFALSE);
34 #endif
35  //Must match the order the data appears in the class declaration
36  const ProductID& id = obj->id();
37  R__b << id.processIndex();
38  R__b << id.productIndex();
39  }
40  }

Member Data Documentation

TClassRef edm::RefCoreStreamer::cl_
private

Definition at line 20 of file RefCoreStreamer.h.

Referenced by operator()(), and edm::RefCoreWithIndexStreamer::operator()().