Main Page | Class Hierarchy | Alphabetical List | Class List | 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 59 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 72 of file ProtocolReader.d.

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

Return the payload if there was one, null otherwise.

Definition at line 85 of file ProtocolReader.d.

References PickleReader::thaw().

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

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 118 of file ProtocolReader.d.

References ClusterContent.

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 187 of file PickleReader.d.

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


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:09 2004 for Mango by doxygen 1.3.6