InspIRCd  3.0
Public Types | Public Member Functions | List of all members
StreamSocket::SendQueue Class Reference

#include <inspsocket.h>

Public Types

typedef std::string Element
 
typedef std::deque< ElementContainer
 
typedef Container::const_iterator const_iterator
 

Public Member Functions

bool empty () const
 
Container::size_type size () const
 
size_t bytes () const
 
const Elementfront () const
 
const_iterator begin () const
 
const_iterator end () const
 
void pop_front ()
 
void erase_front (Element::size_type n)
 
void push_front (const Element &newdata)
 
void push_back (const Element &newdata)
 
void clear ()
 
void moveall (SendQueue &other)
 

Detailed Description

Socket send queue

Member Typedef Documentation

◆ const_iterator

typedef Container::const_iterator StreamSocket::SendQueue::const_iterator

Container iterator

◆ Container

Sequence container of buffers in the queue

◆ Element

typedef std::string StreamSocket::SendQueue::Element

One element of the queue, a continuous buffer

Member Function Documentation

◆ begin()

const_iterator StreamSocket::SendQueue::begin ( ) const
inline

Get an iterator to the first buffer in the queue. The returned iterator cannot be used to make modifications to the queue, for that purpose the member functions push_*(), pop_front(), erase_front() and clear() can be used.

Returns
Iterator referring to the first buffer in the queue, or end() if there are no elements.

◆ bytes()

size_t StreamSocket::SendQueue::bytes ( ) const
inline

Get the number of queued bytes

Returns
Size in bytes of the data in the queue

◆ clear()

void StreamSocket::SendQueue::clear ( )
inline

Clear the queue

◆ empty()

bool StreamSocket::SendQueue::empty ( ) const
inline

Return whether the queue is empty

Returns
True if the queue is empty, false otherwise

◆ end()

const_iterator StreamSocket::SendQueue::end ( ) const
inline

Get an iterator to the (theoretical) buffer one past the end of the queue.

Returns
Iterator referring to one element past the end of the container

◆ erase_front()

void StreamSocket::SendQueue::erase_front ( Element::size_type  n)
inline

Remove bytes from the beginning of the first buffer

Parameters
nNumber of bytes to remove

◆ front()

const Element& StreamSocket::SendQueue::front ( ) const
inline

Get the first buffer of the queue

Returns
A reference to the first buffer in the queue

◆ pop_front()

void StreamSocket::SendQueue::pop_front ( )
inline

Remove the first buffer in the queue

◆ push_back()

void StreamSocket::SendQueue::push_back ( const Element newdata)
inline

Insert a new buffer at the end of the queue

Parameters
newdataData to add

◆ push_front()

void StreamSocket::SendQueue::push_front ( const Element newdata)
inline

Insert a new buffer at the beginning of the queue

Parameters
newdataData to add

◆ size()

Container::size_type StreamSocket::SendQueue::size ( ) const
inline

Get the number of individual buffers in the queue

Returns
Number of individual buffers in the queue

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