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 98 of file TcpSocket.h.


Constructor & Destructor Documentation

TcpSocket::OUTPUT::OUTPUT (  )  [inline]

Definition at line 99 of file TcpSocket.h.

00099 : _b(0), _t(0), _q(0) {}

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

Definition at line 100 of file TcpSocket.h.

00100                                                     : _b(0), _t(len), _q(len) {
00101                         memcpy(_buf, buf, len);
00102                 }


Member Function Documentation

size_t TcpSocket::OUTPUT::Space (  )  [inline]

Definition at line 103 of file TcpSocket.h.

References TCP_OUTPUT_CAPACITY.

00103                                {
00104                         return TCP_OUTPUT_CAPACITY - _t;
00105                 }

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

Definition at line 106 of file TcpSocket.h.

00106                                                       {
00107                         memcpy(_buf + _t, buf, len);
00108                         _t += len;
00109                         _q += len;
00110                 }

size_t TcpSocket::OUTPUT::Remove ( size_t  len  )  [inline]

Definition at line 111 of file TcpSocket.h.

00111                                           {
00112                         _b += len;
00113                         _q -= len;
00114                         return _q;
00115                 }

const char* TcpSocket::OUTPUT::Buf (  )  [inline]

Definition at line 116 of file TcpSocket.h.

00116                                   {
00117                         return _buf + _b;
00118                 }

size_t TcpSocket::OUTPUT::Len (  )  [inline]

Definition at line 119 of file TcpSocket.h.

00119                              {
00120                         return _q;
00121                 }


Member Data Documentation

Definition at line 122 of file TcpSocket.h.

Definition at line 123 of file TcpSocket.h.

Definition at line 124 of file TcpSocket.h.

char TcpSocket::OUTPUT::_buf[TCP_OUTPUT_CAPACITY]

Definition at line 125 of file TcpSocket.h.


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