RfidTagMacData Class Reference

The representation of the MAC data in a RfidTagMac's packet. More...

#include <rfid_tag_mac.hpp>

Inheritance diagram for RfidTagMacData:

PacketData List of all members.

Public Types

typedef boost::shared_ptr<
RfidTagMacData
RfidTagMacDataPtr
 Smart pointer that clients should use.
 Types_Generic
 enum value Types_Generic.
 Types_Reply
 enum value Types_Reply.
enum  Types { Types_Generic, Types_Reply }
 Types enum. More...

Public Member Functions

virtual t_uint getSizeInBytes () const
 Get the size of this data.
void setSenderId (const NodeId &nodeId)
 Write the sender ID to the packet data.
NodeId getSenderId () const
 Read the sender ID from the packet data.
void setReceiverId (const NodeId &nodeId)
 Write the receiver ID to the packet data.
NodeId getReceiverId () const
 Read the receiver ID from the packet data.
void setType (Types type)
 Write the type field to this packet data.
Types getType () const
 Read the type field from this packet data.
ostream & print (ostream &s) const
 Return the stream representation of the object.

Static Public Member Functions

static RfidTagMacDataPtr create ()
 A factory method to ensure that all objects are created via new since we are using smart pointers.
static RfidTagMacDataPtr create (const RfidTagMacData &rhs)
 A factory method to ensure that all objects are created via new since we are using smart pointers.

Protected Member Functions

 RfidTagMacData ()
 A constructor.
 RfidTagMacData (const RfidTagMacData &rhs)
 A copy constructor.
virtual PacketDataPtr clone () const
 Returns a pointer to a deep copy of this object.

Detailed Description

The representation of the MAC data in a RfidTagMac's packet.

Definition at line 24 of file rfid_tag_mac.hpp.


Member Enumeration Documentation

enum RfidTagMacData::Types

Types enum.

Specifies the types of packets that are sent.

Enumerator:
Types_Generic  enum value Types_Generic.
Types_Reply  enum value Types_Reply.

Definition at line 33 of file rfid_tag_mac.hpp.


Member Function Documentation

PacketDataPtr RfidTagMacData::clone (  )  const [protected, virtual]

Returns a pointer to a deep copy of this object.

This is addresses the slicing problem with copy construction.

Returns:
a pointer to a deep copy of this object.

Reimplemented from PacketData.

Definition at line 269 of file rfid_tag_mac.cpp.

References RfidTagMacData().

Referenced by create().

NodeId RfidTagMacData::getReceiverId (  )  const

Read the receiver ID from the packet data.

Returns:
the ID of the node in the packet.

Definition at line 291 of file rfid_tag_mac.cpp.

NodeId RfidTagMacData::getSenderId (  )  const

Read the sender ID from the packet data.

Returns:
the ID of the node in the packet.

Definition at line 280 of file rfid_tag_mac.cpp.

t_uint RfidTagMacData::getSizeInBytes (  )  const [inline, virtual]

Get the size of this data.

Returns:
the size of the data in bytes.

Reimplemented from PacketData.

Definition at line 393 of file rfid_tag_mac.hpp.

RfidTagMacData::Types RfidTagMacData::getType (  )  const [inline]

Read the type field from this packet data.

Returns:
the type field of the packet.

Definition at line 387 of file rfid_tag_mac.hpp.

void RfidTagMacData::setReceiverId ( const NodeId nodeId  ) 

Write the receiver ID to the packet data.

Parameters:
nodeId the ID to be written.

Definition at line 286 of file rfid_tag_mac.cpp.

References NodeId::writeToByteArray().

void RfidTagMacData::setSenderId ( const NodeId nodeId  ) 

Write the sender ID to the packet data.

Parameters:
nodeId the ID to be written.

Definition at line 275 of file rfid_tag_mac.cpp.

References NodeId::writeToByteArray().

void RfidTagMacData::setType ( Types  type  )  [inline]

Write the type field to this packet data.

Parameters:
type the value for the type field.

Definition at line 382 of file rfid_tag_mac.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Dec 12 17:04:41 2006 for rfidsim by  doxygen 1.4.7