Newer
Older
* Copyright (c) 2015-2016, Luca Fulchir<luca@fulchir.it>, All rights reserved.
*
* This file is part of "libRaptorQ".
*
* libRaptorQ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* libRaptorQ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* and a copy of the GNU Lesser General Public License
* along with libRaptorQ. If not, see <http://www.gnu.org/licenses/>.
*/
/////////////////////
//
// These templates are just a wrapper around the
// So if you want to see what the algorithm looks like,
// you are in the wrong place
//
/////////////////////
#include "Interleaver.hpp"
#include "De_Interleaver.hpp"
#include "Encoder.hpp"
#include "Decoder.hpp"
#include "Shared_Computation/Decaying_LF.hpp"
#include "Thread_Pool.hpp"
#include <cassert>
#include <future>
Symbol (Encoder<Rnd_It, Fwd_It> *enc, const uint32_t esi, const uint8_t sbn)
uint64_t operator() (Fwd_It &start, const Fwd_It end)
{
uint32_t ret = _sbn;
ret <<= 24;
public std::iterator<std::input_iterator_tag, Symbol<Rnd_It, Fwd_It>>
Symbol_Iterator (Encoder<Rnd_It, Fwd_It> *enc, const uint32_t esi,
Symbol_Iterator<Rnd_It, Fwd_It> ret (_esi + i, _sbn);
bool operator== (const Symbol_Iterator<Rnd_It, Fwd_It> &it) const
bool operator!= (const Symbol_Iterator<Rnd_It, Fwd_It> &it) const
return it._esi != _esi || it._sbn != _sbn;
}
private:
Block (Encoder<Rnd_It, Fwd_It> *enc, const uint16_t symbols,
Symbol_Iterator<Rnd_It, Fwd_It> begin_source() const
return Symbol_Iterator<Rnd_It, Fwd_It> (_enc, 0, _sbn);
Symbol_Iterator<Rnd_It, Fwd_It> end_source() const
return Symbol_Iterator<Rnd_It, Fwd_It> (_enc, _symbols, _sbn);
Symbol_Iterator<Rnd_It, Fwd_It> begin_repair() const
return Symbol_Iterator<Rnd_It, Fwd_It> (_enc, _symbols, _sbn);
Symbol_Iterator<Rnd_It, Fwd_It> end_repair (const uint32_t max_repair)
return Symbol_Iterator<Rnd_It, Fwd_It> (_enc, _symbols + max_r,_sbn);
uint16_t symbols () const
{
return _enc->symbols (_sbn);
}
uint32_t block_size () const
{
return _enc->block_size (_sbn);
}
public std::iterator<std::input_iterator_tag, Block<Rnd_It, Fwd_It>>
Block_Iterator (Encoder<Rnd_It, Fwd_It> *enc, const Impl::Partition part,
return Block<Rnd_It, Fwd_It> (_enc, _part.size (0), _sbn);
return Block<Rnd_It, Fwd_It> (_enc, _part.size (1), _sbn);
Block_Iterator ret = *this;
ret._sbn += i;
return ret;
}
bool operator== (const Block_Iterator &it) const
bool operator!= (const Block_Iterator &it) const
Loading full blame...