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

cluster::EndBlock Class Reference

#include <EndBlock.h>

Inheritance diagram for cluster::EndBlock:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 EndBlock ()
 EndBlock (const vpr::Uint32 &frame_number)
 Create a EndBlock packet to signal that the local node has reached the end of the frame. 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...

vpr::Uint16 getTempVar ()

Static Public Methods

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


Constructor & Destructor Documentation

cluster::EndBlock::EndBlock   [inline]
 

Definition at line 53 of file EndBlock.h.

00054    {;}

cluster::EndBlock::EndBlock const vpr::Uint32 &    frame_number
 

Create a EndBlock packet to signal that the local node has reached the end of the frame.

Parameters:
frame_number  -The current number of frames that have been drawn.

Definition at line 48 of file EndBlock.cpp.

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

00049    {
00050       // Set the local member variables using the given values.
00051       mTempVar = frame_number;
00052       // Create a Header for this packet with the correect type and size.
00053       mHeader = new Header(Header::RIM_PACKET,
00054                                        Header::RIM_END_BLOCK,
00055                                        Header::RIM_PACKET_HEAD_SIZE
00056                                        + 2 /*Temp Variable*/,
00057                                        frame_number);
00058       // Serialize the given data.
00059       serialize();
00060    }


Member Function Documentation

void cluster::EndBlock::serialize  
 

Serializes member variables into a data stream.

Definition at line 65 of file EndBlock.cpp.

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

Referenced by EndBlock.

00066    {
00067       //mTempVar = Header::RIM_END_BLOCK;
00068       // Clear the data stream.
00069       mPacketWriter->getData()->clear();
00070       mPacketWriter->setCurPos(0);
00071 
00072       // Serialize the header.
00073       mHeader->serializeHeader();      
00074       
00075       // Serialize the Temp Var
00076       mPacketWriter->writeUint16(mTempVar);
00077    }

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

Parses the data stream into the local member variables.

Implements cluster::Packet.

Definition at line 82 of file EndBlock.cpp.

00083    {
00084       // De-Serialize the Temp Var
00085       mTempVar = reader->readUint16();
00086    }

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

Print the data to the screen in a readable form.

Implements cluster::Packet.

Definition at line 91 of file EndBlock.cpp.

00092    {
00093       boost::ignore_unused_variable_warning(debug_level);
00094 /*      vprDEBUG_BEGIN(gadgetDBG_RIM,vprDBG_CONFIG_LVL)
00095          <<  clrOutBOLD(clrYELLOW,"====== END BLOCK ======\n") << vprDEBUG_FLUSH;
00096 
00097       Packet::printData(debug_level);
00098 
00099       vprDEBUG(gadgetDBG_RIM,debug_level)
00100          << clrOutBOLD(clrYELLOW, "New State:    ") << mNewState
00101          << std::endl << vprDEBUG_FLUSH;
00102 
00103       vprDEBUG_END(gadgetDBG_RIM,vprDBG_CONFIG_LVL)
00104          <<  clrOutBOLD(clrYELLOW,"=======================\n") << vprDEBUG_FLUSH;
00105 */
00106    }

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

Return the type of this packet.

Definition at line 81 of file EndBlock.h.

00082    {
00083        return(Header::RIM_END_BLOCK);
00084    }

vpr::Uint16 cluster::EndBlock::getTempVar   [inline]
 

Definition at line 85 of file EndBlock.h.

00086    {
00087       return mTempVar;
00088    }


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