ccsoft  0.0.0
Convolutional codes library with soft decision decoding
/shared/development/google_code/rssoft/libccsoft/lib/CC_Encoding.h
Go to the documentation of this file.
00001 /*
00002  Copyright 2013 Edouard Griffiths <f4exb at free dot fr>
00003 
00004  This file is part of CCSoft. A Convolutional Codes Soft Decoding library
00005 
00006  This program is free software; you can redistribute it and/or modify
00007  it under the terms of the GNU General Public License as published by
00008  the Free Software Foundation; either version 2 of the License, or
00009  (at your option) any later version.
00010 
00011  This program is distributed in the hope that it will be useful,
00012  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  GNU General Public License for more details.
00015 
00016  You should have received a copy of the GNU General Public License
00017  along with this program; if not, write to the Free Software
00018  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
00019 
00020  Convolutional encoder class
00021 
00022  */
00023 #ifndef __CC_ENCODING_H__
00024 #define __CC_ENCODING_H__
00025 
00026 #include "CC_Encoding_base.h"
00027 #include "CCSoft_Exception.h"
00028 #include <vector>
00029 #include <iostream>
00030 
00031 namespace ccsoft
00032 {
00033 
00041 template<typename T_Register, typename T_IOSymbol>
00042 class CC_Encoding : public CC_Encoding_base<T_Register, T_IOSymbol>
00043 {
00044 public:
00045 
00046     //=============================================================================================
00056     CC_Encoding(const std::vector<unsigned int>& _constraints, const std::vector<std::vector<T_Register> >& _genpoly_representations) :
00057         CC_Encoding_base<T_Register, T_IOSymbol>(_constraints, _genpoly_representations),
00058         registers(_constraints.size(),0)
00059     {
00060     }
00061 
00062     //=============================================================================================
00066     virtual ~CC_Encoding()
00067     {}
00068 
00069     //=============================================================================================
00073     void clear()
00074     {
00075         registers.assign(registers.size(), 0);
00076     }
00077 
00078     //=============================================================================================
00083     virtual T_Register& get_register(unsigned int index)
00084     {
00085         return registers[index];
00086     }
00087     
00091     const std::vector<T_Register>& get_registers() const
00092     {
00093         return registers;
00094     }
00095 
00099     void set_registers(const std::vector<T_Register>& _registers)
00100     {
00101         registers = _registers;
00102     }
00103 
00104 
00105 protected:
00106     std::vector<T_Register> registers; 
00107 };
00108 
00109 } // namespace ccsoft
00110 
00111 
00112 #endif // __CC_ENCODING_H__
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines