BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
basic_binstreambuf< _Ch, _Tr > Class Template Reference

#include <binarystream.h>

Inheritance diagram for basic_binstreambuf< _Ch, _Tr >:

Public Member Functions

 basic_binstreambuf (std::streamsize sz)
 basic_binstreambuf (const _Ch *p)
virtual ~basic_binstreambuf ()
_Ch * givebuf ()
size_t outbufsize () const
 basic_binstreambuf (std::streamsize sz)
 basic_binstreambuf (const _Ch *p)
virtual ~basic_binstreambuf ()
_Ch * givebuf ()
size_t outbufsize () const
 basic_binstreambuf (std::streamsize sz)
 basic_binstreambuf (const _Ch *p)
virtual ~basic_binstreambuf ()
_Ch * givebuf ()
size_t outbufsize () const

Static Public Member Functions

static size_t computesize (size_t s)
static size_t computesize (size_t s)
static size_t computesize (size_t s)

Detailed Description

template<class _Ch, class _Tr = std::char_traits<_Ch>>
class basic_binstreambuf< _Ch, _Tr >

Definition at line 26 of file Calibration/facilities/include/facilities/binarystream.h.

Constructor & Destructor Documentation

◆ basic_binstreambuf() [1/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( std::streamsize sz)
inline

Definition at line 29 of file Calibration/facilities/include/facilities/binarystream.h.

30 : _outbuf( new _Ch[sz + sizeof( std::streamsize ) / sizeof( _Ch )] ), _inbuf( 0 ) {
31 memcpy( _outbuf, &sz, sizeof( std::streamsize ) );
32 setp( _outbuf + sizeof( std::streamsize ),
33 _outbuf + sz * sizeof( _Ch ) + sizeof( unsigned int ) );
34 }

◆ basic_binstreambuf() [2/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( const _Ch * p)
inline

Definition at line 35 of file Calibration/facilities/include/facilities/binarystream.h.

35 : _outbuf( 0 ), _inbuf( 0 ) {
36 std::streamsize sz = *( (const std::streamsize*)p );
37 _inbuf = new _Ch[sz];
38 memcpy( _inbuf, p + sizeof( std::streamsize ), sz );
39 setg( _inbuf, _inbuf, _inbuf + sz * sizeof( _Ch ) );
40 }

◆ ~basic_binstreambuf() [1/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
virtual basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf ( )
inlinevirtual

Definition at line 41 of file Calibration/facilities/include/facilities/binarystream.h.

41 {
42 delete _outbuf;
43 delete _inbuf;
44 }

◆ basic_binstreambuf() [3/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( std::streamsize sz)
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

30 : _outbuf( new _Ch[sz + sizeof( std::streamsize ) / sizeof( _Ch )] ), _inbuf( 0 ) {
31 memcpy( _outbuf, &sz, sizeof( std::streamsize ) );
32 setp( _outbuf + sizeof( std::streamsize ),
33 _outbuf + sz * sizeof( _Ch ) + sizeof( unsigned int ) );
34 }

◆ basic_binstreambuf() [4/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( const _Ch * p)
inline

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

35 : _outbuf( 0 ), _inbuf( 0 ) {
36 std::streamsize sz = *( (const std::streamsize*)p );
37 _inbuf = new _Ch[sz];
38 memcpy( _inbuf, p + sizeof( std::streamsize ), sz );
39 setg( _inbuf, _inbuf, _inbuf + sz * sizeof( _Ch ) );
40 }

◆ ~basic_binstreambuf() [2/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
virtual basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf ( )
inlinevirtual

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

41 {
42 delete _outbuf;
43 delete _inbuf;
44 }

◆ basic_binstreambuf() [5/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( std::streamsize sz)
inline

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

30 : _outbuf( new _Ch[sz + sizeof( std::streamsize ) / sizeof( _Ch )] ), _inbuf( 0 ) {
31 memcpy( _outbuf, &sz, sizeof( std::streamsize ) );
32 setp( _outbuf + sizeof( std::streamsize ),
33 _outbuf + sz * sizeof( _Ch ) + sizeof( unsigned int ) );
34 }

◆ basic_binstreambuf() [6/6]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
basic_binstreambuf< _Ch, _Tr >::basic_binstreambuf ( const _Ch * p)
inline

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

35 : _outbuf( 0 ), _inbuf( 0 ) {
36 std::streamsize sz = *( (const std::streamsize*)p );
37 _inbuf = new _Ch[sz];
38 memcpy( _inbuf, p + sizeof( std::streamsize ), sz );
39 setg( _inbuf, _inbuf, _inbuf + sz * sizeof( _Ch ) );
40 }

◆ ~basic_binstreambuf() [3/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
virtual basic_binstreambuf< _Ch, _Tr >::~basic_binstreambuf ( )
inlinevirtual

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

41 {
42 delete _outbuf;
43 delete _inbuf;
44 }

Member Function Documentation

◆ computesize() [1/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::computesize ( size_t s)
inlinestatic

◆ computesize() [2/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::computesize ( size_t s)
inlinestatic

Definition at line 63 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

63{ return s + sizeof( std::streamsize ); }

◆ computesize() [3/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::computesize ( size_t s)
inlinestatic

Definition at line 63 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

63{ return s + sizeof( std::streamsize ); }

◆ givebuf() [1/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
_Ch * basic_binstreambuf< _Ch, _Tr >::givebuf ( )
inline

Definition at line 47 of file Calibration/facilities/include/facilities/binarystream.h.

47 {
48 _Ch* p = _outbuf;
49 _outbuf = 0;
50 return p;
51 }

◆ givebuf() [2/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
_Ch * basic_binstreambuf< _Ch, _Tr >::givebuf ( )
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

47 {
48 _Ch* p = _outbuf;
49 _outbuf = 0;
50 return p;
51 }

◆ givebuf() [3/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
_Ch * basic_binstreambuf< _Ch, _Tr >::givebuf ( )
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

47 {
48 _Ch* p = _outbuf;
49 _outbuf = 0;
50 return p;
51 }

◆ outbufsize() [1/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::outbufsize ( ) const
inline

Definition at line 55 of file Calibration/facilities/include/facilities/binarystream.h.

55 {
56 return ( _outbuf )
57 ? ( sizeof( _Ch ) * ( *(std::streamsize*)_outbuf ) + sizeof( std::streamsize ) )
58 : 0;
59 }

◆ outbufsize() [2/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::outbufsize ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/binarystream.h.

55 {
56 return ( _outbuf )
57 ? ( sizeof( _Ch ) * ( *(std::streamsize*)_outbuf ) + sizeof( std::streamsize ) )
58 : 0;
59 }

◆ outbufsize() [3/3]

template<class _Ch, class _Tr = std::char_traits<_Ch>>
size_t basic_binstreambuf< _Ch, _Tr >::outbufsize ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/binarystream.h.

55 {
56 return ( _outbuf )
57 ? ( sizeof( _Ch ) * ( *(std::streamsize*)_outbuf ) + sizeof( std::streamsize ) )
58 : 0;
59 }

The documentation for this class was generated from the following files: