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.
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.
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 () |
typedef boost::intrusive_ptr<FileBody> senf::FileBody:: | ||||
ptr | ||||
Reimplemented in senf::SocketBody.
Definition at line 75 of file FileHandle.ih.
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.
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.