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

ProtocolWriter Class Reference

Inheritance diagram for ProtocolWriter:

PickleWriter List of all members.

Public Types

enum  Command {
  OK, Exception, Full, Locked,
  Add, Copy, Remove, Load,
  AddQueue, RemoveQueue
}

Public Member Functions

 this (IBuffer buffer)
IWriter flush ()
ProtocolWriter put (Command cmd, char[] channel, IPickle object=null, char[] element=null)
ProtocolWriter success (char[] message=null)
ProtocolWriter full (char[] message)
ProtocolWriter reply (ClusterContent content)

Public Attributes

const ubyte Version = 0x01

Private Member Functions

PickleWriter freeze (IPickle object)

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 60 of file ProtocolWriter.d.


Member Enumeration Documentation

enum Command
 

Enumeration values:
OK 
Exception 
Full 
Locked 
Add 
Copy 
Remove 
Load 
AddQueue 
RemoveQueue 

Definition at line 64 of file ProtocolWriter.d.

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


Member Function Documentation

this IBuffer  buffer  )  [inline]
 

Construct a ProtocolWriter 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 PickleWriter.

Definition at line 78 of file ProtocolWriter.d.

IWriter flush  )  [inline]
 

Flush the output

Definition at line 91 of file ProtocolWriter.d.

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

ProtocolWriter put Command  cmd,
char[]  channel,
IPickle  object = null,
char[]  element = null
[inline]
 

Definition at line 109 of file ProtocolWriter.d.

References Version.

Referenced by Cluster::broadcast(), full(), Cluster::getCache(), Cluster::getQueue(), CacheServer::LoaderThread::load(), Cluster::loadCache(), Cluster::putCache(), Cluster::putQueue(), success(), and testProtocol().

ProtocolWriter success char[]  message = null  )  [inline]
 

Write an "OK" confirmation

Definition at line 150 of file ProtocolWriter.d.

References put().

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

ProtocolWriter full char[]  message  )  [inline]
 

Indicate something has filled up

Definition at line 162 of file ProtocolWriter.d.

References put().

Referenced by ClusterThread::run().

ProtocolWriter reply ClusterContent  content  )  [inline]
 

Write a serialized payload as constructed by the method ProtocolReader.getPacket()

Definition at line 175 of file ProtocolWriter.d.

References ClusterContent, and Version.

Referenced by ClusterThread::run().

PickleWriter freeze IPickle  object  )  [inline, inherited]
 

Serialize an Object. Objects are written in Network-order, and are prefixed by the guid exposed via the IPickle interface. This guid is used to identify the appropriate factory when reconstructing the instance.

Definition at line 84 of file PickleWriter.d.

References IPickle::getGuid(), and IWritable::write().

Referenced by VirtualCache::put(), and testClassSerialization().


Member Data Documentation

const ubyte Version = 0x01
 

Definition at line 62 of file ProtocolWriter.d.

Referenced by put(), and reply().


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