library of assembled shared sources

http://lass.cocamware.com

lass::io::BinaryOSocket Class Reference

BinaryOStream to socket. More...

#include <binary_o_socket.h>

Inheritance diagram for lass::io::BinaryOSocket:

Inheritance graph
[legend]
Collaboration diagram for lass::io::BinaryOSocket:

Collaboration graph
[legend]

Public Member Functions

 BinaryOSocket (Socket &iSocket, std::size_t iBufferSize=1024, unsigned long iFlushPeriod=100)
 ~BinaryOSocket ()
long tellp () const
BinaryOStreamseekp (long position)
BinaryOStreamseekp (long offset, std::ios_base::seekdir direction)
void flush ()
BinaryOStreamoperator<< (char x)
BinaryOStreamoperator<< (num::Tint8 x)
BinaryOStreamoperator<< (num::Tuint8 x)
BinaryOStreamoperator<< (num::Tint16 x)
BinaryOStreamoperator<< (num::Tuint16 x)
BinaryOStreamoperator<< (num::Tint32 x)
BinaryOStreamoperator<< (num::Tuint32 x)
BinaryOStreamoperator<< (num::Tint64 x)
BinaryOStreamoperator<< (num::Tuint64 x)
BinaryOStreamoperator<< (num::Tfloat32 x)
BinaryOStreamoperator<< (num::Tfloat64 x)
BinaryOStreamoperator<< (bool x)
BinaryOStreamoperator<< (const void *x)
BinaryOStreamoperator<< (const char *x)
BinaryOStreamoperator<< (const std::string &x)
template<typename T >
BinaryOStreamoperator<< (const std::vector< T > &x)
template<typename T >
BinaryOStreamoperator<< (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

Socketsocket_
TBuffer buffer_
std::size_t bufferSize_
std::size_t current_
util::Semaphore bufferLock_
util::Condition flushCondition_
util::ScopedPtr< util::ThreadflushThread_
unsigned long flushPeriod_
volatile bool stopFlushThread_

Detailed Description

BinaryOStream to socket.

Definition at line 62 of file binary_o_socket.h.


Member Typedef Documentation

typedef std::vector<char> lass::io::BinaryOSocket::TBuffer [private]

Definition at line 72 of file binary_o_socket.h.


Constructor & Destructor Documentation

lass::io::BinaryOSocket::BinaryOSocket ( Socket iSocket,
std::size_t  iBufferSize = 1024,
unsigned long  iFlushPeriod = 100 
)

lass::io::BinaryOSocket::~BinaryOSocket (  ) 


Member Function Documentation

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

iIn pointer to buffer.
iBufferLength length of buffer in bytes.

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]

long lass::io::BinaryOStream::tellp (  )  const [inherited]

Definition at line 72 of file binary_o_stream.cpp.

References lass::io::BinaryOStream::doTellp().

BinaryOStream & lass::io::BinaryOStream::seekp ( long  position  )  [inherited]

BinaryOStream & lass::io::BinaryOStream::seekp ( long  offset,
std::ios_base::seekdir  direction 
) [inherited]

Definition at line 87 of file binary_o_stream.cpp.

References lass::io::BinaryOStream::doSeekp().

void lass::io::BinaryOStream::flush (  )  [inherited]

Definition at line 95 of file binary_o_stream.cpp.

References lass::io::BinaryOStream::doFlush().

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]

Definition at line 186 of file binary_o_stream.cpp.

References LASS_META_ASSERT.

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().

template<typename T >
BinaryOStream & lass::io::BinaryOStream::operator<< ( const std::vector< T > &  x  )  [inline, inherited]

Definition at line 60 of file binary_o_stream.inl.

References LASS_ASSERT.

template<typename T >
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

Parameters:
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]

void lass::io::BinaryStreamBase::setEndianness ( num::Endianness  iEndianness  )  [inline, inherited]

const bool lass::io::StreamBase::good (  )  const [inline, inherited]

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]

Definition at line 80 of file stream_base.h.

Referenced by lass::io::XmlOElement::XmlOElement().

void lass::io::StreamBase::clear ( std::ios_base::iostate  iState = std::ios_base::goodbit  )  [inline, inherited]

void lass::io::StreamBase::setstate ( std::ios_base::iostate  iState  )  [inline, inherited]

lass::io::StreamBase::operator num::SafeBool (  )  const [inline, inherited]

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]

Definition at line 60 of file non_copyable.h.

Referenced by lass::io::Image::readLine().


Field Documentation

Definition at line 81 of file binary_o_socket.h.

Referenced by flusher().

Definition at line 82 of file binary_o_socket.h.

Referenced by doWrite(), and flusher().

std::size_t lass::io::BinaryOSocket::bufferSize_ [private]

Definition at line 83 of file binary_o_socket.h.

Referenced by doWrite().

std::size_t lass::io::BinaryOSocket::current_ [private]

Definition at line 84 of file binary_o_socket.h.

Referenced by doWrite(), and flusher().

Definition at line 85 of file binary_o_socket.h.

Referenced by doWrite(), and flusher().

Definition at line 86 of file binary_o_socket.h.

Referenced by doFlush(), doWrite(), flusher(), and ~BinaryOSocket().

Definition at line 87 of file binary_o_socket.h.

Referenced by ~BinaryOSocket().

unsigned long lass::io::BinaryOSocket::flushPeriod_ [private]

Definition at line 88 of file binary_o_socket.h.

Referenced by flusher().

Definition at line 89 of file binary_o_socket.h.

Referenced by flusher(), and ~BinaryOSocket().


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

Generated on Mon Nov 10 14:22:09 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo