libassa  3.5.1
Socketbuf.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //------------------------------------------------------------------------------
3 // $Id: Socketbuf.h,v 1.3 2005/10/08 02:42:00 vlg Exp $
4 //------------------------------------------------------------------------------
5 // Socketbuf.h
6 //------------------------------------------------------------------------------
7 // Copyright (C) 1997-2002 Vladislav Grinchenko
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Library General Public
11 // License as published by the Free Software Foundation; either
12 // version 2 of the License, or (at your option) any later version.
13 //------------------------------------------------------------------------------
14 #ifndef SOCKET_BUF_H
15 #define SOCKET_BUF_H
16 
17 #include "assa/Streambuf.h"
18 
19 namespace ASSA {
20 
27 class Socket;
28 
29 class Socketbuf : public Streambuf
30 {
31 public:
32  Socketbuf (Socket* s_);
33  virtual ~Socketbuf ();
34 
35 protected:
36  virtual int sync ();
37  virtual int underflow ();
38  virtual int overflow (int c_ = EOF);
39  virtual int showmanyc ();
40  virtual int doallocate ();
41 
42 private:
43  int flush_output ();
44  int sys_read (char* b_, int len_);
45  int sys_write (char* b_, int len_);
46  void xput_char (char c_);
47 
48 private:
52 };
53 
54 } // end namespace ASSA
55 
56 #endif /* SOCKET_BUF_H */
Streambuf class is based on Standard C++ iostream streambuf class.
virtual ~Socketbuf()
Definition: Socketbuf.cpp:59
virtual int overflow(int c_=EOF)
This function is called to consume characters (flush them to output), typically when the put area is ...
Definition: Socketbuf.cpp:162
Socket * m_s
Reference to the Socket stream.
Definition: Socketbuf.h:51
virtual int showmanyc()
The morphemes of showmanyc are "es-how-many-see", not "show-man-ic".
Definition: Socketbuf.cpp:43
int sys_read(char *b_, int len_)
Definition: Socketbuf.cpp:67
virtual int doallocate()
This function is called by allocate when unbuffered() is zero and base() is zero.
Definition: Socketbuf.cpp:226
int sys_write(char *b_, int len_)
Definition: Socketbuf.cpp:86
Socketbuf(Socket *s_)
Definition: Socketbuf.cpp:25
void xput_char(char c_)
Definition: Socketbuf.cpp:51
virtual int underflow()
This function is called to supply characters for input (from some source) when the get area is empty,...
Definition: Socketbuf.cpp:105
virtual int sync()
This function synchronizes the streambuf with its actual stream of characters.
Definition: Socketbuf.cpp:35
Streambuf class.
Definition: Streambuf.h:91
Definition: Acceptor.h:40