WvStreams
unistress.cc
1 #include "uniconfroot.h"
2 #include "wvstream.h"
3 #include "wvtimeutils.h"
4 
5 int main(int argc, char **argv)
6 {
7  const char *mon = (argc > 1) ? argv[1] : "ini:/tmp/big.cfg";
8  wvcon->print("Using uniconf moniker '%s'\n", mon);
9 
10  UniConfRoot cfg(mon);
11  UniConf c2(cfg["/uids"]);
12  WvTime start;
13  int count;
14 
15  while (1)
16  {
17  for (start = wvtime(), count = 0;
18  msecdiff(wvtime(), start) < 5000;
19  count++)
20  {
21  if (!cfg.whichmount() || !cfg.whichmount()->isok())
22  {
23  wvcon->print("not isok! aborting.\n");
24  return 1;
25  }
26 
27  UniConf::Iter i(c2);//cfg["/uids"]);
28  for (i.rewind(); i.next(); )
29  {
30  UniConf c(*i);
31  WvString v(i._value());
32  }
33  }
34 
35  wvcon->print("%s iters/sec (%s in 5ms)\n",
36  count/5, count);
37  }
38 
39  return 0;
40 }
WvTime
Based on (and interchangeable with) struct timeval.
Definition: wvtimeutils.h:17
UniConf
UniConf instances function as handles to subtrees of a UniConf tree and expose a high-level interface...
Definition: uniconf.h:50
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
UniConfRoot
Represents the root of a hierarhical registry consisting of pairs of UniConfKeys and associated strin...
Definition: uniconfroot.h:73
UniConf::Iter
This iterator walks through all immediate children of a UniConf node.
Definition: uniconf.h:435