2005/5/9

     
 

class TransRateWriter

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::net::TransRateWriter Class Reference

#include <TransRateWriter.h>

Inheritance diagram for acdk::net::TransRateWriter:

acdk::io::AbstractFilterWriter acdk::io::AbstractWriter acdk::io::FilterWriter acdk::lang::Object acdk::io::Writer acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

A Writer Filter which limits the tranfer rate.

If bytesPerSecond == 0 no limitaton will be used.

Author:
Roger Rene Kommer
Version:
Revision
1.9
Date:
Date
2005/02/05 10:45:29


Public Member Functions

 TransRateWriter (IN(::acdk::io::RWriter) out, int bytesPerSecond)
virtual void write (byte c)
 default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1);

virtual void write (IN(RbyteArray) ch, int offset=0, int len=-1)
 default implementation: return write(ch->data(), offset, len == -1 ? ch->length() - offset : len);

virtual void write (const byte *cstr, int offset, int len)
void setBytesPerSecondRate (int newrate)

Public Attributes

int _bytePerSecondRate
int _bytesWritten
int _bytesWhileSleepASec
tick_t _lastWriteTick
int _blockSize
RTransListener _listener


Constructor & Destructor Documentation

acdk::net::TransRateWriter::TransRateWriter IN(::acdk::io::RWriter out,
int  bytesPerSecond
[inline]
 


Member Function Documentation

void acdk::net::TransRateWriter::setBytesPerSecondRate int  newrate  )  [inline]
 

virtual void acdk::net::TransRateWriter::write const byte cstr,
int  offset,
int  len
[virtual]
 

Reimplemented from acdk::io::AbstractFilterWriter.

virtual void acdk::net::TransRateWriter::write IN(RbyteArray ch,
int  offset = 0,
int  len = -1
[inline, virtual]
 

default implementation: return write(ch->data(), offset, len == -1 ? ch->length() - offset : len);

Reimplemented from acdk::io::AbstractFilterWriter.

virtual void acdk::net::TransRateWriter::write byte  c  )  [inline, virtual]
 

default implementation: byte cbuf[2]; cbuf[1] = 0; cbuf[0] = c; return write((const byte*)cbuf, 0, 1);

Reimplemented from acdk::io::AbstractFilterWriter.


Member Data Documentation

int acdk::net::TransRateWriter::_blockSize
 

int acdk::net::TransRateWriter::_bytePerSecondRate
 

int acdk::net::TransRateWriter::_bytesWhileSleepASec
 

int acdk::net::TransRateWriter::_bytesWritten
 

tick_t acdk::net::TransRateWriter::_lastWriteTick
 

RTransListener acdk::net::TransRateWriter::_listener