2 * Worldvisions Weaver Software:
3 * Copyright (C) 2002 Net Integration Technologies, Inc.
5 * A UniConfGen that makes everything slow.
10 #include "unifiltergen.h"
13 * A UniConfGen that counts all "potentially synchronous" (ie. slow)
14 * operations, so you'll know for sure if you're calling UniConf synchronous
15 * operations when you shouldn't be. Hint: wrapping this one in a
16 * UniCacheGen is supposed to cut slow operations to a bare minimum, so a
17 * good test is to try a moniker like this:
19 * cache:slow:tcp:localhost
21 * ...and see if everything still works but there are no slow operations.
23 * (A previous version of this used to actually make things slow by doing
24 * a deliberate sleep() on synchronous operations, but that wasn't really
25 * needed. Now it just logs them instead.)
27 class UniSlowGen
: public UniFilterGen
30 UniSlowGen(IUniConfGen
*inner
);
31 virtual ~UniSlowGen();
33 virtual void commit();
34 virtual bool refresh();
35 virtual void flush_buffers() { }
36 virtual WvString
get(const UniConfKey
&key
);
37 virtual bool exists(const UniConfKey
&key
);
38 virtual bool haschildren(const UniConfKey
&key
);
39 virtual Iter
*iterator(const UniConfKey
&key
);
40 virtual Iter
*recursiveiterator(const UniConfKey
&key
);
51 void be_slow(WvStringParm what
);
52 void be_slow(WVSTRING_FORMAT_DECL
)
53 { be_slow(WvString(WVSTRING_FORMAT_CALL
)); }
56 #endif //__UNISLOWGEN_H