BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
AutoEnlargeBuffer Class Reference

#include <AutoEnlargeBuffer.h>

Public Member Functions

 AutoEnlargeBuffer (int size=128 *1024)
 
 ~AutoEnlargeBuffer ()
 
void copy (void *src, int size)
 
int size ()
 
void * data ()
 
 AutoEnlargeBuffer (int size=128 *1024)
 
 ~AutoEnlargeBuffer ()
 
void copy (void *src, int size)
 
int size ()
 
void * data ()
 

Detailed Description

Constructor & Destructor Documentation

◆ AutoEnlargeBuffer() [1/2]

AutoEnlargeBuffer::AutoEnlargeBuffer ( int  size = 128*1024)
inline

◆ ~AutoEnlargeBuffer() [1/2]

AutoEnlargeBuffer::~AutoEnlargeBuffer ( )
inline

Definition at line 35 of file DistBoss/DistBossUtil/DistBossUtil-00-00-04/DistBossUtil/AutoEnlargeBuffer.h.

36{
37 free( m_buffer );
38}

◆ AutoEnlargeBuffer() [2/2]

AutoEnlargeBuffer::AutoEnlargeBuffer ( int  size = 128 *1024)
inline

◆ ~AutoEnlargeBuffer() [2/2]

AutoEnlargeBuffer::~AutoEnlargeBuffer ( )
inline

Member Function Documentation

◆ copy() [1/2]

void AutoEnlargeBuffer::copy ( void *  src,
int  size 
)
inline

Definition at line 40 of file DistBoss/DistBossUtil/DistBossUtil-00-00-04/DistBossUtil/AutoEnlargeBuffer.h.

41{
42 if ( size > m_SIZE ) {
43 do {
44 m_SIZE *= 2;
45 }
46 while ( size > m_SIZE );
47
48 free( m_buffer );
49 m_buffer = malloc(m_SIZE);
50 }
51
52 m_size = size;
53 memcpy(m_buffer, src, size);
54}

Referenced by DimRpcReader::nextEvent().

◆ copy() [2/2]

void AutoEnlargeBuffer::copy ( void *  src,
int  size 
)
inline

◆ data() [1/2]

void * AutoEnlargeBuffer::data ( )
inline

◆ data() [2/2]

void * AutoEnlargeBuffer::data ( )
inline

Definition at line 18 of file InstallArea/include/DistBossUtil/DistBossUtil/AutoEnlargeBuffer.h.

18{ return m_buffer; }

◆ size() [1/2]

int AutoEnlargeBuffer::size ( )
inline

Definition at line 17 of file DistBoss/DistBossUtil/DistBossUtil-00-00-04/DistBossUtil/AutoEnlargeBuffer.h.

17{ return m_size; }

Referenced by AutoEnlargeBuffer(), and copy().

◆ size() [2/2]

int AutoEnlargeBuffer::size ( )
inline

Definition at line 17 of file InstallArea/include/DistBossUtil/DistBossUtil/AutoEnlargeBuffer.h.

17{ return m_size; }

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