ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual void operator() (TBuffer &b, void *objp) override
 Run the streamer.
virtual TClassStreamer * Generate () const override
 Clone operation, required for MT.

Private Attributes

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

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.

109{
110}
Streamer for reading/writing SG::PackedContainer instances.
std::string m_className
Name of the class we read/write (for error messages).

Member Function Documentation

◆ Generate()

template<class T, class ALLOC>
TClassStreamer * SG::PackedContainerStreamer< T, ALLOC >::Generate ( ) const
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()) {
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
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}
void writePackedParameters(TBuffer &b, const SG::PackedParameters &parms)
Write a set of packed parameters to a buffer.

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: