ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | List of all members
TPIntegerVector_p1 Class Reference

#include <TPIntegerVector_p1.h>

Collaboration diagram for TPIntegerVector_p1:

Public Types

typedef unsigned int value_type
 
typedef value_typeiterator
 
typedef const value_typeconst_iterator
 

Public Member Functions

 TPIntegerVector_p1 (TPIntegerVectorStorage_p1 *storage, int idx)
 
size_t size () const
 
void resize (size_t new_size)
 
void reserve (size_t new_size)
 
value_typeoperator[] (size_t idx)
 
const value_typeoperator[] (size_t idx) const
 
void push_back (const value_type &val)
 
void push_int (const int &val)
 
void push_float (const float &val)
 
void push_double (const double val)
 
void push_TPObjRef (const TPObjRef &val)
 
void push_vTPObjRef (const std::vector< TPObjRef > &val)
 
value_type front_UI (const_iterator i) const
 
int front_int (const_iterator &i) const
 
float front_float (const_iterator &i) const
 
double front_double (const_iterator &i) const
 
TPObjRef front_TPObjRef (const_iterator &i) const
 
std::vector< TPObjReffront_vTPObjRef (const_iterator &i) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Protected Attributes

TPIntegerVectorStorage_p1m_storage
 
unsigned int m_position
 

Detailed Description

Definition at line 25 of file TPIntegerVector_p1.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 30 of file TPIntegerVector_p1.h.

◆ iterator

Definition at line 29 of file TPIntegerVector_p1.h.

◆ value_type

typedef unsigned int TPIntegerVector_p1::value_type

Definition at line 28 of file TPIntegerVector_p1.h.

Constructor & Destructor Documentation

◆ TPIntegerVector_p1()

TPIntegerVector_p1::TPIntegerVector_p1 ( TPIntegerVectorStorage_p1 storage,
int  idx 
)
inline

Definition at line 32 of file TPIntegerVector_p1.h.

33  : m_storage(storage), m_position(idx)
34  {}

Member Function Documentation

◆ begin() [1/2]

iterator TPIntegerVector_p1::begin ( )
inline

Definition at line 57 of file TPIntegerVector_p1.h.

57 { return &operator[](0); }

◆ begin() [2/2]

const_iterator TPIntegerVector_p1::begin ( ) const
inline

Definition at line 60 of file TPIntegerVector_p1.h.

60 { return &operator[](0); }

◆ end() [1/2]

iterator TPIntegerVector_p1::end ( )
inline

Definition at line 58 of file TPIntegerVector_p1.h.

58 { return &operator[](size()); };

◆ end() [2/2]

const_iterator TPIntegerVector_p1::end ( ) const
inline

Definition at line 61 of file TPIntegerVector_p1.h.

61 { return &operator[](size()); };

◆ front_double()

double TPIntegerVector_p1::front_double ( const_iterator i) const
inline

Definition at line 217 of file TPIntegerVector_p1.h.

217  {
218  union { double d; struct{unsigned int i1; unsigned int i2;}c; } m_union;
219  m_union.c.i1 = (*i); i++;
220  m_union.c.i2 = (*i); i++;
221  return m_union.d;
222 }

◆ front_float()

float TPIntegerVector_p1::front_float ( const_iterator i) const
inline

Definition at line 210 of file TPIntegerVector_p1.h.

210  {
211  union { float f; unsigned int i;} m_union;
212  m_union.i = (*i); i++;
213  return m_union.f;
214 }

◆ front_int()

int TPIntegerVector_p1::front_int ( const_iterator i) const
inline

Definition at line 203 of file TPIntegerVector_p1.h.

203  {
204  union { int f; unsigned int i;} m_union;
205  m_union.i = (*i); i++;
206  return m_union.f;
207 }

◆ front_TPObjRef()

TPObjRef TPIntegerVector_p1::front_TPObjRef ( const_iterator i) const
inline

Definition at line 225 of file TPIntegerVector_p1.h.

225  {
226  union {struct{unsigned short i1;unsigned short i2;} c; unsigned int I;} m_union;
227  m_union.I = (*i); i++;
228  TPObjRef res(TPObjRef::typeID_t(m_union.c.i2, m_union.c.i1),(int) (*i)); i++;
229  return res;
230 }

◆ front_UI()

value_type TPIntegerVector_p1::front_UI ( const_iterator  i) const
inline

Definition at line 50 of file TPIntegerVector_p1.h.

50 {value_type res=(*i); i++; return res;}

◆ front_vTPObjRef()

std::vector< TPObjRef > TPIntegerVector_p1::front_vTPObjRef ( const_iterator i) const
inline

Definition at line 233 of file TPIntegerVector_p1.h.

233  {
234  int size = (*i); i++;
235  union {struct{unsigned short i1;unsigned short i2;} c; unsigned int I;} m_union;
236  std::vector<TPObjRef> res;
237  res.reserve(size);
238  for(int it=0;it<size;it++){
239  m_union.I = (*i); i++;
240  res.push_back( TPObjRef(TPObjRef::typeID_t(m_union.c.i2, m_union.c.i1),(int) (*i)) ); i++;
241  }
242  return res;
243 }

◆ operator[]() [1/2]

TPIntegerVector_p1::value_type & TPIntegerVector_p1::operator[] ( size_t  idx)
inline

Definition at line 132 of file TPIntegerVector_p1.h.

132  {
133  return const_cast<value_type&>(((const TPIntegerVector_p1*)this)->operator[](idx));
134 }

◆ operator[]() [2/2]

const TPIntegerVector_p1::value_type & TPIntegerVector_p1::operator[] ( size_t  idx) const
inline

Definition at line 138 of file TPIntegerVector_p1.h.

