EdgeIterator.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_EDGEITERATOR_H
#define SH_EDGEITERATOR_H
#include <list>
#include "Edge.h"
class Graph ;
#include "SampleOccurence.h"
class SampleValue ;
class Vertex ;
class EdgeIterator {
public:
enum ITERATIONMODE {
SAMPLEOCCURENCE, // incrementing increments to next sample occurence (possibly of the same sample value) thus using every edge of the source vertex
SAMPLEVALUE // incrementing increments to the next sample value thus not using all edges in general
} ;
EdgeIterator (void) ;
EdgeIterator (Vertex *v, ITERATIONMODE m = SAMPLEOCCURENCE) ;
EdgeIterator (const EdgeIterator& eit) ;
~EdgeIterator (void) ;
const Edge* operator* (void) const
{ return ((Finished) ? NULL : &CurrentEdge) ; }
void operator++ (void) ;
void reset (Vertex* v, ITERATIONMODE m = SAMPLEOCCURENCE) ;
void reset (ITERATIONMODE m = SAMPLEOCCURENCE) ;
bool isFinished (void) const
{ return Finished ; } ;
VertexLabel getPartnerVertexLabel (void) const
{ return SampleOccurenceIt->getVertex()->getLabel() ; } ;
static UWORD32 getMaxNumEdges (void)
{ return MaxNumEdges ; } ;
static void setMaxNumEdges (UWORD32 mne)
{ MaxNumEdges = mne ; } ;
void print (unsigned short spc = 0) const ;
private:
Edge CurrentEdge ;
ITERATIONMODE Mode ;
unsigned long* SVALIndices ;
static UWORD32 MaxNumEdges ;
UWORD32 EdgeIndex ;
bool Finished ;
std::list<SampleOccurence>::const_iterator SampleOccurenceIt ;
void findNextEdge (void) ;
bool isDestSampleValueOK (const SampleValue *sv) ;
} ;
#endif // ndef SH_EDGEITERATOR_H
Edge.h
SampleOccurence.h
EdgeIterator
allows an iteration trough all edges of a vertex
Definition EdgeIterator.h:51
EdgeIterator::operator*
const Edge * operator*(void) const
Definition EdgeIterator.h:79
EdgeIterator::Finished
bool Finished
is true iff there are no more edges for this source vertex
Definition EdgeIterator.h:136
EdgeIterator::setMaxNumEdges
static void setMaxNumEdges(UWORD32 mne)
Definition EdgeIterator.h:114
EdgeIterator::SVALIndices
unsigned long * SVALIndices
contains (for every sample value) an index to the current opposite neighbour
Definition EdgeIterator.h:127
EdgeIterator::~EdgeIterator
~EdgeIterator(void)
Definition EdgeIterator.cc:52
EdgeIterator::ITERATIONMODE
ITERATIONMODE
Definition EdgeIterator.h:53
EdgeIterator::SAMPLEVALUE
@ SAMPLEVALUE
Definition EdgeIterator.h:55
EdgeIterator::SAMPLEOCCURENCE
@ SAMPLEOCCURENCE
Definition EdgeIterator.h:54
EdgeIterator::print
void print(unsigned short spc=0) const
EdgeIterator::operator++
void operator++(void)
Definition EdgeIterator.cc:57
EdgeIterator::isFinished
bool isFinished(void) const
Definition EdgeIterator.h:101
EdgeIterator::isDestSampleValueOK
bool isDestSampleValueOK(const SampleValue *sv)
EdgeIterator::CurrentEdge
Edge CurrentEdge
the current edge (is returned by operator*)
Definition EdgeIterator.h:121
EdgeIterator::getMaxNumEdges
static UWORD32 getMaxNumEdges(void)
Definition EdgeIterator.h:111
EdgeIterator::MaxNumEdges
static UWORD32 MaxNumEdges
the maximum number of edges the EdgeIterator should iterate through
Definition EdgeIterator.h:130
EdgeIterator::EdgeIndex
UWORD32 EdgeIndex
the index/number of the edge that is currently returned by operator*
Definition EdgeIterator.h:133
EdgeIterator::EdgeIterator
EdgeIterator(void)
Definition EdgeIterator.cc:28
EdgeIterator::reset
void reset(Vertex *v, ITERATIONMODE m=SAMPLEOCCURENCE)
Definition EdgeIterator.cc:121
EdgeIterator::SampleOccurenceIt
std::list< SampleOccurence >::const_iterator SampleOccurenceIt
Definition EdgeIterator.h:142
EdgeIterator::Mode
ITERATIONMODE Mode
mode of iteration
Definition EdgeIterator.h:124
EdgeIterator::findNextEdge
void findNextEdge(void)
Definition EdgeIterator.cc:127
EdgeIterator::getPartnerVertexLabel
VertexLabel getPartnerVertexLabel(void) const
Definition EdgeIterator.h:108
Edge
Definition Edge.h:28
Graph
a graph constructed from a cover file and a message to be embedded
Definition Graph.h:51
SampleValue
the value of a sample in a CvrStgFile
Definition SampleValue.h:61
Vertex
a vertex in a graph
Definition Vertex.h:43
UWORD32
unsigned long UWORD32
Definition common.h:45
VertexLabel
UWORD32 VertexLabel
Definition common.h:68