Inheritance diagram for Conduit:
Public Member Functions | |
this (ConduitStyle style, bool seekable) | |
IBuffer | createBuffer () |
int | read (void[] dst) |
int | write (void[] src) |
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) |
ConduitStyle | getStyle () |
Protected Member Functions | |
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 typically reads and writes from/to an IBuffer in large chunks, typically the entire buffer. Alternatively, one can invoke read(dst[]) and/or write(src[]) directly.
Definition at line 69 of file Conduit.d.
|
Declare the End Of File identifer Definition at line 68 of file IConduit.d. |
|
Construct a conduit with the given style and seek abilities. Conduits are either seekable or non-seekable. Reimplemented in DeviceConduit. |
|
Create a Buffer of a conduit-specific size Reimplemented from IConduit. Reimplemented in DeviceConduit. Referenced by copy(). |
|
conduit-specific reader Reimplemented from IConduit. Referenced by DeviceConduit::VersionPosix::read(). |
|
conduit-specific writer Reimplemented from IConduit. Referenced by copy(), and DeviceConduit::VersionPosix::write(). |
|
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 DeviceConduit. Definition at line 124 of file Conduit.d. References input, output, IConduitSink::unbind(), and IConduitSource::unbind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 136 of file Conduit.d. References IConduitSource::bind(). |
|
Please refer to IConduit.attach for details Reimplemented from IConduit. Definition at line 148 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 184 of file Conduit.d. References assert(). |
|
write to conduit from a source buffer Reimplemented from IConduit. Definition at line 197 of file Conduit.d. References assert(). |
|
Returns true if this conduit is seekable (whether it implements ISeekable) Reimplemented from IConduit. Definition at line 216 of file Conduit.d. References seekable. |
|
Returns true is this conduit can be read from Reimplemented from IConduit. Definition at line 227 of file Conduit.d. References ConduitStyle::access(), ConduitStyle::Read, and style. |
|
Returns true if this conduit can be written to Reimplemented from IConduit. Definition at line 238 of file Conduit.d. References ConduitStyle::access(), style, and ConduitStyle::Write. |
|
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 250 of file Conduit.d. References createBuffer(), IBuffer::flush(), IConduit::read(), and write(). |
|
Return the style used when creating this conduit Definition at line 269 of file Conduit.d. References style. |
|
Set the default lock to be this object Reimplemented in DatagramSocket, and SocketConduit. Definition at line 77 of file Resource.d. References Resource::_lock. |
|
Return the lock used by this resource Reimplemented from IResource. Definition at line 104 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 118 of file Resource.d. References assert(). |
|
hold a reference to this resource. The caller is now responsible for invoking close() upon this resource; Reimplemented from IResource. Definition at line 133 of file Resource.d. References Resource::_lock, and Resource::usage. Referenced by Socket::set(), Socket::this(), FileConduit::this(), and DeviceConduit::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 152 of file Resource.d. References Resource::_lock, and Resource::usage. |
|
release a reference to this resource Reimplemented from IResource. Definition at line 171 of file Resource.d. References Resource::_lock, Resource::closure(), and Resource::usage. Referenced by Resource::~this(). |
|
Definition at line 71 of file Conduit.d. Referenced by getStyle(), isReadable(), isWritable(), and this(). |
|
|
|
|
|
Definition at line 74 of file Conduit.d. Referenced by isSeekable(), and this(). |
|
Definition at line 54 of file Resource.d. Referenced by Resource::acquire(), Resource::acquireIfOpen(), Resource::close(), Resource::getLock(), and Resource::this(). |