steghide  0.5.1
EdgeIterator.h
Go to the documentation of this file.
1 /*
2  * steghide 0.5.1 - a steganography program
3  * Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  *
19  */
20 
21 #ifndef SH_EDGEITERATOR_H
22 #define SH_EDGEITERATOR_H
23 
24 #include <list>
25 
26 #include "Edge.h"
27 class Graph ;
28 #include "SampleOccurence.h"
29 class SampleValue ;
30 class Vertex ;
31 
51 class EdgeIterator {
52  public:
54  SAMPLEOCCURENCE, // incrementing increments to next sample occurence (possibly of the same sample value) thus using every edge of the source vertex
55  SAMPLEVALUE // incrementing increments to the next sample value thus not using all edges in general
56  } ;
57 
61  EdgeIterator (void) ;
62 
67 
71  EdgeIterator (const EdgeIterator& eit) ;
72 
73  ~EdgeIterator (void) ;
74 
79  const Edge* operator* (void) const
80  { return ((Finished) ? NULL : &CurrentEdge) ; }
81 
85  void operator++ (void) ;
86 
91  void reset (Vertex* v, ITERATIONMODE m = SAMPLEOCCURENCE) ;
92 
97 
101  bool isFinished (void) const
102  { return Finished ; } ;
103 
109  { return SampleOccurenceIt->getVertex()->getLabel() ; } ;
110 
111  static UWORD32 getMaxNumEdges (void)
112  { return MaxNumEdges ; } ;
113 
114  static void setMaxNumEdges (UWORD32 mne)
115  { MaxNumEdges = mne ; } ;
116 
117  void print (unsigned short spc = 0) const ;
118 
119  private:
122 
125 
127  unsigned long* SVALIndices ;
128 
131 
134 
136  bool Finished ;
137 
142  std::list<SampleOccurence>::const_iterator SampleOccurenceIt ;
143 
150  void findNextEdge (void) ;
151 
155  bool isDestSampleValueOK (const SampleValue *sv) ;
156 } ;
157 
158 #endif // ndef SH_EDGEITERATOR_H