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 Member Functions

 EndBlock ()
 EndBlock (const vpr::Uint32 &frame_number)
 Create a EndBlock packet to signal that the local node has reached the end of the frame.
void serialize ()
 Serializes member variables into a data stream.
virtual void parse (vpr::BufferObjectReader *reader)
 Parses the data stream into the local member variables.
virtual void printData (int debug_level)
 Print the data to the screen in a readable form.
vpr::Uint16 getTempVar ()

Static Public Member Functions

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

Detailed Description

Definition at line 50 of file EndBlock.h.


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 49 of file EndBlock.cpp.

References cluster::Packet::mHeader, cluster::Header::RIM_END_BLOCK, cluster::Header::RIM_PACKET, cluster::Header::RIM_PACKET_HEAD_SIZE, and serialize().

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


Member Function Documentation

void cluster::EndBlock::serialize (  ) 

Serializes member variables into a data stream.

Definition at line 66 of file EndBlock.cpp.

References cluster::Packet::mHeader, cluster::Packet::mPacketWriter, and cluster::Header::serializeHeader().

Referenced by EndBlock().

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

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

Parses the data stream into the local member variables.

Implements cluster::Packet.

Definition at line 83 of file EndBlock.cpp.

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

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

Print the data to the screen in a readable form.

Implements cluster::Packet.

Definition at line 92 of file EndBlock.cpp.

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

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

Return the type of this packet.

Definition at line 82 of file EndBlock.h.

References cluster::Header::RIM_END_BLOCK.

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

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

Definition at line 87 of file EndBlock.h.

00088    {
00089       return mTempVar;
00090    }


The documentation for this class was generated from the following files:
Generated on Thu Jan 4 10:44:23 2007 for Gadgeteer by  doxygen 1.5.1