#include <mcllib/MCIOBase.h>
Inheritance diagram for MCIOBase:
Public Member Functions | |
mcllib::mcint64 | available () const |
Get the amount of data available from the IO object. | |
void | close () |
Close the IO object. | |
void * | getHandle () const |
Get a pointer to the implementation of the IO object. | |
bool | isOpen () const |
Test to see if the object is open. | |
bool | poll (mcintn pollFlags, mcinterval_t timeout) const |
Poll the IO object. | |
mcllib::mcint32 | read (void *buf, mcllib::mcint32 size) |
Read data from the IO object. | |
void | setInherit (bool inherit) |
Allow/disallow an IO object to be inherited by child processes. | |
MCString | toString () const |
Get representation of the IO object as string for diagnostic purposes. | |
mcllib::mcint32 | write (const void *buf, mcllib::mcint32 size) |
Write data to the IO object. | |
~MCIOBase () | |
Destructor. | |
Static Public Attributes | |
const mcintn | MCPOLLALL |
Convenience indicating all poll flags. | |
const mcintn | MCPOLLEX |
Flag indicating interest in knowning about exception on the IO object. | |
const mcintn | MCPOLLRD |
Flag indicating interest in reading the IO object. | |
const mcintn | MCPOLLWR |
Flag indicating interest in writing the IO object. | |
Protected Member Functions | |
MCIOBase (void *impl) | |
Constructor from an implementation handle. | |
MCIOBase () | |
Default constructor. |
This base class provides methods which are common to all types of IO.
Derived class constructors may provide a pointer to a private implementation class derived from mclpriv::MCIOBaseImpl which is reference counted to allow fast and simple copying. It is still better to pass as const references instead of by value to avoid the reference counting overhead.
|
Destructor. The close method is called to ensure resource are freed up. |
|
Default constructor. Creates an unnamed, unopen IO object. |
|
Constructor from an implementation handle. impl must point to an object derived from MCIOBaseImpl. |
|
Get the amount of data available from the IO object. If the operation fails an exception is thrown.
|
|
Close the IO object. Frees up any resources that may have been allocated. All calls to close() after the first one are ignored. |
|
Get a pointer to the implementation of the IO object.
|
|
Test to see if the object is open.
|
|
Poll the IO object. Poll is used to test whether it is possible to read from or write to the object, or if the object is in error.
|
|
Read data from the IO object. If the read fails an exception is thrown.
|
|
Allow/disallow an IO object to be inherited by child processes. If the IO object cannot have its inherit state changed an exception will be thrown.
|
|
Get representation of the IO object as string for diagnostic purposes.
|
|
Write data to the IO object. If the write fails an exception is thrown.
|