Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

unigremlin.h

Go to the documentation of this file.
00001 #ifndef __UNIGREMLIN_H
00002 #define __UNIGREMLIN_H
00003 
00004 #include "wvstring.h"
00005 #include "wvhashtable.h"
00006 #include "uniconfroot.h"
00007 #include "uniconfkey.h"
00008 
00009 struct Victim
00010 {
00011     int i;
00012     int type;
00013     WvString name;
00014     Victim(int _i, int _type, WvStringParm _name)
00015     { i = _i; type = _type; name = _name; }
00016 };
00017 DeclareWvDict(Victim, int, i);
00018 
00019 class UniConfGremlin
00020 {
00021 public:
00022     // runlevels are defined in curr_runlevel()
00023     UniConfGremlin(WvString moniker, const UniConfKey key = "", 
00024             int max_runlevel = 5);
00025     
00026     // FIXME: use_valid_data does not work when set to true yet
00027     void start(unsigned int seed = 0);
00028     void test(); 
00029     WvString status();
00030 private:
00031     // creates a list of the keys and expected values in the UniConf subtree
00032     void find_victims(UniConfKey _key);
00033 
00034     void change_value(bool use_valid_data = false);
00035     void add_value();
00036     
00037     // begin randomly changing key values, using only valid data if
00038     // use_valid_data is true
00039     void start_trouble(int curr_runlevel);
00040     
00041     // returns what it thinks is the expected data for this element
00042     int inspect(WvString element);
00043     bool is_bool(char *elem);
00044     
00045     // returns "" if type was not a known string type
00046     WvString rand_str(int type);
00047     WvString type_name(int type); 
00048     WvString curr_runlevel();
00049     
00050     UniConfRoot cfg;
00051     UniConfKey key;
00052     static VictimDict victims;
00053     int num_victims, max_runlevel, runlevel;
00054     WvString last_change;
00055 };
00056 #endif

Generated on Wed Dec 15 15:08:10 2004 for WvStreams by  doxygen 1.3.9.1