Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

cluster::StartBlock Class Reference

#include <StartBlock.h>

Inheritance diagram for cluster::StartBlock:

Inheritance graph
[legend]
Collaboration diagram for cluster::StartBlock:

Collaboration graph
[legend]
List of all members.

Public Methods

 StartBlock ()
 StartBlock (const vpr::GUID &plugin_id, const vpr::Uint32 &frame_number)
 Create a StartBlock packet to signal that the local node is ready to start. More...

void serialize ()
 Serializes member variables into a data stream. More...

virtual void parse (vpr::BufferObjectReader *reader)
 Parses the data stream into the local member variables. More...

virtual void printData (int debug_level)
 Print the data to the screen in a readable form. More...


Static Public Methods

vpr::Uint16 getPacketFactoryType ()
 Return the type of this packet. More...


Constructor & Destructor Documentation

cluster::StartBlock::StartBlock   [inline]
 

Definition at line 51 of file StartBlock.h.

00052    {;}

cluster::StartBlock::StartBlock const vpr::GUID &    plugin_id,
const vpr::Uint32 &    frame_number
 

Create a StartBlock packet to signal that the local node is ready to start.

Parameters:
plugin_guid  -GUID of the ClusterPlugin that should handle this packet.
frame_number  -The current number of frames that have been drawn.

Definition at line 50 of file StartBlock.cpp.

References cluster::Packet::mHeader, cluster::Packet::mPluginId, and serialize.

00051    {
00052       // Set the local member variables using the given values.
00053       mPluginId = plugin_id;
00054    
00055       // Create a Header for this packet with the correect type and size.
00056       mHeader = new Header(Header::RIM_PACKET,
00057                                        Header::RIM_START_BLOCK,
00058                                        Header::RIM_PACKET_HEAD_SIZE
00059                                        +16/*Plugin GUID*/
00060                                        ,frame_number);
00061       // Serialize the given data.
00062       serialize();
00063    }


Member Function Documentation

void cluster::StartBlock::serialize  
 

Serializes member variables into a data stream.

Definition at line 69 of file StartBlock.cpp.

References cluster::Packet::mHeader, cluster::Packet::mPacketWriter, and cluster::Packet::mPluginId.

Referenced by StartBlock.

00070    {
00071       // Clear the data stream.
00072       mPacketWriter->getData()->clear();
00073       mPacketWriter->setCurPos(0);
00074 
00075       // Serialize the header.
00076       mHeader->serializeHeader();
00077       
00078       // Serialize the Plugin ID
00079       mPluginId.writeObject(mPacketWriter);
00080    }

void cluster::StartBlock::parse vpr::BufferObjectReader *    reader [virtual]
 

Parses the data stream into the local member variables.

Implements cluster::Packet.

Definition at line 85 of file StartBlock.cpp.

References cluster::Packet::mPluginId.

00086    {
00087       // De-Serialize the Plugin ID
00088       mPluginId.readObject(reader);
00089    }

void cluster::StartBlock::printData int    debug_level [virtual]
 

Print the data to the screen in a readable form.

Implements cluster::Packet.

Definition at line 94 of file StartBlock.cpp.

References gadgetDBG_RIM, and cluster::Packet::mPluginId.

00095    {
00096       boost::ignore_unused_variable_warning(debug_level);
00097       
00098       vprDEBUG_BEGIN(gadgetDBG_RIM,vprDBG_VERB_LVL) 
00099          <<  clrOutBOLD(clrYELLOW,"====== Start BLOCK ======\n") << vprDEBUG_FLUSH;
00100       
00101       Packet::printData(vprDBG_VERB_LVL);
00102       
00103       vprDEBUG(gadgetDBG_RIM,vprDBG_VERB_LVL) 
00104          << clrOutBOLD(clrYELLOW, "Plugin ID:    ") << mPluginId.toString()
00105          << std::endl << vprDEBUG_FLUSH;
00106 
00107       vprDEBUG_END(gadgetDBG_RIM,vprDBG_VERB_LVL) 
00108          <<  clrOutBOLD(clrYELLOW,"=======================\n") << vprDEBUG_FLUSH;
00109    }

vpr::Uint16 cluster::StartBlock::getPacketFactoryType   [inline, static]
 

Return the type of this packet.

Definition at line 80 of file StartBlock.h.

00081    {
00082        return(Header::RIM_START_BLOCK);
00083    }


The documentation for this class was generated from the following files:
Generated on Sun May 2 14:26:46 2004 for Gadgeteer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002