00001 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright 2010 Nicola Baldo 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Nicola Baldo <nicola@baldo.biz> 00019 */ 00020 00021 #ifndef PACKET_COMBINATION_H 00022 #define PACKET_COMBINATION_H 00023 00024 #include<ptr.h> 00025 #include<simple-ref-count.h> 00026 #include<bit-vector.h> 00027 #include<coding-vector.h> 00028 #include<vector> 00029 #include<ostream> 00030 00031 namespace Binc { 00032 00033 00040 class PacketCombination : public SimpleRefCount<PacketCombination> 00041 { 00042 public: 00043 00048 PacketCombination(); 00049 00054 virtual ~PacketCombination(); 00055 00056 00062 PacketCombination(const PacketCombination& c); 00063 00070 PacketCombination(Ptr<CodingVector> codingVector, Ptr<BitVector> payload); 00071 00078 bool operator== (const PacketCombination& rhs) const; 00079 00080 00087 bool operator!= (const PacketCombination& rhs) const; 00088 00098 PacketCombination& operator+= (const PacketCombination& rhs); 00099 00100 00110 friend PacketCombination operator+ (const PacketCombination& lhs, const PacketCombination& rhs); 00111 00112 00121 friend std::ostream& operator << (std::ostream& os, const PacketCombination& v); 00122 00127 Ptr<CodingVector> GetCodingVector () const; 00128 00133 Ptr<BitVector> GetPayloadCopy () const; 00134 00135 00142 Ptr<PacketCombination> Copy () const; 00143 00144 00155 bool IsDecoded (unsigned int pos); 00156 00157 private: 00158 00159 00160 Ptr<CodingVector> m_codingVector; 00161 Ptr<BitVector> m_payload; 00162 }; 00163 00164 00165 00166 } // Namespace Binc 00167 00168 #endif // PACKET_COMBINATION_H