Panda3D
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. More...
 
size_t BufferAvailabe (void)
 Will report amount of data that is contiguas that can be writen at the location returned by GetBufferOpen. More...
 
void Compress (void)
 Try and do a intelegent compress of the data space the algorithem is really stupid right know. More...
 
void FullCompress (void)
 Force a compress of the data. More...
 
bool Get (char *data, size_t len)
 will copy the data . More...
 
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. More...
 
void ResetContent (void)
 Throw away all inread information. More...
 

Detailed Description

Definition at line 6 of file ringbuffer.h.

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(), 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().

◆ 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().

◆ 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.

◆ 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.

◆ 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: