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

ProtocolReader Class Reference

Inheritance diagram for ProtocolReader:

PickleReader List of all members.

Public Member Functions

 this (IBuffer buffer)
IPayload getPayload (inout char[] channel, inout char[] element, inout ubyte cmd)
ClusterContent getPacket (inout char[] channel, inout char[] element, inout ubyte cmd)

Private Member Functions

Object thaw ()

Detailed Description

Objects passed around a cluster are prefixed with a header, so the receiver can pick them apart correctly. This header consists of:

Everything is written in Network order (big endian).

Definition at line 62 of file ProtocolReader.d.


Member Function Documentation

this IBuffer  buffer  )  [inline]
 

Construct a ProtocolReader upon the given buffer. As Objects are serialized, their content is written to this buffer. The buffer content is then typically flushed to some external conduit, such as a file or socket.

Note that serialized data is always in Network order.

Reimplemented from PickleReader.

Definition at line 75 of file ProtocolReader.d.

References assert(), and buffer.

IPayload getPayload inout char[]  channel,
inout char[]  element,
inout ubyte  cmd
[inline]
 

Return the payload if there was one, null otherwise.

Definition at line 88 of file ProtocolReader.d.

References buffer, and PickleReader::thaw().

Referenced by CacheServer::LoaderThread::load(), and Node::request().

ClusterContent getPacket inout char[]  channel,
inout char[]  element,
inout ubyte  cmd
[inline]
 

Return a duplicated slice of the buffer representing the recieved payload. This is a bit of a hack, but eliminates a reasonable amount of overhead. Note that the channel/key text is retained right at the start of the buffer, allowing the writer to toss the whole thing back without any further munging.

Definition at line 121 of file ProtocolReader.d.

References buffer.

Referenced by CacheServer::LoaderThread::load(), and ClusterThread::run().

Object thaw  )  [inline, inherited]
 

Reconstruct an Object from the current buffer content. It is considered optimal to configure the underlying IReader with an allocator that slices array-references, rather than copying them into the heap (the default configuration).

Definition at line 190 of file PickleReader.d.

Referenced by VirtualCache::get(), and getPayload().


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