Logo
~Sockets~
~Examples~
~Contact~


TcpSocket::OUTPUT Struct Reference
[Internal utility]

Output buffer struct. More...

#include <TcpSocket.h>

List of all members.


Public Member Functions

 OUTPUT ()
 OUTPUT (const char *buf, size_t len)
size_t Space ()
void Add (const char *buf, size_t len)
size_t Remove (size_t len)
const char * Buf ()
size_t Len ()

Public Attributes

size_t _b
size_t _t
size_t _q
char _buf [TCP_OUTPUT_CAPACITY]

Detailed Description

Output buffer struct.

Definition at line 107 of file TcpSocket.h.


Constructor & Destructor Documentation

TcpSocket::OUTPUT::OUTPUT (  ) 

Definition at line 1802 of file TcpSocket.cpp.

01802                         : _b(0), _t(0), _q(0)
01803 {
01804 }

TcpSocket::OUTPUT::OUTPUT ( const char *  buf,
size_t  len 
)

Definition at line 1807 of file TcpSocket.cpp.

References _buf.

01807                                                    : _b(0), _t(len), _q(len)
01808 {
01809         memcpy(_buf, buf, len);
01810 }


Member Function Documentation

size_t TcpSocket::OUTPUT::Space (  ) 

Definition at line 1813 of file TcpSocket.cpp.

References _t, and TCP_OUTPUT_CAPACITY.

01814 {
01815         return TCP_OUTPUT_CAPACITY - _t;
01816 }

void TcpSocket::OUTPUT::Add ( const char *  buf,
size_t  len 
)

Definition at line 1819 of file TcpSocket.cpp.

References _buf, _q, and _t.

01820 {
01821         memcpy(_buf + _t, buf, len);
01822         _t += len;
01823         _q += len;
01824 }

size_t TcpSocket::OUTPUT::Remove ( size_t  len  ) 

Definition at line 1827 of file TcpSocket.cpp.

References _b, and _q.

01828 {
01829         _b += len;
01830         _q -= len;
01831         return _q;
01832 }

const char * TcpSocket::OUTPUT::Buf (  ) 

Definition at line 1835 of file TcpSocket.cpp.

References _b, and _buf.

01836 {
01837         return _buf + _b;
01838 }

size_t TcpSocket::OUTPUT::Len (  ) 

Definition at line 1841 of file TcpSocket.cpp.

References _q.

01842 {
01843         return _q;
01844 }


Member Data Documentation

Definition at line 116 of file TcpSocket.h.

Referenced by Buf(), and Remove().

Definition at line 117 of file TcpSocket.h.

Referenced by Add(), and Space().

Definition at line 118 of file TcpSocket.h.

Referenced by Add(), Len(), and Remove().

char TcpSocket::OUTPUT::_buf[TCP_OUTPUT_CAPACITY]

Definition at line 119 of file TcpSocket.h.

Referenced by Add(), Buf(), and OUTPUT().


The documentation for this struct was generated from the following files:
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4