Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

basic_netbuf< charT, traits > Class Template Reference

#include <netstream.h>

Inheritance diagram for basic_netbuf< charT, traits >:

Detailed Description

template<class charT, class traits = std::char_traits<charT>>
class basic_netbuf< charT, traits >

Definition at line 103 of file netstream.h.

List of all members.

Classes

struct  SetScope
 this allows us to reset status variables like openInProgress if a thread cancel occurs More...

Public Types

typedef charT char_type
typedef traits::int_type int_type
typedef traits::pos_type pos_type
typedef traits::off_type off_type
typedef traits traits_type

Public Member Functions

 basic_netbuf ()
 basic_netbuf (const IPaddr &addr, bool datagram=false)
 basic_netbuf (const IPaddr::ipname_t &host, const IPaddr::ipport_t port, bool datagram=false)
 basic_netbuf (size_t buf_in_size, size_t buf_out_size)
virtual ~basic_netbuf ()
virtual bool open (const IPaddr &addr, bool datagram=false)
virtual bool open (const IPaddr::ipname_t &str, bool datagram=false)
virtual bool open (const IPaddr::ipname_t &ahost, unsigned int aPort, bool datagram=false)
virtual bool listen (unsigned int aPort, bool datagram=false)
virtual bool listen (const IPaddr &addr, bool datagram=false)
virtual bool is_connecting () const
virtual bool is_open () const
virtual void update_status ()
virtual void close ()
virtual void reset ()
virtual int adoptFD (int fd)
virtual void setReconnect (bool doReconnect)
virtual bool getReconnect () const
virtual void setEcho (bool val=true)
virtual bool getEcho ()
virtual const IPaddrgetPeerAddress () const
virtual const IPaddrgetLocalAddress () const
virtual void in_sync ()
virtual void out_flush ()

Protected Member Functions

virtual void reconnect ()
void Init ()
void Init (size_t insize, size_t outsize)
basic_netbufrdbuf ()
virtual std::streamsize showmanyc ()
virtual int_type underflow ()
virtual int_type uflow ()
virtual int_type overflow (int_type c=traits::eof())
virtual pos_type seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
virtual pos_type seekpos (pos_type sp, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
virtual int sync ()

Static Protected Member Functions

static void printBuffer (const char *buf, int buflen, const char *header, const char *prefix)

Protected Attributes

charT * buf_in
charT * buf_out
bool using_buf_in
bool using_buf_out
int sock
bool openInProgress
bool canRead
bool canWrite
bool is_echoing
bool autoReconnect
bool sockFromServer
IPaddr peerAddress
IPaddr localAddress
IPaddr tgtAddress
bool isDatagram

Static Protected Attributes

static const int INVALID_SOCKET = -1
static const size_t def_buf_in_size = (1<<14)-28
static const size_t def_buf_out_size = (1<<14)-28

Private Member Functions

 basic_netbuf (const basic_netbuf &)
basic_netbufoperator= (const basic_netbuf &)
 assignment, don't call

Friends

class netstream_server

Member Typedef Documentation

template<class charT , class traits = std::char_traits<charT>>
typedef charT basic_netbuf< charT, traits >::char_type

Definition at line 107 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
typedef traits::int_type basic_netbuf< charT, traits >::int_type

Definition at line 108 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
typedef traits::off_type basic_netbuf< charT, traits >::off_type

Definition at line 110 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
typedef traits::pos_type basic_netbuf< charT, traits >::pos_type

Definition at line 109 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
typedef traits basic_netbuf< charT, traits >::traits_type

Definition at line 111 of file netstream.h.


Constructor & Destructor Documentation

template<class charT , class traits >
basic_netbuf< charT, traits >::basic_netbuf (  ) 

Definition at line 394 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::basic_netbuf ( const IPaddr addr,
bool  datagram = false 
)

Definition at line 401 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::basic_netbuf ( const IPaddr::ipname_t host,
const IPaddr::ipport_t  port,
bool  datagram = false 
)

Definition at line 410 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::basic_netbuf ( size_t  buf_in_size,
size_t  buf_out_size 
)

Definition at line 419 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::~basic_netbuf (  )  [virtual]

Definition at line 427 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
basic_netbuf< charT, traits >::basic_netbuf ( const basic_netbuf< charT, traits > &   )  [private]

Member Function Documentation

template<class charT , class traits = std::char_traits<charT>>
virtual int basic_netbuf< charT, traits >::adoptFD ( int  fd  )  [virtual]

Definition at line 134 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual bool basic_netbuf< charT, traits >::getEcho (  )  [virtual]

Definition at line 140 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual const IPaddr& basic_netbuf< charT, traits >::getLocalAddress (  )  const [virtual]

Definition at line 143 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual const IPaddr& basic_netbuf< charT, traits >::getPeerAddress (  )  const [virtual]

Definition at line 142 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual bool basic_netbuf< charT, traits >::getReconnect (  )  const [virtual]

Definition at line 137 of file netstream.h.

template<class charT , class traits >
void basic_netbuf< charT, traits >::in_sync (  )  [virtual]
template<class charT , class traits >
void basic_netbuf< charT, traits >::Init ( size_t  insize,
size_t  outsize 
) [protected]

Definition at line 441 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
void basic_netbuf< charT, traits >::Init (  )  [protected]
template<class charT , class traits = std::char_traits<charT>>
virtual bool basic_netbuf< charT, traits >::is_connecting (  )  const [virtual]

Definition at line 128 of file netstream.h.

template<class charT , class traits >
bool basic_netbuf< charT, traits >::listen ( const IPaddr addr,
bool  datagram = false 
) [virtual]

Definition at line 607 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual bool basic_netbuf< charT, traits >::listen ( unsigned int  aPort,
bool  datagram = false 
) [virtual]
template<class charT , class traits = std::char_traits<charT>>
virtual bool basic_netbuf< charT, traits >::open ( const IPaddr::ipname_t ahost,
unsigned int  aPort,
bool  datagram = false 
) [virtual]

Definition at line 125 of file netstream.h.

Referenced by basic_netbuf< charT, traits >::open().

template<class charT , class traits >
bool basic_netbuf< charT, traits >::open ( const IPaddr::ipname_t str,
bool  datagram = false 
) [virtual]

Definition at line 715 of file netstream.h.

template<class charT , class traits >
bool basic_netbuf< charT, traits >::open ( const IPaddr addr,
bool  datagram = false 
) [virtual]
template<class charT , class traits = std::char_traits<charT>>
basic_netbuf& basic_netbuf< charT, traits >::operator= ( const basic_netbuf< charT, traits > &   )  [private]

assignment, don't call

template<class charT , class traits >
void basic_netbuf< charT, traits >::out_flush (  )  [virtual]
template<class charT , class traits >
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::overflow ( int_type  c = traits::eof()  )  [protected, virtual]

Definition at line 906 of file netstream.h.

template<class charT , class traits >
void basic_netbuf< charT, traits >::printBuffer ( const char *  buf,
int  buflen,
const char *  header,
const char *  prefix 
) [static, protected]
template<class charT , class traits = std::char_traits<charT>>
basic_netbuf* basic_netbuf< charT, traits >::rdbuf (  )  [protected]

Definition at line 150 of file netstream.h.

template<class charT , class traits >
void basic_netbuf< charT, traits >::reconnect (  )  [protected, virtual]
template<class charT , class traits = std::char_traits<charT>>
virtual void basic_netbuf< charT, traits >::reset (  )  [virtual]

Definition at line 132 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::pos_type basic_netbuf< charT, traits >::seekoff ( off_type  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  which = std::ios_base::in | std::ios_base::out 
) [protected, virtual]

Definition at line 925 of file netstream.h.

Referenced by basic_netbuf< charT, traits >::seekpos().

template<class charT , class traits = std::char_traits<charT>>
virtual pos_type basic_netbuf< charT, traits >::seekpos ( pos_type  sp,
std::ios_base::openmode  which = std::ios_base::in | std::ios_base::out 
) [protected, virtual]

Definition at line 183 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual void basic_netbuf< charT, traits >::setEcho ( bool  val = true  )  [virtual]

Definition at line 139 of file netstream.h.

template<class charT , class traits = std::char_traits<charT>>
virtual void basic_netbuf< charT, traits >::setReconnect ( bool  doReconnect  )  [virtual]

Definition at line 136 of file netstream.h.

template<class charT , class traits >
std::streamsize basic_netbuf< charT, traits >::showmanyc (  )  [protected, virtual]

Definition at line 873 of file netstream.h.

template<class charT , class traits >
int basic_netbuf< charT, traits >::sync (  )  [protected, virtual]

Definition at line 965 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::uflow (  )  [protected, virtual]

Definition at line 893 of file netstream.h.

template<class charT , class traits >
basic_netbuf< charT, traits >::int_type basic_netbuf< charT, traits >::underflow (  )  [protected, virtual]

Definition at line 883 of file netstream.h.

template<class charT , class traits >
void basic_netbuf< charT, traits >::update_status (  )  [virtual]

Friends And Related Function Documentation

template<class charT , class traits = std::char_traits<charT>>
friend class netstream_server [friend]

Definition at line 104 of file netstream.h.


Member Data Documentation

template<class charT , class traits = std::char_traits<charT>>
charT* basic_netbuf< charT, traits >::buf_in [protected]
template<class charT , class traits = std::char_traits<charT>>
charT * basic_netbuf< charT, traits >::buf_out [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::canRead [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::canWrite [protected]

Definition at line 205 of file netstream.h.

Referenced by basic_netbuf< charT, traits >::update_status().

template<class charT , class traits = std::char_traits<charT>>
const size_t basic_netbuf< charT, traits >::def_buf_in_size = (1<<14)-28 [static, protected]

Definition at line 200 of file netstream.h.

Referenced by basic_netbuf< charT, traits >::Init().

template<class charT , class traits = std::char_traits<charT>>
const size_t basic_netbuf< charT, traits >::def_buf_out_size = (1<<14)-28 [static, protected]

Definition at line 201 of file netstream.h.

Referenced by basic_netbuf< charT, traits >::Init().

template<class charT , class traits = std::char_traits<charT>>
const int basic_netbuf< charT, traits >::INVALID_SOCKET = -1 [static, protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::is_echoing [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::isDatagram [protected]
template<class charT , class traits = std::char_traits<charT>>
IPaddr basic_netbuf< charT, traits >::localAddress [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::openInProgress [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::sockFromServer [protected]
template<class charT , class traits = std::char_traits<charT>>
IPaddr basic_netbuf< charT, traits >::tgtAddress [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::using_buf_in [protected]
template<class charT , class traits = std::char_traits<charT>>
bool basic_netbuf< charT, traits >::using_buf_out [protected]

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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:05 2016 by Doxygen 1.6.3