ccsoft  0.0.0
Convolutional codes library with soft decision decoding
/shared/development/google_code/rssoft/libccsoft/lib/CC_TreeEdge.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  Edge in the convolutional code tree
00021 
00022  */
00023 #ifndef __CC_TREE_EDGE_H__
00024 #define __CC_TREE_EDGE_H__
00025 
00026 namespace ccsoft
00027 {
00028 
00029 class CC_TreeEdgeTag_Empty
00030 {
00031 };
00032 
00033 template<typename T_IOSymbol, typename T_Register, typename T_EdgeTag>
00034 class CC_TreeNode;
00035 
00042 template<typename T_IOSymbol, typename T_Register, typename T_EdgeTag>
00043 class CC_TreeEdge
00044 {
00045 public:
00054     CC_TreeEdge(unsigned int _id,
00055             const T_IOSymbol& _in_symbol,
00056             const T_IOSymbol& _out_symbol,
00057             float _metric,
00058             CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *_p_origin) :
00059                 id(_id),
00060                 in_symbol(_in_symbol),
00061                 out_symbol(_out_symbol),
00062                 metric(_metric),
00063                 p_origin(_p_origin),
00064                 p_destination(0)
00065     {}
00066 
00070     ~CC_TreeEdge()
00071     {
00072         if (p_destination)
00073         {
00074             delete p_destination;
00075             p_destination = 0;
00076         }
00077     }
00078     
00082     void set_p_destination(CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *_p_destination)
00083     {
00084         p_destination = _p_destination;
00085     }
00086 
00090     const T_IOSymbol& get_in_symbol() const
00091     {
00092         return in_symbol;
00093     }
00094 
00098     const T_IOSymbol& get_out_symbol() const
00099     {
00100         return out_symbol;
00101     }
00102 
00106     float get_metric() const
00107     {
00108         return metric;
00109     }
00110 
00114     CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *get_p_origin()
00115     {
00116         return p_origin;
00117     }
00118 
00122     CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *get_p_destination()
00123     {
00124         return p_destination;
00125     }
00126     
00130     const T_EdgeTag& get_edge_tag() const
00131     {
00132         return edge_tag;
00133     }
00134 
00138     T_EdgeTag& get_edge_tag()
00139     {
00140         return edge_tag;
00141     }
00142 
00143 protected:
00144     unsigned int id; 
00145     T_IOSymbol in_symbol; 
00146     T_IOSymbol out_symbol; 
00147     float metric; 
00148     CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *p_origin; 
00149     CC_TreeNode<T_IOSymbol, T_Register, T_EdgeTag> *p_destination; 
00150     T_EdgeTag edge_tag; 
00151 };
00152 
00153 } // namespace ccsoft
00154 
00155 
00156 #endif // __CC_TREE_EDGE_H__
00157 
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines