Loading...
Searching...
No Matches
Socketbuf.h
Go to the documentation of this file.
// -*- c++ -*-
//------------------------------------------------------------------------------
// $Id: Socketbuf.h,v 1.3 2005/10/08 02:42:00 vlg Exp $
//------------------------------------------------------------------------------
// Socketbuf.h
//------------------------------------------------------------------------------
// Copyright (C) 1997-2002 Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
#ifndef SOCKET_BUF_H
#define SOCKET_BUF_H
#include "assa/Streambuf.h"
namespace ASSA {
class Socket;
class Socketbuf : public Streambuf
{
public:
Socketbuf (Socket* s_);
virtual ~Socketbuf ();
protected:
virtual int sync ();
virtual int underflow ();
virtual int overflow (int c_ = EOF);
virtual int showmanyc ();
virtual int doallocate ();
private:
int flush_output ();
int sys_read (char* b_, int len_);
int sys_write (char* b_, int len_);
void xput_char (char c_);
private:
Socket* m_s;
};
} // end namespace ASSA
#endif /* SOCKET_BUF_H */
Streambuf.h
Streambuf class is based on Standard C++ iostream streambuf class.
ASSA::AutoPtrRef
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
ASSA::Socket
Definition Socket.h:71
ASSA::Socketbuf
Definition Socketbuf.h:30
ASSA::Socketbuf::flush_output
int flush_output()
Definition Socketbuf.cpp:192
ASSA::Socketbuf::~Socketbuf
virtual ~Socketbuf()
Definition Socketbuf.cpp:59
ASSA::Socketbuf::overflow
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
ASSA::Socketbuf::m_s
Socket * m_s
Reference to the Socket stream.
Definition Socketbuf.h:51
ASSA::Socketbuf::showmanyc
virtual int showmanyc()
The morphemes of showmanyc are "es-how-many-see", not "show-man-ic".
Definition Socketbuf.cpp:43
ASSA::Socketbuf::sys_read
int sys_read(char *b_, int len_)
Definition Socketbuf.cpp:67
ASSA::Socketbuf::doallocate
virtual int doallocate()
This function is called by allocate when unbuffered() is zero and base() is zero.
Definition Socketbuf.cpp:226
ASSA::Socketbuf::sys_write
int sys_write(char *b_, int len_)
Definition Socketbuf.cpp:86
ASSA::Socketbuf::xput_char
void xput_char(char c_)
Definition Socketbuf.cpp:51
ASSA::Socketbuf::underflow
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
ASSA::Socketbuf::sync
virtual int sync()
This function synchronizes the streambuf with its actual stream of characters.
Definition Socketbuf.cpp:35
ASSA::Streambuf
Streambuf class.
Definition Streambuf.h:91
ASSA
Definition Acceptor.h:40