senf::FileBody Class Reference

FileHandle referenced body. More...
Inheritance diagram for senf::FileBody:
Inheritance graph
[legend]

List of all members.


Detailed Description

FileHandle referenced body.

For internal use only.

The senf::FileBody class forms the body part of the handle/body structure of the FileHandle interface. It manages the FileHandle data and is referenced by senf::FileHandle. It is automatically managed using reference counting.

Since the senf::FileHandle class forwards most calls directly to the underlying senf::FileBody instance, most members are documented in senf::FileHandle.

Writing senf::FileBody derived classes

It is possible to write customized senf::FileBody derived body implementations. This implementation can then be used be a senf::FileHandle derived class to customize the FileHandle behavior. Handling the body directly by the handle class ensures, that no invalid handles can be created (a senf::FileHandle derived handle expecting a specific body type but pointing to a different body type).

To customize the behavior, a virtual interface is provided. This interface only covers some basic functionality which is only used infrequently during the lifetime of a FileHandle instance.

Attention:
Whenever a new class is derived from FileBody which adds new members, this class must also derive from senf::pool_alloc_mixin

Definition at line 67 of file FileHandle.ih.


Public Types

typedef boost::intrusive_ptr
< FileBody
ptr

Public Member Functions

FileHandle  handle ()
int  fd () const
void  fd (int fd)
void  close ()
void  terminate ()
void  destroyClose ()
bool  readable () const
bool  waitReadable (senf::ClockService::clock_type timeout) const
bool  writeable () const
bool  waitWriteable (senf::ClockService::clock_type timeout) const
bool  oobReadable () const
bool  waitOOBReadable (senf::ClockService::clock_type timeout) const
bool  blocking () const
void  blocking (bool status)
bool  eof () const
bool  valid () const

Structors and default members

  FileBody (int fd=-1)
  Create new instance.
virtual  ~FileBody ()

Member Typedef Documentation

typedef boost::intrusive_ptr<FileBody> senf::FileBody::
ptr

Reimplemented in senf::SocketBody.

Definition at line 75 of file FileHandle.ih.


Constructor & Destructor Documentation

senf::FileBody::
FileBody ( int  fd = -1 )

Create new instance.

You need to pass a real file descriptor to this constructor not some arbitrary id even if you overload all the virtual members. If the file descriptor is -1 the resulting body/handle is not valid()

Definition at line 39 of file FileHandle.cci.

senf::FileBody::
~FileBody ()

Definition at line 135 of file FileHandle.cc.


Member Function Documentation

void senf::FileBody::
blocking ( bool  status )

Definition at line 102 of file FileHandle.cc.

bool senf::FileBody::
blocking ()

Definition at line 94 of file FileHandle.cc.

void senf::FileBody::
close ()

Definition at line 44 of file FileHandle.cc.

void senf::FileBody::
destroyClose ()

Definition at line 60 of file FileHandle.cc.

bool senf::FileBody::
eof ()

Definition at line 59 of file FileHandle.cci.

void senf::FileBody::
fd ( int  fd )

Definition at line 54 of file FileHandle.cci.

int senf::FileBody::
fd ()

Definition at line 48 of file FileHandle.cci.

senf::FileHandle senf::FileBody::
handle ()

Definition at line 43 of file FileHandle.cci.

bool senf::FileBody::
oobReadable ()

Definition at line 97 of file FileHandle.cci.

bool senf::FileBody::
readable ()

Definition at line 71 of file FileHandle.cci.

void senf::FileBody::
terminate ()

Definition at line 52 of file FileHandle.cc.

bool senf::FileBody::
valid ()

Definition at line 65 of file FileHandle.cci.

bool senf::FileBody::
waitOOBReadable ( senf::ClockService::clock_type  timeout )

Definition at line 103 of file FileHandle.cci.

bool senf::FileBody::
waitReadable ( senf::ClockService::clock_type  timeout )

Definition at line 77 of file FileHandle.cci.

bool senf::FileBody::
waitWriteable ( senf::ClockService::clock_type  timeout )

Definition at line 90 of file FileHandle.cci.

bool senf::FileBody::
writeable ()

Definition at line 84 of file FileHandle.cci.


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