MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
MFM::Packet< T > Class Template Reference

#include <Packet.h>

Public Member Functions

 Packet (PacketType type, u8 generation)
 
const char * GetTypeString ()
 
PacketType GetType ()
 
void SetType (PacketType type)
 
void SetAtom (const T &atom)
 
void SetReceivingNeighbor (Dir dir)
 
u32 GetReceivingNeighbor ()
 
T & GetAtom ()
 
void SetLocation (const SPoint &fromPt)
 
const SPoint GetLocation () const
 
const u8 GetGeneration () const
 
void SetGeneration (u8 generation)
 
bool IsObsolete (u8 ourGeneration) const
 

Detailed Description

template<class T>
class MFM::Packet< T >

An inter-Tile communication object which holds any and all information that Tiles need to pass to one another.

Constructor & Destructor Documentation

template<class T>
MFM::Packet< T >::Packet ( PacketType  type,
u8  generation 
)
inline

Constructs a new Packet of a given PacketType.

Member Function Documentation

template<class T>
T& MFM::Packet< T >::GetAtom ( )
inline

Gets a reference to this Packet's held Atom.

Returns
A reference to this Packet's held Atom.
template<class T>
const u8 MFM::Packet< T >::GetGeneration ( ) const
inline

Gets this Packet's generation.

Returns
This Packet's generation.
template<class T>
const SPoint MFM::Packet< T >::GetLocation ( ) const
inline

Gets this Packet's held location.

Returns
This Packet's held location.
template<class T>
u32 MFM::Packet< T >::GetReceivingNeighbor ( )
inline

Gets this Packet's held EuclidDir neighbor field.

Returns
This Packet's held Eucliddir neighbor field.
template<class T>
PacketType MFM::Packet< T >::GetType ( )
inline

Gets the PacketType of this Packet.

Returns
The PacketType of this Packet.
template<class T>
bool MFM::Packet< T >::IsObsolete ( u8  ourGeneration) const
inline

Determine if this packet is obsolete compared to ourGeneration.

Returns
true iff this packet's generation should be considered 'less than' ourGeneration considering u8 wraparound.
template<class T>
void MFM::Packet< T >::SetAtom ( const T &  atom)
inline

Sets this Packet's held Atom.

Parameters
atomThe Atom to copy into this Packet. A reference is not kept to this Atom.
template<class T>
void MFM::Packet< T >::SetGeneration ( u8  generation)
inline

Gets this Packet's generation.

Returns
This Packet's generation.
template<class T>
void MFM::Packet< T >::SetLocation ( const SPoint fromPt)
inline

Sets this Packet's held location.

Parameters
fromPtThe SPoint to copy into this Packet.
template<class T>
void MFM::Packet< T >::SetReceivingNeighbor ( Dir  dir)
inline

Sets this Packet's held EuclidDir neighbor field.

Parameters
dirThe EuclidDir to place inside this Packet.
template<class T>
void MFM::Packet< T >::SetType ( PacketType  type)
inline

Sets the PacketType of this Packet.

Parameters
typeThe new PacketType of this Packet.

The documentation for this class was generated from the following file: