Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RingBuffer Class Reference
Inheritance diagram for RingBuffer:
MemBuffer Buffered_DatagramReader Buffered_DatagramWriter

Public Member Functions

 RingBuffer (size_t in_size=4096)
 
size_t AmountBuffered (void)
 Will report the number of unread chars in buffer.
 
size_t BufferAvailabe (void)
 Will report amount of data that is contiguas that can be writen at the location returned by GetBufferOpen.
 
void Compress (void)
 Try and do a intelegent compress of the data space the algorithem is really stupid right know.
 
void FullCompress (void)
 Force a compress of the data.
 
bool Get (char *data, size_t len)
 will copy the data .
 
bool Put (const char *data, size_t len)
 Adds Data to a ring Buffer Will do a compress if needed so pointers suplied by Get Call are no longer valide.
 
void ResetContent (void)
 Throw away all inread information.
 

Detailed Description

Definition at line 6 of file ringbuffer.h.

Constructor & Destructor Documentation

◆ RingBuffer()

RingBuffer::RingBuffer ( size_t in_size = 4096)
inline

Definition at line 59 of file ringbuffer.I.

Member Function Documentation

◆ AmountBuffered()

size_t RingBuffer::AmountBuffered ( void )
inline

Will report the number of unread chars in buffer.

Definition at line 32 of file ringbuffer.I.

Referenced by Buffered_DatagramConnection::Flush(), Get(), Buffered_DatagramConnection::GetMessage(), and Buffered_DatagramConnection::SendMessage().

◆ BufferAvailabe()

size_t RingBuffer::BufferAvailabe ( void )
inline

Will report amount of data that is contiguas that can be writen at the location returned by GetBufferOpen.

Definition at line 42 of file ringbuffer.I.

References MemBuffer::GetBufferSize().

Referenced by Put().

◆ Compress()

void RingBuffer::Compress ( void )
inline

Try and do a intelegent compress of the data space the algorithem is really stupid right know.

. just say if i have read past 1/2 my space do a compress...Im open for sugestions

Definition at line 87 of file ringbuffer.I.

References MemBuffer::GetBufferSize().

Referenced by Get(), and Put().

◆ FullCompress()

void RingBuffer::FullCompress ( void )
inline

Force a compress of the data.

Definition at line 67 of file ringbuffer.I.

◆ Get()

bool RingBuffer::Get ( char * data,
size_t len )
inline

will copy the data .

. false indicates not enogh data to read .. sorry...

Definition at line 136 of file ringbuffer.I.

References AmountBuffered(), and Compress().

◆ Put()

bool RingBuffer::Put ( const char * data,
size_t len )
inline

Adds Data to a ring Buffer Will do a compress if needed so pointers suplied by Get Call are no longer valide.

Definition at line 104 of file ringbuffer.I.

References BufferAvailabe(), and Compress().

◆ ResetContent()

void RingBuffer::ResetContent ( void )
inline

Throw away all inread information.

Definition at line 51 of file ringbuffer.I.

Referenced by Buffered_DatagramReader::ReSet(), and Buffered_DatagramWriter::ReSet().


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