ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
SG::PackedContainerStreamer< T, ALLOC > Class Template Reference

Streamer for reading/writing SG::PackedContainer instances. More...

Inheritance diagram for SG::PackedContainerStreamer< T, ALLOC >:
Collaboration diagram for SG::PackedContainerStreamer< T, ALLOC >:

Public Member Functions

 PackedContainerStreamer ()
 Constructor. More...
 
virtual void operator() (TBuffer &b, void *objp) override
 Run the streamer. More...
 
virtual TClassStreamer * Generate () const override
 Clone operation, required for MT. More...
 

Private Attributes

std::string m_className
 Name of the class we read/write (for error messages). More...
 

Detailed Description

template<class T, class ALLOC>
class SG::PackedContainerStreamer< T, ALLOC >

Streamer for reading/writing SG::PackedContainer instances.

Definition at line 73 of file PackedContainerStreamer.cxx.

Constructor & Destructor Documentation

◆ PackedContainerStreamer()

template<class T , class ALLOC >
SG::PackedContainerStreamer< T, ALLOC >::PackedContainerStreamer

Constructor.

constructor.

Definition at line 107 of file PackedContainerStreamer.cxx.

Member Function Documentation

◆ Generate()

template<class T , class ALLOC >
TClassStreamer * SG::PackedContainerStreamer< T, ALLOC >::Generate
overridevirtual

Clone operation, required for MT.

Definition at line 163 of file PackedContainerStreamer.cxx.

164 {
165  return new PackedContainerStreamer<T, ALLOC> (*this);
166 }

◆ operator()()

template<class T , class ALLOC >
void SG::PackedContainerStreamer< T, ALLOC >::operator() ( TBuffer &  b,
void *  objp 
)
overridevirtual

Run the streamer.

Parameters
bBuffer from/to which to read/write.
objpObject instance.

Definition at line 119 of file PackedContainerStreamer.cxx.

119  {
121  reinterpret_cast<SG::PackedContainer<T, ALLOC>*> (objp);
122 
123  if (b.IsReading()) {
124  UInt_t R__s, R__c;
125  Version_t R__v = b.ReadVersion(&R__s, &R__c);
126  if (R__v != 1) {
127  Error ("PackedContainerStreamer",
128  "Bad version %d for object of type %s (expected 1)",
129  R__v, m_className.c_str());
130  }
131 
132  cont->setParms (readPackedParameters (b));
133 
134  uint32_t nelt;
135  b >> nelt;
136 
137  SG::PackedConverter cnv (cont->parms());
138  cnv.read (nelt, *cont, b);
139 
140  b.CheckByteCount(R__s, R__c, m_className.c_str());
141  }
142  else {
143  UInt_t R__c = b.Length();
144  b.SetBufferOffset (R__c + sizeof(UInt_t));
145  b << Version_t(1);
146  writePackedParameters (b, cont->parms());
147 
148  uint32_t nelt = cont->size();
149  b << nelt;
150 
151  SG::PackedConverter cnv (cont->parms());
152  cnv.write (cont->size(), *cont, b);
153 
154  b.SetByteCount(R__c, kTRUE);
155  }
156 }

Member Data Documentation

◆ m_className

template<class T , class ALLOC >
std::string SG::PackedContainerStreamer< T, ALLOC >::m_className
private

Name of the class we read/write (for error messages).

Definition at line 99 of file PackedContainerStreamer.cxx.


The documentation for this class was generated from the following file:
SG::writePackedParameters
void writePackedParameters(TBuffer &b, const SG::PackedParameters &parms)
Write a set of packed parameters to a buffer.
Definition: PackedContainerStreamer.cxx:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::PackedConverter
Helper for packing/unpacking a PackedContainer to/from a stream.
Definition: PackedConverter.h:44
ClassName
An interface for getting the name of a class as a string.
Definition: AthenaKernel/AthenaKernel/ClassName.h:33
SG::PackedContainer::setParms
void setParms(const PackedParameters &parms)
Set the packing parameters.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
SG::PackedContainer::parms
const PackedParameters & parms() const
Return the packing parameters for this container.
SG::PackedContainer
Container to hold aux data to be stored in a packed form.
Definition: PackedContainer.h:50
SG::readPackedParameters
SG::PackedParameters readPackedParameters(TBuffer &b)
Read a set of packed parameters from a buffer.
Definition: PackedContainerStreamer.cxx:47
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
SG::PackedContainerStreamer::m_className
std::string m_className
Name of the class we read/write (for error messages).
Definition: PackedContainerStreamer.cxx:99