Binc::PacketCombination Class Reference
[Binary Vectors]

#include <packet-combination.h>

Inheritance diagram for Binc::PacketCombination:
Inheritance graph
[legend]
Collaboration diagram for Binc::PacketCombination:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PacketCombination ()
virtual ~PacketCombination ()
 PacketCombination (const PacketCombination &c)
 PacketCombination (Ptr< CodingVector > codingVector, Ptr< BitVector > payload)
bool operator== (const PacketCombination &rhs) const
bool operator!= (const PacketCombination &rhs) const
PacketCombinationoperator+= (const PacketCombination &rhs)
Ptr< CodingVectorGetCodingVector () const
Ptr< BitVectorGetPayloadCopy () const
Ptr< PacketCombinationCopy () const
bool IsDecoded (unsigned int pos)

Friends

PacketCombination operator+ (const PacketCombination &lhs, const PacketCombination &rhs)
std::ostream & operator<< (std::ostream &os, const PacketCombination &v)

Detailed Description

This class implements a coded packet using a CodingVector for the coding vector and and a BitVector for the payload.


Constructor & Destructor Documentation

Binc::PacketCombination::PacketCombination (  ) 

default constructor

Binc::PacketCombination::~PacketCombination (  )  [virtual]

virtual destructor needed by SimpleRefCount

Binc::PacketCombination::PacketCombination ( const PacketCombination c  ) 

copy constructor

Parameters:
c the PacketCombination to copy
Binc::PacketCombination::PacketCombination ( Ptr< CodingVector codingVector,
Ptr< BitVector payload 
)

Create a Packet Combination with the given coding vector and payload

Parameters:
codingVector the coding vector
payload the payload

Member Function Documentation

Ptr< PacketCombination > Binc::PacketCombination::Copy (  )  const
Returns:
a copy of this PacketCombination
Ptr< CodingVector > Binc::PacketCombination::GetCodingVector (  )  const
Returns:
a const reference to the embedded CodingVector
Ptr< BitVector > Binc::PacketCombination::GetPayloadCopy (  )  const
Returns:
a Ptr to a newly created copy of the payload
bool Binc::PacketCombination::IsDecoded ( unsigned int  pos  ) 

check if the PacketCombination is decoded, i.e., if the cofficients of the coding vector are all zero except for the one at position pos which is equal to one.

Parameters:
pos the position of the only non-zero coefficient of the coding vector.
Returns:
true if the PacketCombination is decoded, false otherwise.
bool Binc::PacketCombination::operator!= ( const PacketCombination rhs  )  const
Parameters:
rhs the Right Hand Side
Returns:
true if the PacketCombinations differ in coding vector or payload, false otherwise
PacketCombination & Binc::PacketCombination::operator+= ( const PacketCombination rhs  ) 

Add the Right Hand Side of the operator to *this, bit by bit. Since we work over the GF2 (binary) field, this is equivalent to the bit by bit XOR operation.

Parameters:
rhs the Right Hand Side
Returns:
a reference to *this
bool Binc::PacketCombination::operator== ( const PacketCombination rhs  )  const
Parameters:
rhs the Right Hand Side
Returns:
true if the PacketCombinations are identical (same payload and coding vector), false otherwise

Friends And Related Function Documentation

PacketCombination operator+ ( const PacketCombination lhs,
const PacketCombination rhs 
) [friend]

bitwise addition operator. Since we work over the GF2 (binary) field, this is equivalent to the bit by bit XOR operation.

Parameters:
lhs Left Hand Side of the operator
rhs Right Hand Side of the operator
Returns:
the value of lhs + rhs
std::ostream& operator<< ( std::ostream &  os,
const PacketCombination v 
) [friend]

print a PacketCombination

Parameters:
os the output stream
v the PacketCombination to be printed
Returns:
a reference to the output stream

The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends
Generated on Sat Apr 30 23:15:47 2011 for libBiNC by  doxygen 1.6.3