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
ITERATIONMODE
Definition: EdgeIterator.h:53
Definition: EdgeIterator.h:54
~EdgeIterator(void)
Definition: EdgeIterator.cc:52
Edge CurrentEdge
the current edge (is returned by operator*)
Definition: EdgeIterator.h:121
a graph constructed from a cover file and a message to be embedded
Definition: Graph.h:51
EdgeIterator(void)
Definition: EdgeIterator.cc:28
void findNextEdge(void)
Definition: EdgeIterator.cc:127
static UWORD32 MaxNumEdges
the maximum number of edges the EdgeIterator should iterate through
Definition: EdgeIterator.h:130
unsigned long * SVALIndices
contains (for every sample value) an index to the current opposite neighbour
Definition: EdgeIterator.h:127
Definition: Edge.h:28
VertexLabel getPartnerVertexLabel(void) const
Definition: EdgeIterator.h:108
the value of a sample in a CvrStgFile
Definition: SampleValue.h:61
void reset(Vertex *v, ITERATIONMODE m=SAMPLEOCCURENCE)
Definition: EdgeIterator.cc:121
Definition: EdgeIterator.h:55
const Edge * operator*(void) const
Definition: EdgeIterator.h:79
UWORD32 VertexLabel
Definition: common.h:68
static void setMaxNumEdges(UWORD32 mne)
Definition: EdgeIterator.h:114
unsigned long UWORD32
Definition: common.h:45
ITERATIONMODE Mode
mode of iteration
Definition: EdgeIterator.h:124
allows an iteration trough all edges of a vertex
Definition: EdgeIterator.h:51
bool isDestSampleValueOK(const SampleValue *sv)
bool Finished
is true iff there are no more edges for this source vertex
Definition: EdgeIterator.h:136
void print(unsigned short spc=0) const
void operator++(void)
Definition: EdgeIterator.cc:57
static UWORD32 getMaxNumEdges(void)
Definition: EdgeIterator.h:111
UWORD32 EdgeIndex
the index/number of the edge that is currently returned by operator*
Definition: EdgeIterator.h:133
bool isFinished(void) const
Definition: EdgeIterator.h:101
std::list< SampleOccurence >::const_iterator SampleOccurenceIt
Definition: EdgeIterator.h:142
a vertex in a graph
Definition: Vertex.h:43