138  {
139  size_t pos = m_position? m_storage->m_endPos[m_position-1] : 0;
140  return m_storage->m_data[ pos + idx ];
141 }

◆ push_back()

void TPIntegerVector_p1::push_back ( const value_type val)
inline

Definition at line 144 of file TPIntegerVector_p1.h.

145 {
146  m_storage->m_data.push_back( val );
148 }

◆ push_double()

void TPIntegerVector_p1::push_double ( const double  val)
inline

Definition at line 168 of file TPIntegerVector_p1.h.

168  {
169  union {struct{unsigned int i1;unsigned int i2;} c; double d;} m_union;
170  m_union.d = val;
171  m_storage->m_data.push_back( m_union.c.i1 );
172  m_storage->m_data.push_back( m_union.c.i2 );
174 }

◆ push_float()

void TPIntegerVector_p1::push_float ( const float &  val)
inline

Definition at line 159 of file TPIntegerVector_p1.h.

159  {
160  union {unsigned int i; float f;} m_union;
161  m_union.f = val;
162  m_storage->m_data.push_back( m_union.i );
164 }

◆ push_int()

void TPIntegerVector_p1::push_int ( const int &  val)
inline

Definition at line 151 of file TPIntegerVector_p1.h.

151  {
152  union {unsigned int i; int f;} m_union;
153  m_union.f = val;
154  m_storage->m_data.push_back( m_union.i );
156 }

◆ push_TPObjRef()

void TPIntegerVector_p1::push_TPObjRef ( const TPObjRef val)
inline

Definition at line 177 of file TPIntegerVector_p1.h.

177  {
178  union {struct{unsigned short i1;unsigned short i2;} c; unsigned int I;} m_union;
179  m_union.c.i1 = val.typeID();
180  m_union.c.i2 = val.topLevelCnvID();
181  m_storage->m_data.push_back( m_union.I );
182  m_storage->m_data.push_back( val.index());
184 }

◆ push_vTPObjRef()

void TPIntegerVector_p1::push_vTPObjRef ( const std::vector< TPObjRef > &  val)
inline

Definition at line 187 of file TPIntegerVector_p1.h.

187  {
188  m_storage->m_data.push_back( val.size());
190  union {struct{unsigned short i1;unsigned short i2;} c; unsigned int I;} m_union;
191  std::vector<TPObjRef>::const_iterator it=val.begin();
192  for (;it!=val.end();it++){
193  TPObjRef v = (*it);
194  m_union.c.i1 = v.typeID();
195  m_union.c.i2 = v.topLevelCnvID();
196  m_storage->m_data.push_back( m_union.I );
197  m_storage->m_data.push_back( v.index());
198  }
199  m_storage->m_endPos[m_position]+= 2*val.size();
200 }

◆ reserve()

void TPIntegerVector_p1::reserve ( size_t  new_size)
inline

Definition at line 123 of file TPIntegerVector_p1.h.

123  {
124  if( m_position != m_storage->size() - 1 )
125  throw std::runtime_error("TPIntegerVector_p1::reserve() only supported on the last element");
126  size_t change = new_size - size();
127  m_storage->m_data.reserve( m_storage->m_endPos[m_position] + change );
128 }

◆ resize()

void TPIntegerVector_p1::resize ( size_t  new_size)
inline

Definition at line 114 of file TPIntegerVector_p1.h.

114  {
115  if( m_position != m_storage->size() - 1 )
116  throw std::runtime_error("TPIntegerVector_p1::resize() only supported on the last element");
117  size_t change = new_size - size();
118  m_storage->m_endPos[m_position] += change;
120 }

◆ size()

size_t TPIntegerVector_p1::size ( ) const
inline

Definition at line 108 of file TPIntegerVector_p1.h.

108  {
109  if( m_position == 0 ) return m_storage->m_endPos[0];
111 }

Member Data Documentation

◆ m_position

unsigned int TPIntegerVector_p1::m_position
protected

Definition at line 65 of file TPIntegerVector_p1.h.

◆ m_storage

TPIntegerVectorStorage_p1* TPIntegerVector_p1::m_storage
protected

Definition at line 64 of file TPIntegerVector_p1.h.


The documentation for this class was generated from the following file:
TPIntegerVector_p1::m_position
unsigned int m_position
Definition: TPIntegerVector_p1.h:65
hist_file_dump.d
d
Definition: hist_file_dump.py:137
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPIntegerVectorStorage_p1::m_data
std::vector< TPIntegerVector_p1::value_type > m_data
Definition: TPIntegerVector_p1.h:101
TPIntegerVector_p1::m_storage
TPIntegerVectorStorage_p1 * m_storage
Definition: TPIntegerVector_p1.h:61
TPObjRef
Definition: TPObjRef.h:20
lumiFormat.i
int i
Definition: lumiFormat.py:85
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
hist_file_dump.f
f
Definition: hist_file_dump.py:135
TPIntegerVectorStorage_p1::size
size_t size() const
Definition: TPIntegerVector_p1.h:79
TPIntegerVector_p1
Definition: TPIntegerVector_p1.h:26
TPIntegerVector_p1::size
size_t size() const
Definition: TPIntegerVector_p1.h:108
TPIntegerVector_p1::operator[]
value_type & operator[](size_t idx)
Definition: TPIntegerVector_p1.h:132
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
TPIntegerVectorStorage_p1::m_endPos
std::vector< position_type > m_endPos
Definition: TPIntegerVector_p1.h:102
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TPObjRef::typeID_t
Definition: TPObjRef.h:31
I
#define I(x, y, z)
Definition: MD5.cxx:116
value_type
Definition: EDM_MasterSearch.h:11
python.compressB64.c
def c
Definition: compressB64.py:93