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


Constructor & Destructor Documentation

TcpSocket::OUTPUT::OUTPUT (  ) 

Definition at line 1755 of file TcpSocket.cpp.

01755                         : _b(0), _t(0), _q(0)
01756 {
01757 }

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

Definition at line 1760 of file TcpSocket.cpp.

References _buf.

01760                                                    : _b(0), _t(len), _q(len)
01761 {
01762         memcpy(_buf, buf, len);
01763 }


Member Function Documentation

size_t TcpSocket::OUTPUT::Space (  ) 

Definition at line 1766 of file TcpSocket.cpp.

References _t, and TCP_OUTPUT_CAPACITY.

01767 {
01768         return TCP_OUTPUT_CAPACITY - _t;
01769 }

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

Definition at line 1772 of file TcpSocket.cpp.

References _buf, _q, and _t.

01773 {
01774         memcpy(_buf + _t, buf, len);
01775         _t += len;
01776         _q += len;
01777 }

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

Definition at line 1780 of file TcpSocket.cpp.

References _b, and _q.

01781 {
01782         _b += len;
01783         _q -= len;
01784         return _q;
01785 }

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

Definition at line 1788 of file TcpSocket.cpp.

References _b, and _buf.

01789 {
01790         return _buf + _b;
01791 }

size_t TcpSocket::OUTPUT::Len (  ) 

Definition at line 1794 of file TcpSocket.cpp.

References _q.

01795 {
01796         return _q;
01797 }


Member Data Documentation

Definition at line 114 of file TcpSocket.h.

Referenced by Buf(), and Remove().

Definition at line 115 of file TcpSocket.h.

Referenced by Add(), and Space().

Definition at line 116 of file TcpSocket.h.

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

char TcpSocket::OUTPUT::_buf[TCP_OUTPUT_CAPACITY]

Definition at line 117 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