EdgeIterator.h

Go to the documentation of this file.
00001 /*
00002  * steghide 0.5.1 - a steganography program
00003  * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  *
00019  */
00020 
00021 #ifndef SH_EDGEITERATOR_H
00022 #define SH_EDGEITERATOR_H
00023 
00024 #include <list>
00025 
00026 #include "Edge.h"
00027 class Graph ;
00028 #include "SampleOccurence.h"
00029 class SampleValue ;
00030 class Vertex ;
00031 
00051 class EdgeIterator {
00052         public:
00053         enum ITERATIONMODE {
00054                 SAMPLEOCCURENCE,        // incrementing increments to next sample occurence (possibly of the same sample value) thus using every edge of the source vertex
00055                 SAMPLEVALUE             // incrementing increments to the next sample value thus not using all edges in general
00056         } ;
00057 
00061         EdgeIterator (void) ;
00062 
00066         EdgeIterator (Vertex *v, ITERATIONMODE m = SAMPLEOCCURENCE) ;
00067 
00071         EdgeIterator (const EdgeIterator& eit) ;
00072 
00073         ~EdgeIterator (void) ;
00074 
00079         const Edge* operator* (void) const
00080                 { return ((Finished) ? NULL : &CurrentEdge) ; }
00081 
00085         void operator++ (void) ;
00086 
00091         void reset (Vertex* v, ITERATIONMODE m = SAMPLEOCCURENCE) ;
00092 
00096         void reset (ITERATIONMODE m = SAMPLEOCCURENCE) ;
00097 
00101         bool isFinished (void) const
00102                 { return Finished ; } ;
00103 
00108         VertexLabel getPartnerVertexLabel (void) const
00109                 { return SampleOccurenceIt->getVertex()->getLabel() ; } ;
00110 
00111         static UWORD32 getMaxNumEdges (void)
00112                 { return MaxNumEdges ; } ;
00113 
00114         static void setMaxNumEdges (UWORD32 mne)
00115                 { MaxNumEdges = mne ; } ;
00116 
00117         void print (unsigned short spc = 0) const ;
00118 
00119         private:
00121         Edge CurrentEdge ;
00122 
00124         ITERATIONMODE Mode ;
00125 
00127         unsigned long* SVALIndices ;
00128 
00130         static UWORD32 MaxNumEdges ;
00131 
00133         UWORD32 EdgeIndex ;
00134 
00136         bool Finished ;
00137 
00142         std::list<SampleOccurence>::const_iterator SampleOccurenceIt ;
00143 
00150         void findNextEdge (void) ;
00151 
00155         bool isDestSampleValueOK (const SampleValue *sv) ;
00156 } ;
00157 
00158 #endif // ndef SH_EDGEITERATOR_H

Generated on Fri Feb 2 13:54:20 2007 for steghide by  doxygen 1.5.1