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


Member Enumeration Documentation

enum Command
 

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

Definition at line 67 of file ProtocolWriter.d.

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


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

References assert().

IWriter flush  )  [inline]
 

Flush the output

Definition at line 94 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 112 of file ProtocolWriter.d.

References Version.

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

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

Write an "OK" confirmation

Definition at line 153 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 165 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 178 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 87 of file PickleWriter.d.

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

Referenced by VirtualCache::put().


Member Data Documentation

const ubyte Version = 0x01
 

Definition at line 65 of file ProtocolWriter.d.

Referenced by put(), and reply().


The documentation for this class was generated from the following file:
Generated on Sat Apr 9 20:11:43 2005 for Mango by doxygen 1.3.6