#include <buffered_stream.hh>
Inheritance diagram for atoms::BufferedStreamFilter:


If you wrap a raw stream in this way, you must be careful to not confuse the buffering:
Definition at line 331 of file buffered_stream.hh.
Public Member Functions | |
| bool | isOpen () const |
| bool | isClosed () const |
| bool | isReadable () const |
| bool | isWritable () const |
| void | flushOnce (const boost::shared_ptr< IOPoller > &poller, const boost::function< void()> &onSuccess, const boost::function< void(const IOError &)> &onError) |
| Flushes the output buffer asynchronously. | |
| virtual void | pollForReadAvailability (const boost::shared_ptr< IOPoller > &, const boost::function< void()> &, const boost::function< void(const IOError &)> &) |
| Notifies via a callback when it becomes possible to read. | |
| virtual void | readOnce (void *buf, size_t min, size_t max, const boost::shared_ptr< IOPoller > &, const boost::function< void(int)> &, const boost::function< void(const IOError &)> &) |
| Reads data from the stream asynchronously. | |
| bool | usingAutoflush () const |
| Returns true iff the stream will be automatically flushed on read. | |
| void | setAutoflush (bool autoflush) |
| Sets if the output buffer should be flushed on any read. | |
| Endian | getEndian () const |
| Gets the endianness. | |
| void | setEndian (Endian e) |
| Sets the endianness. | |
| virtual size_t | read (void *buf, size_t min, size_t max=0)=0 |
| Reads data from the stream. | |
| virtual void | write (const void *buf, size_t size)=0 |
| Writes data to the stream. | |
| virtual bool | flush ()=0 |
| Attempts to flush the output buffer. | |
| void | setLocale (const std::locale &l) |
| Sets the locale to use for character encoding conversion. | |
| virtual bool | isSeekable () const=0 |
| BufferedStream & | operator>> (uint8_t &t) |
| BufferedStream & | operator>> (int8_t &t) |
| BufferedStream & | operator>> (uint16_t &t) |
| BufferedStream & | operator>> (int16_t &t) |
| BufferedStream & | operator>> (uint32_t &t) |
| BufferedStream & | operator>> (int32_t &t) |
| BufferedStream & | operator>> (uint64_t &t) |
| BufferedStream & | operator>> (int64_t &t) |
| BufferedStream & | operator<< (uint8_t t) |
| BufferedStream & | operator<< (int8_t t) |
| BufferedStream & | operator<< (uint16_t t) |
| BufferedStream & | operator<< (int16_t t) |
| BufferedStream & | operator<< (uint32_t t) |
| BufferedStream & | operator<< (int32_t t) |
| BufferedStream & | operator<< (uint64_t t) |
| BufferedStream & | operator<< (int64_t t) |
| virtual BufferedStream & | operator<< (const char *)=0 |
| virtual BufferedStream & | operator<< (const std::basic_string< char > &)=0 |
| virtual BufferedStream & | operator<< (const std::basic_string< wchar_t > &)=0 |
Static Public Member Functions | |
| boost::shared_ptr< BufferedStreamFilter > | create (const boost::shared_ptr< Stream > &) |
| Returns either a SeekableBufferedStreamFilter or a NonseekableBufferedStreamFilter based on the stream. | |
Protected Member Functions | |
| BufferedStreamFilter (const boost::shared_ptr< Stream > &s) | |
Protected Attributes | |
| boost::shared_ptr< Stream > | s |
| The raw stream we're buffering. | |
| bool | autoflush |
| If the stream should be automatically flushed on read. | |
| std::locale | locale |
| std::mbstate_t | state |
| Endian | endian |
| The endianness for input and output of binary arithmetic types. | |
| boost::weak_ptr< IOHandle > | thisWeak |
| A weak pointer to 'this' for source in IOError. | |
Private Member Functions | |
| void | tryFlush (bool polling, const boost::shared_ptr< IOPoller > &poller, const boost::function< void()> &onSuccess, const boost::function< void(const IOError &)> &onError) |
| Part of the implementation of flushOnce. | |
| void | pollForReadAvailability2 (const boost::shared_ptr< IOPoller > &, const boost::function< void()> &, const boost::function< void(const IOError &)> &) |
| void | tryRead (const boost::shared_ptr< ReadRequest > &) |
| Part of the implementation of tryRead. | |
Static Private Attributes | |
| DebugLogger | LOGGER |
|
|
Definition at line 333 of file buffered_stream.hh. |
|
|
Returns either a SeekableBufferedStreamFilter or a NonseekableBufferedStreamFilter based on the stream.
Definition at line 31 of file buffered_stream.cc. References atoms::NonseekableBufferedStreamFilter(). |
Here is the call graph for this function:

|
|
Attempts to flush the output buffer. If the buffer can not be flushed successfully, an exception will be thrown, unless the error is due to non-blocking IO.
Referenced by tryFlush(). |
|
||||||||||||||||
|
Flushes the output buffer asynchronously.
Implements atoms::BufferedStream. Definition at line 348 of file buffered_stream.hh. Referenced by pollForReadAvailability(). |
|
|
Gets the endianness.
Defaults to Definition at line 73 of file buffered_stream.hh. |
|
|
Implements atoms::BufferedStream. Definition at line 344 of file buffered_stream.hh. |
|
|
Implements atoms::BufferedStream. Definition at line 343 of file buffered_stream.hh. |
|
|
Implements atoms::BufferedStream. Definition at line 345 of file buffered_stream.hh. |
|
|
|
|
|
Implements atoms::BufferedStream. Definition at line 346 of file buffered_stream.hh. |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 192 of file buffered_stream.hh. |
|
|
Definition at line 191 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 190 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 189 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 188 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 187 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 186 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 185 of file buffered_stream.hh. References atoms::BufferedStream::writeIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 163 of file buffered_stream.hh. |
|
|
Definition at line 162 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 161 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 160 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 159 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 158 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 157 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
|
Definition at line 156 of file buffered_stream.hh. References atoms::BufferedStream::readIntegralType(). |
Here is the call graph for this function:

|
||||||||||||||||
|
Notifies via a callback when it becomes possible to read. Honors autoflush first. Implements atoms::BufferedStream. Definition at line 71 of file buffered_stream.cc. References flushOnce(). Referenced by readOnce(). |
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 84 of file buffered_stream.cc. References atoms::UNIXDescriptor::pollForReadAvailability(), and s. |
Here is the call graph for this function:

|
||||||||||||||||
|
Reads data from the stream.
If
Referenced by tryRead(). |
|
||||||||||||||||||||||||||||
|
Reads data from the stream asynchronously. This is similar to read(void*,size_t,size_t), but automatically registers the stream with a poller to arrange for the callback when complete.
Implements atoms::BufferedStream. Definition at line 96 of file buffered_stream.cc. References std::max(), std::min(), and pollForReadAvailability(). |
Here is the call graph for this function:

|
|
Sets if the output buffer should be flushed on any read.
Definition at line 64 of file buffered_stream.hh. |
|
|
Sets the endianness.
Defaults to Definition at line 79 of file buffered_stream.hh. References atoms::BufferedStream::endian. |
|
|
Sets the locale to use for character encoding conversion. Defaults to the global locale at time of BufferedStream creation.
Definition at line 245 of file buffered_stream.hh. |
|
||||||||||||||||||||
|
Part of the implementation of flushOnce.
Definition at line 43 of file buffered_stream.cc. References atoms::UNIXDescriptor::cancelPoll(), atoms::BufferedStream::flush(), atoms::UNIXDescriptor::pollForWriteAvailability(), and s. |
Here is the call graph for this function:

|
|
Part of the implementation of tryRead.
Definition at line 113 of file buffered_stream.cc. References atoms::BufferedStream::read(). |
Here is the call graph for this function:

|
|
Returns true iff the stream will be automatically flushed on read.
Definition at line 52 of file buffered_stream.hh. References atoms::BufferedStream::autoflush. |
|
||||||||||||
|
Writes data to the stream. No data are written until the next time flush() succeeds. Never throws IOError.
|
|
|
If the stream should be automatically flushed on read.
Definition at line 275 of file buffered_stream.hh. Referenced by atoms::BufferedStream::usingAutoflush(). |
|
|
The endianness for input and output of binary arithmetic types.
Definition at line 291 of file buffered_stream.hh. Referenced by atoms::BufferedStream::BufferedStream(), and atoms::BufferedStream::setEndian(). |
|
|
Definition at line 287 of file buffered_stream.hh. |
|
|
|
|
|
The raw stream we're buffering.
Definition at line 366 of file buffered_stream.hh. Referenced by pollForReadAvailability2(), and tryFlush(). |
|
|
Definition at line 288 of file buffered_stream.hh. |
|
|
A weak pointer to 'this' for source in IOError.
|
1.3.5