class AsyncFileReader

Read asynchronously from a file. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Protected Types

Protected Methods

Protected Members


Detailed Description

 AsyncFileReader (EventLoop& e, XorpFd fd, int priority = XorpTask::PRIORITY_DEFAULT)

AsyncFileReader

Parameters:

eEventLoop that object should associate itself with.
fda file descriptor to read from.
 ~AsyncFileReader ()

~AsyncFileReader

void  add_buffer (uint8_t* buffer, size_t buffer_bytes, const Callback& cb)

add_buffer

Add an additional buffer for reading to.

Note that the buffer with the data is managed by the user.

Parameters:

bufferpointer to buffer.
buffer_bytessize of buffer in bytes.
cbCallback object to invoke when I/O is performed.
void  add_buffer_with_offset (uint8_t* buffer, size_t buffer_bytes, size_t offset, const Callback& cb)

add_buffer_with_offset

Add an additional buffer for reading to.

Note that the buffer with the data is managed by the user.

Parameters:

bufferpointer to buffer.
buffer_bytessize of buffer in bytes.
offsetstarting point for read operation.
cbCallback object to invoke when I/O is performed.
bool  start ()

start

Start asynchronous operation.

Returns: true on success, false if no buffers are available.

Reimplemented from AsyncFileOperator.

void  stop ()

stop

Stop asynchronous operation.

Reimplemented from AsyncFileOperator.

size_t  buffers_remaining ()

buffers_remaining

[const]

Returns: the number of buffers available.

Reimplemented from AsyncFileOperator.

void  flush_buffers ()

flush_buffers

Stop asynchronous operation and clear list of buffers.

Reimplemented from AsyncFileOperator.

BufferInfo (class)

BufferInfo

[protected]

void  read (XorpFd fd, IoEventType type)

read

[protected]

void  complete_transfer (int err, ssize_t done)

complete_transfer

[protected]

list<BufferInfo *> _buffers

_buffers

[protected]

void  disconnect (XorpFd fd, IoEventType type)

disconnect

[protected]

XorpTask _deferred_io_task

_deferred_io_task

[protected]

bool _disconnect_added

_disconnect_added

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:10:36 2009, using kdoc 2.0a54+XORP.