library of assembled shared sources |
http://lass.cocamware.com |
#include <binary_o_socket.h>
Public Member Functions | |
BinaryOSocket (Socket &iSocket, std::size_t iBufferSize=1024, unsigned long iFlushPeriod=100) | |
~BinaryOSocket () | |
long | tellp () const |
BinaryOStream & | seekp (long position) |
BinaryOStream & | seekp (long offset, std::ios_base::seekdir direction) |
void | flush () |
BinaryOStream & | operator<< (char x) |
BinaryOStream & | operator<< (num::Tint8 x) |
BinaryOStream & | operator<< (num::Tuint8 x) |
BinaryOStream & | operator<< (num::Tint16 x) |
BinaryOStream & | operator<< (num::Tuint16 x) |
BinaryOStream & | operator<< (num::Tint32 x) |
BinaryOStream & | operator<< (num::Tuint32 x) |
BinaryOStream & | operator<< (num::Tint64 x) |
BinaryOStream & | operator<< (num::Tuint64 x) |
BinaryOStream & | operator<< (num::Tfloat32 x) |
BinaryOStream & | operator<< (num::Tfloat64 x) |
BinaryOStream & | operator<< (bool x) |
BinaryOStream & | operator<< (const void *x) |
BinaryOStream & | operator<< (const char *x) |
BinaryOStream & | operator<< (const std::string &x) |
template<typename T > | |
BinaryOStream & | operator<< (const std::vector< T > &x) |
template<typename T > | |
BinaryOStream & | operator<< (const std::complex< T > &x) |
void | write (const void *buffer, size_t byteLength) |
write a buffer of bytes to the stream | |
num::Endianness | endianness () const |
void | setEndianness (num::Endianness iEndianness) |
const bool | good () const |
const bool | eof () const |
const bool | fail () const |
const bool | bad () const |
std::ios_base::iostate | rdstate () const |
void | clear (std::ios_base::iostate iState=std::ios_base::goodbit) |
void | setstate (std::ios_base::iostate iState) |
operator num::SafeBool () const | |
const bool | operator! () const |
Protected Member Functions | |
void | swap (NonCopyable &) |
Private Types | |
typedef std::vector< char > | TBuffer |
Private Member Functions | |
long | doTellp () const |
void | doSeekp (long iOffset, std::ios_base::seekdir iDirection) |
void | doWrite (const void *iBytes, size_t iNumberOfBytes) |
write a buffer of bytes to the stream | |
void | doFlush () |
void | flusher () |
Private Attributes | |
Socket & | socket_ |
TBuffer | buffer_ |
std::size_t | bufferSize_ |
std::size_t | current_ |
util::Semaphore | bufferLock_ |
util::Condition | flushCondition_ |
util::ScopedPtr< util::Thread > | flushThread_ |
unsigned long | flushPeriod_ |
volatile bool | stopFlushThread_ |
Definition at line 62 of file binary_o_socket.h.
typedef std::vector<char> lass::io::BinaryOSocket::TBuffer [private] |
Definition at line 72 of file binary_o_socket.h.
lass::io::BinaryOSocket::BinaryOSocket | ( | Socket & | iSocket, | |
std::size_t | iBufferSize = 1024 , |
|||
unsigned long | iFlushPeriod = 100 | |||
) |
lass::io::BinaryOSocket::~BinaryOSocket | ( | ) |
Definition at line 72 of file binary_o_socket.cpp.
References flushCondition_, flushThread_, lass::util::Condition::signal(), and stopFlushThread_.
long lass::io::BinaryOSocket::doTellp | ( | ) | const [private, virtual] |
Implements lass::io::BinaryOStream.
Definition at line 83 of file binary_o_socket.cpp.
References LASS_THROW.
void lass::io::BinaryOSocket::doSeekp | ( | long | iOffset, | |
std::ios_base::seekdir | iDirection | |||
) | [private, virtual] |
Implements lass::io::BinaryOStream.
Definition at line 90 of file binary_o_socket.cpp.
References LASS_THROW.
void lass::io::BinaryOSocket::doWrite | ( | const void * | iBegin, | |
size_t | iNumberOfBytes | |||
) | [private, virtual] |
write a buffer of bytes to the stream
Implements lass::io::BinaryOStream.
Definition at line 108 of file binary_o_socket.cpp.
References buffer_, bufferLock_, bufferSize_, current_, flushCondition_, lass::io::StreamBase::good(), LASS_ASSERT, LASS_LOCK, and lass::util::Condition::signal().
void lass::io::BinaryOSocket::doFlush | ( | ) | [private, virtual] |
Implements lass::io::BinaryOStream.
Definition at line 97 of file binary_o_socket.cpp.
References flushCondition_, and lass::util::Condition::signal().
void lass::io::BinaryOSocket::flusher | ( | ) | [private] |
Definition at line 145 of file binary_o_socket.cpp.
References buffer_, bufferLock_, current_, flushCondition_, flushPeriod_, LASS_ASSERT, LASS_LOCK, lass::io::Socket::send(), lass::io::StreamBase::setstate(), socket_, stopFlushThread_, and lass::util::Condition::wait().
long lass::io::BinaryOStream::tellp | ( | ) | const [inherited] |
BinaryOStream & lass::io::BinaryOStream::seekp | ( | long | position | ) | [inherited] |
Definition at line 79 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::doSeekp().
Referenced by lass::io::Image::HeaderIgi::writeTo().
BinaryOStream & lass::io::BinaryOStream::seekp | ( | long | offset, | |
std::ios_base::seekdir | direction | |||
) | [inherited] |
void lass::io::BinaryOStream::flush | ( | ) | [inherited] |
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | char | x | ) | [inherited] |
Definition at line 102 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tint8 | x | ) | [inherited] |
Definition at line 109 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tuint8 | x | ) | [inherited] |
Definition at line 116 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tint16 | x | ) | [inherited] |
Definition at line 123 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tuint16 | x | ) | [inherited] |
Definition at line 130 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tint32 | x | ) | [inherited] |
Definition at line 137 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tuint32 | x | ) | [inherited] |
Definition at line 144 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tint64 | x | ) | [inherited] |
Definition at line 151 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tuint64 | x | ) | [inherited] |
Definition at line 158 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tfloat32 | x | ) | [inherited] |
Definition at line 165 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | num::Tfloat64 | x | ) | [inherited] |
Definition at line 172 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeValue().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | bool | x | ) | [inherited] |
Definition at line 179 of file binary_o_stream.cpp.
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | const void * | x | ) | [inherited] |
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | const char * | x | ) | [inherited] |
Definition at line 194 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeString().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | const std::string & | x | ) | [inherited] |
Definition at line 201 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::writeString().
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | const std::vector< T > & | x | ) | [inline, inherited] |
BinaryOStream & lass::io::BinaryOStream::operator<< | ( | const std::complex< T > & | x | ) | [inline, inherited] |
Definition at line 79 of file binary_o_stream.inl.
void lass::io::BinaryOStream::write | ( | const void * | bytes, | |
size_t | numBytes | |||
) | [inherited] |
write a buffer of bytes to the stream
bytes | pointer to buffer. | |
numBytes | length of buffer in bytes. |
Definition at line 212 of file binary_o_stream.cpp.
References lass::io::BinaryOStream::doWrite().
Referenced by lass::io::Image::saveRadianceHdr(), lass::io::Image::saveTarga(), lass::io::Image::writeLine(), and lass::io::Image::HeaderRadianceHdr::writeTo().
num::Endianness lass::io::BinaryStreamBase::endianness | ( | ) | const [inline, inherited] |
Definition at line 75 of file binary_stream_base.h.
Referenced by lass::io::BinaryIStream::readValue(), and lass::io::BinaryOStream::writeValue().
void lass::io::BinaryStreamBase::setEndianness | ( | num::Endianness | iEndianness | ) | [inline, inherited] |
Definition at line 76 of file binary_stream_base.h.
Referenced by lass::io::EndiannessSetter::EndiannessSetter(), and lass::io::EndiannessSetter::~EndiannessSetter().
const bool lass::io::StreamBase::good | ( | ) | const [inline, inherited] |
Definition at line 76 of file stream_base.h.
Referenced by lass::io::BinaryOFile::doFlush(), lass::io::BinaryISocket::doRead(), lass::io::BinaryIMemoryMap::doRead(), lass::io::BinaryIMemoryBlock::doRead(), lass::io::BinaryIFile::doRead(), lass::io::BinaryIMemoryMap::doSeekg(), doWrite(), lass::io::BinaryOFile::doWrite(), lass::io::Image::open(), lass::io::BinaryOFile::open(), lass::io::BinaryIStream::operator>>(), lass::io::Image::HeaderPfm::readFrom(), lass::io::Image::HeaderRadianceHdr::readFrom(), lass::io::Image::readLine(), lass::io::BinaryIStream::readValue(), and lass::io::Image::save().
const bool lass::io::StreamBase::eof | ( | ) | const [inline, inherited] |
Definition at line 77 of file stream_base.h.
Referenced by lass::io::Image::open(), and lass::io::Image::save().
const bool lass::io::StreamBase::fail | ( | ) | const [inline, inherited] |
Definition at line 78 of file stream_base.h.
Referenced by lass::io::StreamBase::operator num::SafeBool().
const bool lass::io::StreamBase::bad | ( | ) | const [inline, inherited] |
Definition at line 79 of file stream_base.h.
std::ios_base::iostate lass::io::StreamBase::rdstate | ( | ) | const [inline, inherited] |
void lass::io::StreamBase::clear | ( | std::ios_base::iostate | iState = std::ios_base::goodbit |
) | [inline, inherited] |
Definition at line 81 of file stream_base.h.
Referenced by lass::io::XmlOFile::close(), lass::io::XmlOFile::open(), and lass::io::XmlOElement::XmlOElement().
void lass::io::StreamBase::setstate | ( | std::ios_base::iostate | iState | ) | [inline, inherited] |
Definition at line 82 of file stream_base.h.
Referenced by lass::io::BinaryOFile::close(), lass::io::BinaryIFile::close(), lass::io::BinaryOFile::doFlush(), lass::io::BinaryISocket::doRead(), lass::io::BinaryIMemoryMap::doRead(), lass::io::BinaryIMemoryBlock::doRead(), lass::io::BinaryIFile::doRead(), lass::io::BinaryIMemoryMap::doSeekg(), lass::io::BinaryIFile::doSeekg(), lass::io::BinaryOFile::doSeekp(), lass::io::BinaryOFile::doWrite(), flusher(), lass::io::BinaryOFile::open(), lass::io::BinaryIMemoryMap::open(), and lass::io::BinaryIFile::open().
lass::io::StreamBase::operator num::SafeBool | ( | ) | const [inline, inherited] |
Definition at line 83 of file stream_base.h.
References lass::io::StreamBase::fail(), lass::num::safeFalse, and lass::num::safeTrue.
const bool lass::io::StreamBase::operator! | ( | ) | const [inline, inherited] |
Definition at line 84 of file stream_base.h.
void lass::util::NonCopyable::swap | ( | NonCopyable & | ) | [inline, protected, inherited] |
Socket& lass::io::BinaryOSocket::socket_ [private] |
TBuffer lass::io::BinaryOSocket::buffer_ [private] |
std::size_t lass::io::BinaryOSocket::bufferSize_ [private] |
std::size_t lass::io::BinaryOSocket::current_ [private] |
Definition at line 86 of file binary_o_socket.h.
Referenced by doFlush(), doWrite(), flusher(), and ~BinaryOSocket().
unsigned long lass::io::BinaryOSocket::flushPeriod_ [private] |
volatile bool lass::io::BinaryOSocket::stopFlushThread_ [private] |
Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by 1.5.7.1 |