Inheritance diagram for Conduit:
Public Member Functions | |
this (ConduitStyle style, bool seekable) | |
IBuffer | createBuffer () |
void | attach (IConduitSource input) |
void | attach (IConduitSink output) |
int | read (IBuffer target) |
int | write (IBuffer source) |
bool | isSeekable () |
bool | isReadable () |
bool | isWritable () |
IConduit | copy (IConduit source) |
IConduit | flush (IBuffer source) |
ConduitStyle | getStyle () |
Protected Member Functions | |
abstract int | reader (void[] dst) |
abstract int | writer (void[] src) |
override void | closure () |
void | bind (IConduitSink next) |
void | bind (IConduitSource next) |
void | unbind () |
Private Types | |
enum | { Eof = -1 } |
Private Member Functions | |
this () | |
Object | getLock () |
void | setLock (Object lock) |
void | acquire () |
bool | acquireIfOpen () |
void | close () |
Private Attributes | |
ConduitStyle | style |
IConduitSource | input |
IConduitSink | output |
bool | seekable |
Object | _lock |
Conduits provide virtualized access to external content, and represent things like files or Internet connections. Conduits are modelled by mango.io.model.IConduit, and implemented via classes FileConduit and SocketConduit.
Additional kinds of conduit are easy to construct: one either subclasses mango.io.Conduit, or implements mango.io.model.IConduit. A conduit reads and writes from/to an IBuffer in large chunks, typically the entire buffer.
Definition at line 65 of file Conduit.d.
|
Declare the End Of File identifer Definition at line 64 of file IConduit.d. |
|
Construct a conduit with the given style and seek abilities. Conduits are either seekable or non-seekable. Definition at line 79 of file Conduit.d. References seekable. |
|
Create a Buffer of a conduit-specific size Reimplemented from IConduit. Reimplemented in FileConduit. |
|
conduit-specific reader Reimplemented from IConduitSource. |
|
conduit-specific writer Reimplemented from IConduitSink. |
|
Method to close the filters. This is invoked from the Resource base-class when the resource is being closed. You should ensure that a subclass invokes this as part of its closure mechanics. Reimplemented from Resource. Reimplemented in FileConduit. Definition at line 120 of file Conduit.d. References IConduitSink::unbind(), and IConduitSource::unbind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 132 of file Conduit.d. References IConduitSource::bind(). Referenced by testConduitFilters(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 144 of file Conduit.d. References IConduitSink::bind(). |
|
Reimplemented from IConduitSink. |
|
Reimplemented from IConduitSource. |
|
Reimplemented from IConduitSource. |
|
read from conduit into a target buffer Reimplemented from IConduit. Definition at line 180 of file Conduit.d. Referenced by FileBucket::Record::read(), testDirectIO(), and testFile5(). |
|
write to conduit from a source buffer Reimplemented from IConduit. Definition at line 193 of file Conduit.d. Referenced by copy(), flush(), and testDirectIO(). |
|
Returns true if this conduit is seekable (whether it implements ISeekable) Reimplemented from IConduit. Definition at line 212 of file Conduit.d. References seekable. |
|
Returns true is this conduit can be read from Reimplemented from IConduit. Definition at line 223 of file Conduit.d. References ConduitStyle::access(). |
|
Returns true if this conduit can be written to Reimplemented from IConduit. Definition at line 234 of file Conduit.d. References ConduitStyle::access(). |
|
Transfer the content of another conduit to this one. Returns a reference to this class, and throws IOException on failure. Reimplemented from IConduit. Definition at line 246 of file Conduit.d. References flush(), IConduit::read(), and write(). |
|
Flush buffer content out to this conduit. Throws an IOException if flushing results in an Eof condition. Reimplemented from IConduit. Definition at line 266 of file Conduit.d. References IBuffer::readable(), and write(). Referenced by copy(), and FileBucket::Record::write(). |
|
Return the style used when creating this conduit |
|
Set the default lock to be this object Reimplemented in DatagramSocket, and SocketConduit. Definition at line 74 of file Resource.d. References Resource::_lock. |
|
Return the lock used by this resource Reimplemented from IResource. Definition at line 101 of file Resource.d. References Resource::_lock. |
|
Set an alternate lock. Typically one would use this to synchronize multiple different Resource via a common object. Reimplemented from IResource. Definition at line 115 of file Resource.d. |
|
hold a reference to this resource. The caller is now responsible for invoking close() upon this resource; Reimplemented from IResource. Definition at line 130 of file Resource.d. References Resource::_lock, and Resource::usage. Referenced by Socket::set(), Socket::this(), and FileConduit::this(). |
|
If this resource is still open, acquire it and return true. This is a threadsafe test-and-set mechanism that fails only if the resource is already closed, or was never opened. Note that you are responsible for invoking close() whenever this method returns true. Reimplemented from IResource. Definition at line 149 of file Resource.d. References Resource::_lock, and Resource::usage. |
|
release a reference to this resource Reimplemented from IResource. Definition at line 168 of file Resource.d. References Resource::_lock, Resource::closure(), and Resource::usage. Referenced by Resource::~this(), and FileConduit::VersionWin32::Win32MappedBuffer::~this(). |
|
|
|
|
|
|
|
Definition at line 70 of file Conduit.d. Referenced by isSeekable(), and this(). |
|
Definition at line 51 of file Resource.d. Referenced by Resource::acquire(), Resource::acquireIfOpen(), Resource::close(), Resource::getLock(), and Resource::this(). |