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

IConduit Struct Reference

Inheritance diagram for IConduit:

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

Public Types

enum  { Eof = uint.max }

Public Member Functions

uint read (void[] dst)
uint write (void[] src)
bool flush (void[] src)
IConduit copy (IConduit source)
void attach (IConduitFilter filter)
uint bufferSize ()
bool isReadable ()
bool isWritable ()
bool isSeekable ()
bool isTextual ()
void close ()

Detailed Description

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 56 of file IConduit.d.


Member Enumeration Documentation

anonymous enum
 

Declare the End Of File identifer

Enumeration values:
Eof 

Definition at line 64 of file IConduit.d.


Member Function Documentation

uint read void[]  dst  ) 
 

read from conduit into a target array

Reimplemented in Conduit.

Referenced by Buffer::fill().

uint write void[]  src  ) 
 

write to conduit from a source array

Reimplemented in Conduit.

Referenced by Buffer::drain().

bool flush void[]  src  ) 
 

flush provided content to the conduit

Reimplemented in Conduit.

Referenced by Buffer::append(), and Buffer::flush().

IConduit copy IConduit  source  ) 
 

Transfer the content of this conduit to another one. Returns true if all content was successfully copied.

Reimplemented in Conduit.

void attach IConduitFilter  filter  ) 
 

Attach a filter to this conduit: see IConduitFilter

Reimplemented in Conduit.

uint bufferSize  ) 
 

Return a preferred size for buffering conduit I/O

Reimplemented in Conduit, DeviceConduit, and Socket.

Referenced by Buffer::this().

bool isReadable  ) 
 

Returns true is this conduit can be read from

Reimplemented in Conduit.

bool isWritable  ) 
 

Returns true if this conduit can be written to

Reimplemented in Conduit.

bool isSeekable  ) 
 

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

Reimplemented in Conduit.

bool isTextual  ) 
 

Returns true if this conduit is text-based

Reimplemented in Conduit, and SocketConduit.

Referenced by Buffer::this().

void close  ) 
 

Release external resources

Reimplemented in Conduit, DeviceConduit, Socket, and SocketConduit.

Referenced by SocketAppender::close(), HttpBridge::cross(), and ClusterThread::run().


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