Definition at line 22 of file rbuf.
◆ rbuf() [1/2]
tools::rroot::rbuf::rbuf |
( |
std::ostream & |
a_out, |
|
|
bool |
a_byte_swap, |
|
|
const char * |
a_eob, |
|
|
char *& |
a_pos |
|
) |
| |
|
inline |
Definition at line 80 of file rbuf.
91 mem::increment(s_class().c_str());
◆ ~rbuf()
virtual tools::rroot::rbuf::~rbuf |
( |
| ) |
|
|
inlinevirtual |
Definition at line 95 of file rbuf.
97 mem::decrement(s_class().c_str());
◆ rbuf() [2/2]
tools::rroot::rbuf::rbuf |
( |
const rbuf & |
a_from | ) |
|
|
inline |
Definition at line 101 of file rbuf.
111 mem::increment(s_class().c_str());
◆ _check_eob()
template<class T >
bool tools::rroot::rbuf::_check_eob |
( |
T & |
a_x | ) |
|
|
inlineprotected |
Definition at line 387 of file rbuf.
390 m_out << s_class() <<
" : " <<
stype(T()) <<
" : "
391 <<
" try to access out of buffer " << long_out(
sizeof(T)) <<
" bytes"
392 <<
" (pos=" << charp_out(
m_pos)
393 <<
", eob=" << charp_out(
m_eob) <<
")." << std::endl;
◆ check_eob()
bool tools::rroot::rbuf::check_eob |
( |
uint32 |
n | ) |
|
|
inline |
Definition at line 375 of file rbuf.
377 m_out <<
"tools::rroot::rbuf::check_eob :"
378 <<
" try to access out of buffer " << n <<
" bytes."
◆ eob()
const char* tools::rroot::rbuf::eob |
( |
| ) |
const |
|
inline |
Definition at line 131 of file rbuf.
◆ operator=()
rbuf& tools::rroot::rbuf::operator= |
( |
const rbuf & |
a_from | ) |
|
|
inline |
Definition at line 115 of file rbuf.
117 m_eob = a_from.m_eob;
◆ out()
std::ostream& tools::rroot::rbuf::out |
( |
| ) |
const |
|
inline |
Definition at line 125 of file rbuf.
◆ pos()
char*& tools::rroot::rbuf::pos |
( |
| ) |
|
|
inline |
Definition at line 130 of file rbuf.
◆ read() [1/13]
bool tools::rroot::rbuf::read |
( |
bool & |
x | ) |
|
|
inline |
Definition at line 241 of file rbuf.
242 unsigned char uc = 0;
243 bool status =
read(uc);
◆ read() [2/13]
bool tools::rroot::rbuf::read |
( |
char & |
a_x | ) |
|
|
inline |
Definition at line 186 of file rbuf.
187 if(!_check_eob<char>(a_x))
return false;
◆ read() [3/13]
bool tools::rroot::rbuf::read |
( |
double & |
a_x | ) |
|
|
inline |
Definition at line 179 of file rbuf.
180 if(!_check_eob<double>(a_x))
return false;
182 m_pos +=
sizeof(double);
◆ read() [4/13]
bool tools::rroot::rbuf::read |
( |
float & |
a_x | ) |
|
|
inline |
Definition at line 172 of file rbuf.
173 if(!_check_eob<float>(a_x))
return false;
175 m_pos +=
sizeof(float);
◆ read() [5/13]
bool tools::rroot::rbuf::read |
( |
int & |
a_x | ) |
|
|
inline |
Definition at line 198 of file rbuf.
199 if(!_check_eob<int>(a_x))
return false;
201 m_pos +=
sizeof(int);
◆ read() [6/13]
bool tools::rroot::rbuf::read |
( |
int64 & |
a_x | ) |
|
|
inline |
Definition at line 205 of file rbuf.
206 if(!_check_eob<int64>(a_x))
return false;
◆ read() [7/13]
bool tools::rroot::rbuf::read |
( |
short & |
a_x | ) |
|
|
inline |
Definition at line 191 of file rbuf.
192 if(!_check_eob<short>(a_x))
return false;
194 m_pos +=
sizeof(short);
◆ read() [8/13]
bool tools::rroot::rbuf::read |
( |
std::string & |
a_x | ) |
|
|
inline |
Definition at line 212 of file rbuf.
214 if(!
read(nwh)) {a_x.clear();
return false;}
217 if(!
read(nchars)) {a_x.clear();
return false;}
222 m_out << s_class() <<
"::read(string) :"
223 <<
" negative char number " << nchars <<
"." << std::endl;
228 m_out << s_class() <<
"::read(string) :"
229 <<
" try to access out of buffer " << long_out(nchars) <<
" bytes "
230 <<
" (pos=" << charp_out(
m_pos)
231 <<
", eob=" << charp_out(
m_eob) <<
")." << std::endl;
236 ::memcpy((
char*)a_x.c_str(),
m_pos,nchars);
◆ read() [9/13]
bool tools::rroot::rbuf::read |
( |
std::vector< std::string > & |
a_a | ) |
|
|
inline |
Definition at line 247 of file rbuf.
249 if(!
read(n)) {a_a.clear();
return false;}
250 for(
int index=0;index<n;index++) {
252 if(!
read(s)) {a_a.clear();
return false;}
◆ read() [10/13]
bool tools::rroot::rbuf::read |
( |
uint64 & |
a_x | ) |
|
|
inline |
Definition at line 165 of file rbuf.
166 if(!_check_eob<uint64>(a_x))
return false;
◆ read() [11/13]
bool tools::rroot::rbuf::read |
( |
unsigned char & |
a_x | ) |
|
|
inline |
Definition at line 146 of file rbuf.
147 if(!_check_eob<unsigned char>(a_x))
return false;
◆ read() [12/13]
bool tools::rroot::rbuf::read |
( |
unsigned int & |
a_x | ) |
|
|
inline |
Definition at line 158 of file rbuf.
159 if(!_check_eob<unsigned int>(a_x))
return false;
161 m_pos +=
sizeof(
unsigned int);
◆ read() [13/13]
bool tools::rroot::rbuf::read |
( |
unsigned short & |
a_x | ) |
|
|
inline |
Definition at line 151 of file rbuf.
152 if(!_check_eob<unsigned short>(a_x))
return false;
154 m_pos +=
sizeof(
unsigned short);
◆ read_array() [1/2]
template<class T >
bool tools::rroot::rbuf::read_array |
( |
std::vector< T > & |
a_v | ) |
|
|
inline |
Definition at line 351 of file rbuf.
354 if(!
read_array(0,buffer,n)) {a_v.clear();
return false;}
355 if(!buffer) {a_v.clear();
return true;}
357 for(
uint32 index=0;index<n;index++) {
358 a_v[index] = buffer[index];
◆ read_array() [2/2]
template<class T >
bool tools::rroot::rbuf::read_array |
( |
uint32 |
a_sz, |
|
|
T *& |
a_a, |
|
|
uint32 & |
a_n |
|
) |
| |
|
inline |
Definition at line 314 of file rbuf.
317 if(!
read(n)) {a_n = 0;
return false;}
320 if(!a_n)
return true;
322 uint32 l = a_n *
sizeof(T);
329 if(!a_a) {a_n=0;
return false;}
332 if(a_n>a_sz)
return false;
336 for(
uint32 i=0;i<a_n;i++) {
337 if(!
read(*(a_a+i))) {
338 if(owner) {
delete [] a_a;a_a = 0;}
344 ::memcpy(a_a,
m_pos,l);
◆ read_array2()
template<class T >
bool tools::rroot::rbuf::read_array2 |
( |
std::vector< std::vector< T > > & |
a_v | ) |
|
|
inline |
Definition at line 365 of file rbuf.
367 if(!
read(n)) {a_v.clear();
return false;}
369 for(
int index=0;index<n;index++) {
◆ read_fast_array() [1/4]
bool tools::rroot::rbuf::read_fast_array |
( |
bool * |
b, |
|
|
uint32 |
n |
|
) |
| |
|
inline |
Definition at line 261 of file rbuf.
263 uint32 l = n *
sizeof(
unsigned char);
265 for(
uint32 i = 0; i < n; i++) {
267 if(!
read(uc))
return false;
268 b[i] = uc?
true:
false;
◆ read_fast_array() [2/4]
bool tools::rroot::rbuf::read_fast_array |
( |
char * |
c, |
|
|
uint32 |
n |
|
) |
| |
|
inline |
Definition at line 272 of file rbuf.
274 uint32 l = n *
sizeof(char);
◆ read_fast_array() [3/4]
template<class T >
bool tools::rroot::rbuf::read_fast_array |
( |
T * |
a_a, |
|
|
uint32 |
a_n |
|
) |
| |
|
inline |
Definition at line 290 of file rbuf.
291 if(!a_n)
return true;
293 uint32 l = a_n *
sizeof(T);
295 m_out << s_class() <<
"::read_fast_array :"
296 <<
" try to access out of buffer " << long_out(l) <<
" bytes "
297 <<
" (pos=" << charp_out(
m_pos)
298 <<
", eob=" << charp_out(
m_eob) <<
")." << std::endl;
303 for(
uint32 i=0;i<a_n;i++) {
304 if(!
read(*(a_a+i)))
return false;
307 ::memcpy(a_a,
m_pos,l);
◆ read_fast_array() [4/4]
bool tools::rroot::rbuf::read_fast_array |
( |
unsigned char * |
c, |
|
|
uint32 |
n |
|
) |
| |
|
inline |
Definition at line 280 of file rbuf.
282 uint32 l = n *
sizeof(
unsigned char);
284 ::memcpy(c,
m_pos, l);
◆ set_byte_swap()
void tools::rroot::rbuf::set_byte_swap |
( |
bool |
a_value | ) |
|
|
inline |
Definition at line 133 of file rbuf.
◆ set_eob()
void tools::rroot::rbuf::set_eob |
( |
const char * |
a_eob | ) |
|
|
inline |
Definition at line 129 of file rbuf.
◆ skip()
void tools::rroot::rbuf::skip |
( |
unsigned int |
a_num | ) |
|
|
inline |
Definition at line 127 of file rbuf.
◆ m_byte_swap
bool tools::rroot::rbuf::m_byte_swap |
|
protected |
Definition at line 401 of file rbuf.
◆ m_eob
const char* tools::rroot::rbuf::m_eob |
|
protected |
Definition at line 402 of file rbuf.
◆ m_out
std::ostream& tools::rroot::rbuf::m_out |
|
protected |
Definition at line 400 of file rbuf.
◆ m_pos
char*& tools::rroot::rbuf::m_pos |
|
protected |
Definition at line 403 of file rbuf.
◆ m_r_2_func
r_2_func tools::rroot::rbuf::m_r_2_func |
|
protected |
Definition at line 405 of file rbuf.
◆ m_r_4_func
r_4_func tools::rroot::rbuf::m_r_4_func |
|
protected |
Definition at line 406 of file rbuf.
◆ m_r_8_func
r_8_func tools::rroot::rbuf::m_r_8_func |
|
protected |
Definition at line 407 of file rbuf.
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/rroot/rbuf