Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

Selector.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_SELECTOR_H
00022 #define SH_SELECTOR_H
00023 
00024 #include <string>
00025 #include <vector>
00026 #include "wrapper_hash_map.h"
00027 
00028 #include "common.h"
00029 
00030 class PseudoRandomSource ;
00031 
00036 class Selector {
00037         public:
00043         Selector (UWORD32 m, std::string pp) ;
00044 
00049         Selector (UWORD32 m) ;
00050 
00057         Selector (const std::vector<UWORD32>& retvals) ;
00058 
00059         ~Selector (void) ;
00060 
00065         UWORD32 operator[] (UWORD32 i) ;
00066 
00067         UWORD32 getRange (void) const
00068                 { return Maximum ; } ;
00069 
00070         private:
00071         std::vector<UWORD32> X ;
00072         std::vector<UWORD32> Y ;
00073         sgi::hash_map<UWORD32,UWORD32> Xreversed ;
00075         UWORD32 Maximum ;
00077         UWORD32 NumInArray ;
00078         PseudoRandomSource* PRandom ;
00079 
00083         void calculate (UWORD32 m) ;
00084 
00092         bool idxX (UWORD32 v, UWORD32 m, UWORD32* p) const ;
00093 
00097         void setX (UWORD32 i, UWORD32 v) ;
00098 } ;
00099 
00100 #endif // ndef SH_SELECTOR_H

Generated on Thu Nov 13 23:44:21 2003 for steghide by doxygen 1.3.3