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 1817 of file TcpSocket.cpp.

01817                         : _b(0), _t(0), _q(0)
01818 {
01819 }

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

Definition at line 1822 of file TcpSocket.cpp.

References _buf.

01822                                                    : _b(0), _t(len), _q(len)
01823 {
01824         memcpy(_buf, buf, len);
01825 }


Member Function Documentation

size_t TcpSocket::OUTPUT::Space (  ) 

Definition at line 1828 of file TcpSocket.cpp.

References _t, and TCP_OUTPUT_CAPACITY.

01829 {
01830         return TCP_OUTPUT_CAPACITY - _t;
01831 }

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

Definition at line 1834 of file TcpSocket.cpp.

References _buf, _q, and _t.

01835 {
01836         memcpy(_buf + _t, buf, len);
01837         _t += len;
01838         _q += len;
01839 }

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

Definition at line 1842 of file TcpSocket.cpp.

References _b, and _q.

01843 {
01844         _b += len;
01845         _q -= len;
01846         return _q;
01847 }

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

Definition at line 1850 of file TcpSocket.cpp.

References _b, and _buf.

01851 {
01852         return _buf + _b;
01853 }

size_t TcpSocket::OUTPUT::Len (  ) 

Definition at line 1856 of file TcpSocket.cpp.

References _q.

01857 {
01858         return _q;
01859 }


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