WvStreams
include/unislowgen.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2002 Net Integration Technologies, Inc.
4 *
5 * A UniConfGen that makes everything slow.
6 */
7#ifndef __UNISLOWGEN_H
8#define __UNISLOWGEN_H
9
10#include "unifiltergen.h"
11
27class UniSlowGen : public UniFilterGen
28{
29public:
31 virtual ~UniSlowGen();
32
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);
41
42 int how_slow() const
43 { return slowcount; }
44
45 void reset_slow()
46 { slowcount = 0; }
47
48private:
49 int slowcount;
50
51 void be_slow(WvStringParm what);
52 void be_slow(WVSTRING_FORMAT_DECL)
53 { be_slow(WvString(WVSTRING_FORMAT_CALL)); }
54};
55
56#endif //__UNISLOWGEN_H
An abstract data container that backs a UniConf tree.
An abstract iterator over keys and values in a generator.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
A UniConfGen that delegates all requests to an inner generator.
IUniConfGen * inner() const
Returns the inner generator.
A UniConfGen that counts all "potentially synchronous" (ie.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual bool refresh()
Refreshes information about a key recursively.
virtual void flush_buffers()
Flushes any commitment/notification buffers .
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual void commit()
Commits any changes.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
WvString is an implementation of a simple and efficient printable-string class.