5 #ifndef TPINTEGERVECTOR_H
6 #define TPINTEGERVECTOR_H
33 : m_storage(storage), m_position(
idx)
37 void resize(
size_t new_size );
38 void reserve(
size_t new_size );
43 void push_int(
const int&
val );
44 void push_float(
const float&
val );
45 void push_double(
const double val );
47 void push_vTPObjRef(
const std::vector<TPObjRef>&
val );
51 int front_int( const_iterator&
i )
const;
52 float front_float( const_iterator&
i )
const;
53 double front_double( const_iterator&
i )
const;
54 TPObjRef front_TPObjRef( const_iterator&
i )
const;
55 std::vector<TPObjRef> front_vTPObjRef( const_iterator&
i )
const;
80 return m_endPos.size();
84 if( !
size() ) m_endPos.push_back(0);
85 else m_endPos.push_back( m_endPos.back() );
101 std::vector< TPIntegerVector_p1::value_type >
m_data;
116 throw std::runtime_error(
"TPIntegerVector_p1::resize() only supported on the last element");
117 size_t change = new_size -
size();
125 throw std::runtime_error(
"TPIntegerVector_p1::reserve() only supported on the last element");
126 size_t change = new_size -
size();
152 union {
unsigned int i;
int f;} m_union;
154 m_storage->m_data.push_back( m_union.i );
155 m_storage->m_endPos[m_position]++;
160 union {
unsigned int i;
float f;} m_union;
162 m_storage->m_data.push_back( m_union.i );
163 m_storage->m_endPos[m_position]++;
169 union {
struct{
unsigned int i1;
unsigned int i2;}
c;
double d;} m_union;
171 m_storage->m_data.push_back( m_union.c.i1 );
172 m_storage->m_data.push_back( m_union.c.i2 );
173 m_storage->m_endPos[m_position]+=2;
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());
183 m_storage->m_endPos[m_position]+=2;
188 m_storage->m_data.push_back(
val.size());
189 m_storage->m_endPos[m_position]++;
190 union {
struct{
unsigned short i1;
unsigned short i2;}
c;
unsigned int I;} m_union;
191 std::vector<TPObjRef>::const_iterator
it=
val.begin();
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());
199 m_storage->m_endPos[m_position]+= 2*
val.size();
204 union {
int f;
unsigned int i;} m_union;
205 m_union.i = (*i);
i++;
211 union {
float f;
unsigned int i;} m_union;
212 m_union.i = (*i);
i++;
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++;
226 union {
struct{
unsigned short i1;
unsigned short i2;}
c;
unsigned int I;} m_union;
227 m_union.I = (*i);
i++;
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;
239 m_union.I = (*i);
i++;