Graph.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_GRAPH_H
00022 #define SH_GRAPH_H
00023 
00024 #include <iostream>
00025 #include <list>
00026 #include <map>
00027 #include <queue>
00028 #include <vector>
00029 
00030 #include "EdgeIterator.h"
00031 #include "SampleValueAdjacencyList.h"
00032 #include "common.h"
00033 #include "wrapper_hash_set.h"
00034 
00035 class BitString ;
00036 class SampleOccurence ;
00037 class Selector ;
00038 class Vertex ;
00039 class VertexContent ;
00040 struct VertexContentsEqual ;
00041 
00051 class Graph {
00052         public:
00058         Graph (CvrStgFile* cvr, const BitString& emb, Selector& sel) ;
00059 
00063         ~Graph (void) ;
00064 
00068         unsigned long getNumVertices (void) const
00069                 { return Vertices.size() ; } ;
00070 
00076         Vertex* getVertex (VertexLabel l) const
00077                 { return Vertices[l] ; } ;
00078 
00079         void unmarkDeletedAllVertices (void) ;
00080 
00084         float getAvgVertexDegree (void) const ;
00085 
00086         void printVerboseInfo (void) ;
00087 
00092         bool check (bool verbose = false) const ;
00097         bool check_Vertices (bool verbose = false) const ;
00102         bool check_SampleValues (bool verbose = false) const ;
00108         bool check_SampleOccurences (bool verbose = false) const ;
00113         bool check_SVALists (bool verbose = false) const ;
00114 
00115 #ifdef DEBUG
00116 
00121         void print (void) const ;
00122 
00123         void print_gml (std::ostream& out) const ;
00124         void printVertex_gml (std::ostream& out, Vertex* v, unsigned int recdepth, std::vector<bool>& nodeprinted, std::vector<bool>& edgesprinted, bool start = true) const ;
00125         void printPrologue_gml (std::ostream& out) const ;
00126         void printEpilogue_gml (std::ostream& out) const ;
00127 
00128         void print_Vertices (unsigned short spc = 0) const ;
00129 #endif
00130 
00131         private:
00132         //
00133         // friend-declarations
00134         //
00135         friend class WKSConstructionHeuristic ;
00136         friend class EdgeIterator ;
00137         friend class SampleValueAdjacencyList ;
00138         friend class Vertex ;
00139 
00141         std::vector<Vertex*> Vertices ;
00142 
00144         std::vector<SampleValue*> SampleValues ;
00145 
00147         std::vector<SampleValueAdjacencyList*> SVALists ;
00148 
00150         std::vector<std::list<SampleOccurence> > SampleOccurences ;
00151 
00155         std::vector<UWORD32*> NumSampleOccurences ;
00156 
00158         std::vector<std::list<SampleOccurence> > DeletedSampleOccurences ;
00159         std::vector<UWORD32*> NumDeletedSampleOccurences ;
00160 
00161         std::list<SampleOccurence>::iterator markDeletedSampleOccurence (std::list<SampleOccurence>::iterator it) ;
00162         std::list<SampleOccurence>::iterator unmarkDeletedSampleOccurence (std::list<SampleOccurence>::iterator it) ;
00163 
00164         //
00165         // end of friend-declarations
00166         // Note: private members of Graph that are declared beyond this point should
00167         //       not be used by friends.
00168         //
00169 
00176         void constructSamples (const std::vector<SamplePos*> &sposs, std::vector<SampleValue**>& svalues) ;
00177 
00184         void constructVertices (std::vector<SamplePos*>& sposs, std::vector<SampleValue**>& svalues, const std::vector<EmbValue>& tvalues) ;
00185 
00192         void constructEdges (void) ;
00193 
00194         CvrStgFile *File ;
00195         EmbValue EmbValueModulus ;
00196         unsigned short SamplesPerVertex ;
00197 
00198         bool check_SampleOccurences_size (bool verbose = false) const ;
00199         bool check_SampleOccurences_correctness (bool verbose = false) const ;
00200         bool check_SampleOccurences_completeness (bool verbose = false) const ;
00201 
00202         bool check_SVALists_size (bool verbose = false) const ;
00203         bool check_SVALists_soundness (bool verbose = false) const ;
00204         bool check_SVALists_sorted (bool verbose = false) const ;
00205         bool check_SVALists_uniqueness (bool verbose = false) const ;
00206         bool check_SVALists_completeness (bool verbose = false) const ;
00207 } ;
00208 
00209 #endif // ndef SH_GRAPH_H

Generated on Fri Feb 2 09:21:48 2007 for steghide by  doxygen 1.5.1