Definition at line 28 of file buffer.
◆ buffer() [1/2]
tools::wroot::buffer::buffer |
( |
std::ostream & |
a_out, |
|
|
bool |
a_byte_swap, |
|
|
uint32 |
a_size |
|
) |
| |
|
inline |
Definition at line 34 of file buffer.
44 mem::increment(s_class().c_str());
◆ ~buffer()
virtual tools::wroot::buffer::~buffer |
( |
| ) |
|
|
inlinevirtual |
Definition at line 54 of file buffer.
63 mem::decrement(s_class().c_str());
◆ buffer() [2/2]
tools::wroot::buffer::buffer |
( |
const buffer & |
a_from | ) |
|
|
inlineprotected |
Definition at line 67 of file buffer.
74 ,
m_wb(a_from.m_out,a_from.m_byte_swap,0,
m_pos)
77 mem::increment(s_class().c_str());
◆ buf() [1/2]
char* tools::wroot::buffer::buf |
( |
| ) |
|
|
inline |
◆ buf() [2/2]
const char* tools::wroot::buffer::buf |
( |
| ) |
const |
|
inline |
◆ byte_swap()
bool tools::wroot::buffer::byte_swap |
( |
| ) |
const |
|
inline |
◆ displace_mapped()
bool tools::wroot::buffer::displace_mapped |
( |
unsigned int |
a_num | ) |
|
|
inline |
Definition at line 297 of file buffer.
304 typedef std::pair<uint32,uint32> offset_id;
307 unsigned int offset = (*it).first;
308 unsigned int id = (*it).second;
311 unsigned int clIdx =
id+a_num;
320 uint32 offset = (*it).first;
327 unsigned int objIdx =
id+a_num;
328 if(!
write(objIdx)) {
m_pos = opos;
return false;}
◆ expand()
bool tools::wroot::buffer::expand |
( |
uint32 |
a_new_size | ) |
|
|
inline |
Definition at line 276 of file buffer.
279 m_out <<
"tools::wroot::buffer::expand :"
280 <<
" can't realloc " << a_new_size <<
" bytes."
◆ expand2()
bool tools::wroot::buffer::expand2 |
( |
uint32 |
a_new_size | ) |
|
|
inline |
◆ kByteCountMask()
static uint32 tools::wroot::buffer::kByteCountMask |
( |
| ) |
|
|
inlinestaticprotected |
◆ kByteCountVMask()
static short tools::wroot::buffer::kByteCountVMask |
( |
| ) |
|
|
inlinestaticprotected |
◆ kClassMask()
static unsigned int tools::wroot::buffer::kClassMask |
( |
| ) |
|
|
inlinestaticprotected |
◆ kMapOffset()
static int tools::wroot::buffer::kMapOffset |
( |
| ) |
|
|
inlinestaticprotected |
◆ kMaxMapCount()
static uint32 tools::wroot::buffer::kMaxMapCount |
( |
| ) |
|
|
inlinestaticprotected |
◆ kMaxVersion()
static short tools::wroot::buffer::kMaxVersion |
( |
| ) |
|
|
inlinestaticprotected |
◆ kNewClassTag()
static uint32 tools::wroot::buffer::kNewClassTag |
( |
| ) |
|
|
inlinestaticprotected |
◆ length()
uint32 tools::wroot::buffer::length |
( |
| ) |
const |
|
inline |
◆ max_pos()
char* tools::wroot::buffer::max_pos |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ out()
std::ostream& tools::wroot::buffer::out |
( |
| ) |
const |
|
inline |
◆ pos()
char*& tools::wroot::buffer::pos |
( |
| ) |
|
|
inline |
◆ reset_objs_map()
void tools::wroot::buffer::reset_objs_map |
( |
| ) |
|
|
inline |
◆ set_byte_count()
bool tools::wroot::buffer::set_byte_count |
( |
uint32 |
a_pos | ) |
|
|
inline |
Definition at line 199 of file buffer.
202 m_out <<
"tools::wroot::buffer::set_byte_count :"
203 <<
" bytecount too large (more than "
219 {
m_pos = opos;
return false;}
223 {
m_pos = opos;
return false;}
◆ set_byte_count_obj()
bool tools::wroot::buffer::set_byte_count_obj |
( |
uint32 |
a_pos | ) |
|
|
inlineprotected |
Definition at line 373 of file buffer.
376 m_out <<
"tools::wroot::buffer::set_byte_count_obj :"
377 <<
" bytecount too large (more than "
◆ size()
uint32 tools::wroot::buffer::size |
( |
| ) |
const |
|
inline |
◆ to_displace()
size_t tools::wroot::buffer::to_displace |
( |
| ) |
const |
|
inline |
◆ write() [1/3]
bool tools::wroot::buffer::write |
( |
bool |
x | ) |
|
|
inline |
Definition at line 104 of file buffer.
104 {
return write<unsigned char>(x?1:0);}
◆ write() [2/3]
bool tools::wroot::buffer::write |
( |
const std::string & |
x | ) |
|
|
inline |
◆ write() [3/3]
template<class T >
bool tools::wroot::buffer::write |
( |
T |
x | ) |
|
|
inline |
◆ write_array() [1/2]
template<class T >
bool tools::wroot::buffer::write_array |
( |
const std::vector< T > |
a_v | ) |
|
|
inline |
◆ write_array() [2/2]
template<class T >
bool tools::wroot::buffer::write_array |
( |
const T * |
a_a, |
|
|
uint32 |
a_n |
|
) |
| |
|
inline |
Definition at line 148 of file buffer.
149 if(!
write(a_n))
return false;
◆ write_array2()
template<class T >
bool tools::wroot::buffer::write_array2 |
( |
const std::vector< std::vector< T > > |
a_v | ) |
|
|
inline |
Definition at line 160 of file buffer.
162 for(
unsigned int index=0;index<a_v.size();index++) {
◆ write_class()
bool tools::wroot::buffer::write_class |
( |
const std::string & |
a_cls | ) |
|
|
inlineprotected |
Definition at line 349 of file buffer.
351 std::map<std::string,uint32>::const_iterator it =
m_clss.find(a_cls);
353 uint32 clIdx = (*it).second;
360 m_cls_mapped.push_back(std::pair<uint32,uint32>(offset,clIdx));
◆ write_cstring()
bool tools::wroot::buffer::write_cstring |
( |
const char * |
a_s | ) |
|
|
inline |
◆ write_fast_array() [1/3]
bool tools::wroot::buffer::write_fast_array |
( |
const char * |
a_a, |
|
|
uint32 |
a_n |
|
) |
| |
|
inline |
Definition at line 114 of file buffer.
115 if(!a_n)
return true;
116 uint32 l = a_n *
sizeof(char);
120 ::memcpy(
m_pos,a_a,l);
◆ write_fast_array() [2/3]
template<class T >
bool tools::wroot::buffer::write_fast_array |
( |
const std::vector< T > & |
a_v | ) |
|
|
inline |
Definition at line 138 of file buffer.
139 if(a_v.empty())
return true;
◆ write_fast_array() [3/3]
template<class T >
bool tools::wroot::buffer::write_fast_array |
( |
const T * |
a_a, |
|
|
uint32 |
a_n |
|
) |
| |
|
inline |
Definition at line 128 of file buffer.
129 if(!a_n)
return true;
130 uint32 l = a_n *
sizeof(T);
◆ write_object()
bool tools::wroot::buffer::write_object |
( |
const ibo & |
a_obj | ) |
|
|
inline |
Definition at line 231 of file buffer.
235 std::map<ibo*,uint32>::const_iterator it =
m_objs.find((ibo*)&a_obj);
238 uint32 objIdx = (*it).second;
243 if(!
write(objIdx))
return false;
245 m_obj_mapped.push_back(std::pair<uint32,uint32>(offset,objIdx));
256 m_pos +=
sizeof(
unsigned int);
266 if(!a_obj.stream(*
this))
return false;
◆ write_version() [1/2]
bool tools::wroot::buffer::write_version |
( |
short |
a_version | ) |
|
|
inline |
Definition at line 169 of file buffer.
171 m_out <<
"tools::wroot::buffer::write_version :"
172 <<
" version number " << a_version
173 <<
" cannot be larger than " <<
kMaxVersion() <<
"."
177 return write(a_version);
◆ write_version() [2/2]
bool tools::wroot::buffer::write_version |
( |
short |
a_version, |
|
|
uint32 & |
a_pos |
|
) |
| |
|
inline |
Definition at line 179 of file buffer.
187 m_pos +=
sizeof(
unsigned int);
190 m_out <<
"tools::wroot::buffer::write_version :"
191 <<
" version number " << a_version
192 <<
" cannot be larger than " <<
kMaxVersion() <<
"."
196 return write(a_version);
◆ m_buffer
char* tools::wroot::buffer::m_buffer |
|
protected |
◆ m_byte_swap
bool tools::wroot::buffer::m_byte_swap |
|
protected |
◆ m_cls_mapped
std::vector< std::pair<uint32,uint32> > tools::wroot::buffer::m_cls_mapped |
|
protected |
◆ m_clss
std::map<std::string,uint32> tools::wroot::buffer::m_clss |
|
protected |
◆ m_max
char* tools::wroot::buffer::m_max |
|
protected |
◆ m_obj_mapped
std::vector< std::pair<uint32,uint32> > tools::wroot::buffer::m_obj_mapped |
|
protected |
◆ m_objs
std::map<ibo*,uint32> tools::wroot::buffer::m_objs |
|
protected |
◆ m_out
std::ostream& tools::wroot::buffer::m_out |
|
protected |
◆ m_pos
char* tools::wroot::buffer::m_pos |
|
protected |
◆ m_size
uint32 tools::wroot::buffer::m_size |
|
protected |
◆ m_wb
wbuf tools::wroot::buffer::m_wb |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/wroot/buffer