Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Conduit Class Reference

Inheritance diagram for Conduit:

IConduit IConduitFilter DeviceConduit Socket Console::ConsoleConduit Console::ConsoleConduit FileConduit DatagramSocket ServerSocket SocketConduit MulticastSocket List of all members.

Public Member Functions

uint bufferSize ()
 this (ConduitStyle.Bits style, bool seekable)
void close ()
bool flush (void[] src)
void attach (IConduitFilter filter)
uint read (void[] dst)
uint write (void[] src)
bool isSeekable ()
bool isReadable ()
bool isWritable ()
bool isTextual ()
IConduit copy (IConduit source)
ConduitStyle Bits getStyle ()

Static Public Member Functions

static bool isHalting ()

Protected Member Functions

abstract uint reader (void[] dst)
abstract uint writer (void[] src)
void bind (IConduit conduit, IConduitFilter next)
void unbind ()

Private Types

enum  { Eof = uint.max }

Private Attributes

ConduitStyle Bits style
IConduitFilter filter
bool seekable

Detailed Description

Conduit abstract base-class, implementing interface IConduit. Only the conduit-specific read, write, and buffer-factory need to be implemented for a concrete conduit implementation. See FileConduit for an example.

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 66 of file Conduit.d.


Member Enumeration Documentation

anonymous enum [inherited]
 

Declare the End Of File identifer

Enumeration values:
Eof 

Definition at line 64 of file IConduit.d.


Member Function Documentation

uint bufferSize  ) 
 

Return a preferred size for buffering conduit I/O

Reimplemented from IConduit.

Reimplemented in DeviceConduit, and Socket.

abstract uint reader void[]  dst  )  [protected, pure virtual]
 

conduit-specific reader

Reimplemented from IConduitFilter.

Implemented in Socket.

abstract uint writer void[]  src  )  [protected, pure virtual]
 

conduit-specific writer

Reimplemented from IConduitFilter.

Implemented in Socket.

this ConduitStyle.Bits  style,
bool  seekable
[inline]
 

Construct a conduit with the given style and seek abilities. Conduits are either seekable or non-seekable.

Reimplemented in DeviceConduit.

Definition at line 104 of file Conduit.d.

References filter, seekable, and style.

void close  )  [inline]
 

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 IConduit.

Reimplemented in DeviceConduit, Socket, and SocketConduit.

Definition at line 120 of file Conduit.d.

References filter, and IConduitFilter::unbind().

Referenced by FileConduit::copy().

bool flush void[]  src  )  [inline]
 

flush provided content to the conduit

Reimplemented from IConduit.

Definition at line 132 of file Conduit.d.

References write().

void attach IConduitFilter  filter  )  [inline]
 

Please refer to IConduit.attach for details

Reimplemented from IConduit.

Definition at line 150 of file Conduit.d.

References IConduitFilter::bind().

void bind IConduit  conduit,
IConduitFilter  next
[inline, protected]
 

Reimplemented from IConduitFilter.

Definition at line 159 of file Conduit.d.

void unbind  )  [inline, protected]
 

Reimplemented from IConduitFilter.

Definition at line 167 of file Conduit.d.

uint read void[]  dst  )  [inline]
 

read from conduit into a target buffer

Reimplemented from IConduit.

Definition at line 177 of file Conduit.d.

References filter, and IConduitFilter::reader().

Referenced by DeviceConduit::VersionPosix::reader().

uint write void[]  src  )  [inline]
 

write to conduit from a source buffer

Reimplemented from IConduit.

Definition at line 188 of file Conduit.d.

References filter, and IConduitFilter::writer().

Referenced by flush(), and DeviceConduit::VersionPosix::writer().

bool isSeekable  )  [inline]
 

Returns true if this conduit is seekable (whether it implements ISeekable)

Reimplemented from IConduit.

Definition at line 200 of file Conduit.d.

References seekable.

bool isReadable  )  [inline]
 

Returns true is this conduit can be read from

Reimplemented from IConduit.

Definition at line 211 of file Conduit.d.

References ConduitStyle::access(), ConduitStyle::Read, and style.

bool isWritable  )  [inline]
 

Returns true if this conduit can be written to

Reimplemented from IConduit.

Definition at line 222 of file Conduit.d.

References ConduitStyle::access(), style, and ConduitStyle::Write.

bool isTextual  )  [inline]
 

Returns true if this conduit is text-based

Reimplemented from IConduit.

Reimplemented in SocketConduit.

Definition at line 233 of file Conduit.d.

References ConduitStyle::access(), style, and ConduitStyle::Text.

IConduit copy IConduit  source  )  [inline]
 

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 245 of file Conduit.d.

References Buffer, and buffer.

ConduitStyle Bits getStyle  )  [inline]
 

Return the style used when creating this conduit

Definition at line 264 of file Conduit.d.

References style.

static bool isHalting  )  [inline, static]
 

Is the application terminating?

Definition at line 275 of file Conduit.d.

References halting.


Member Data Documentation

ConduitStyle Bits style [private]
 

Definition at line 68 of file Conduit.d.

Referenced by getStyle(), isReadable(), isTextual(), isWritable(), FileDevice::this(), and this().

IConduitFilter filter [private]
 

Definition at line 69 of file Conduit.d.

Referenced by close(), read(), this(), and write().

bool seekable [private]
 

Definition at line 70 of file Conduit.d.

Referenced by isSeekable(), and this().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:37 2005 for Mango by  doxygen 1.4.0