RfidReaderMacData Class Reference

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

#include <rfid_reader_mac.hpp>

Inheritance diagram for RfidReaderMacData:

PacketData List of all members.

Public Types

typedef boost::shared_ptr<
RfidReaderMacData
RfidReaderMacDataPtr
 Smart pointer that clients should use.
 Types_Generic
 enum value Types_Generic.
 Types_Request
 enum value Types_Request.
 Types_Ack
 enum value Types_Ack.
 Types_Select
 enum value Types_Select.
enum  Types { Types_Generic, Types_Request, Types_Ack, Types_Select }
 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 node ID to the packet data.
NodeId getSenderId () const
 Read the sender node ID from the packet data.
void setReceiverId (const NodeId &nodeId)
 Write the receiver node ID to the packet data.
NodeId getReceiverId () const
 Read the receiver node 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.
void setNumberOfSlots (t_uchar numberOfSlots)
 Write the number of slots field to this packet data.
t_uchar getNumberOfSlots () const
 Read the number of slots field from this packet data.
ostream & print (ostream &s) const
 Return the stream representation of the object.

Static Public Member Functions

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

Protected Member Functions

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

Friends

ostream & operator<< (ostream &s, const RfidReaderMacData &data)

Detailed Description

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

Definition at line 26 of file rfid_reader_mac.hpp.


Member Enumeration Documentation

enum RfidReaderMacData::Types

Types enum.

Specifies the types of packets that are sent.

Enumerator:
Types_Generic  enum value Types_Generic.
Types_Request  enum value Types_Request.
Types_Ack  enum value Types_Ack.
Types_Select  enum value Types_Select.

Definition at line 36 of file rfid_reader_mac.hpp.


Member Function Documentation

PacketDataPtr RfidReaderMacData::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 457 of file rfid_reader_mac.cpp.

References RfidReaderMacData().

Referenced by create().

t_uchar RfidReaderMacData::getNumberOfSlots (  )  const [inline]

Read the number of slots field from this packet data.

Returns:
the number of slots field of the packet.

Definition at line 568 of file rfid_reader_mac.hpp.

NodeId RfidReaderMacData::getReceiverId (  )  const

Read the receiver node ID from the packet data.

Returns:
the ID of the receiver.

Definition at line 479 of file rfid_reader_mac.cpp.

NodeId RfidReaderMacData::getSenderId (  )  const

Read the sender node ID from the packet data.

Returns:
the ID of the sender.

Definition at line 468 of file rfid_reader_mac.cpp.

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

Get the size of this data.

Returns:
the size of the data in bytes.

Reimplemented from PacketData.

Definition at line 538 of file rfid_reader_mac.hpp.

References getType(), and Types_Request.

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

Read the type field from this packet data.

Returns:
the type field of the packet.

Definition at line 558 of file rfid_reader_mac.hpp.

Referenced by getSizeInBytes().

void RfidReaderMacData::setNumberOfSlots ( t_uchar  numberOfSlots  )  [inline]

Write the number of slots field to this packet data.

Parameters:
numberOfSlots the value of the number of slots field.

Definition at line 563 of file rfid_reader_mac.hpp.

void RfidReaderMacData::setReceiverId ( const NodeId nodeId  ) 

Write the receiver node ID to the packet data.

Parameters:
nodeId the ID of the receiver.

Definition at line 474 of file rfid_reader_mac.cpp.

References NodeId::writeToByteArray().

void RfidReaderMacData::setSenderId ( const NodeId nodeId  ) 

Write the sender node ID to the packet data.

Parameters:
nodeId the ID of the sender.

Definition at line 463 of file rfid_reader_mac.cpp.

References NodeId::writeToByteArray().

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

Write the type field to this packet data.

Parameters:
type the value for the type field.

Definition at line 553 of file rfid_reader_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