Public Member Functions | Static Protected Member Functions | Static Protected Attributes | Private Attributes
AsyncIO Class Reference

#include <asyncio.h>

Inheritance diagram for AsyncIO:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AsyncIO (int fd, int sig=SIGIO)
 Constructor - perform I/O on file descriptor fd, using sig as completion signal.
 ~AsyncIO ()
 Destructor - disconnect signal handler.
int read (volatile void *buf, vcl_size_t n)
 Begin reading n bytes into buf starting at current file position.
int read (volatile void *buf, vcl_size_t n, off_t pos)
 Begin reading n bytes into buf starting at absolute file position pos.
int write (volatile void *buf, vcl_size_t nbytes)
 Begin writing n bytes from buf starting at current file position.
int write (volatile void *buf, vcl_size_t nbytes, off_t pos)
 Begin writing n bytes from buf starting at absolute file position pos.
int wait_for_completion (bool suspend=true)
 Wait for I/O to complete, then return status.
bool is_complete () const

Static Protected Member Functions

static void signal_handler (int)

Static Protected Attributes

static volatile vcl_sig_atomic_t complete = 1
 Initialise shared state to "no operation in progress".

Private Attributes

struct aiocb cb

Detailed Description

Definition at line 65 of file asyncio.h.


Constructor & Destructor Documentation

AsyncIO::AsyncIO ( int  fd,
int  sig = SIGIO 
)

Constructor - perform I/O on file descriptor fd, using sig as completion signal.

Note that SIGUSR1,2 may be used by the linuxthreads library.

Definition at line 24 of file asyncio.cxx.

AsyncIO::~AsyncIO ( )

Destructor - disconnect signal handler.

Definition at line 37 of file asyncio.cxx.


Member Function Documentation

bool AsyncIO::is_complete ( ) const [inline]

Definition at line 100 of file asyncio.h.

int AsyncIO::read ( volatile void *  buf,
vcl_size_t  n 
)

Begin reading n bytes into buf starting at current file position.

Definition at line 44 of file asyncio.cxx.

int AsyncIO::read ( volatile void *  buf,
vcl_size_t  n,
off_t  pos 
)

Begin reading n bytes into buf starting at absolute file position pos.

Definition at line 61 of file asyncio.cxx.

void AsyncIO_Shared_State::signal_handler ( int  ) [static, protected, inherited]

Definition at line 16 of file asyncio.cxx.

int AsyncIO::wait_for_completion ( bool  suspend = true)

Wait for I/O to complete, then return status.

If suspend is true (the default), block the calling process while waiting, otherwise continuously poll for completion (not recommended, but may be more reliable).

Definition at line 133 of file asyncio.cxx.

int AsyncIO::write ( volatile void *  buf,
vcl_size_t  nbytes 
)

Begin writing n bytes from buf starting at current file position.

Definition at line 87 of file asyncio.cxx.

int AsyncIO::write ( volatile void *  buf,
vcl_size_t  nbytes,
off_t  pos 
)

Begin writing n bytes from buf starting at absolute file position pos.

Definition at line 104 of file asyncio.cxx.


Member Data Documentation

struct aiocb AsyncIO::cb [private]

Definition at line 67 of file asyncio.h.

volatile sig_atomic_t AsyncIO_Shared_State::complete = 1 [static, protected, inherited]

Initialise shared state to "no operation in progress".

Definition at line 58 of file asyncio.h.


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