WvStreams
debian
libwvstreams-dev
usr
include
wvstreams
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h
1
/* -*- Mode: C++ -*-
2
* Worldvisions Weaver Software:
3
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4
*
5
* UniConf low-level tree storage abstraction.
6
*/
7
#ifndef __UNIHASHTREE_H
8
#define __UNIHASHTREE_H
9
10
#include "uniconfkey.h"
11
#include "wvtr1.h"
12
#include "wvscatterhash.h"
13
14
class
UniHashTreeBase
;
15
16
// parameters: a node (won't be NULL), userdata
17
typedef
wv::function<void(
const
UniHashTreeBase
*,
18
void
*)> UniHashTreeBaseVisitor;
19
// parameters: 1st node (may be NULL), 2nd node (may be NULL), userdata
20
typedef
wv::function<bool(
const
UniHashTreeBase
*,
21
const
UniHashTreeBase
*)> UniHashTreeBaseComparator;
22
23
class
UniHashTreeBase
24
{
25
protected
:
26
struct
Accessor
27
{
28
static
const
UniConfKey
*get_key(
const
UniHashTreeBase
*obj)
29
{
return
&obj->
key
(); }
30
};
31
32
typedef
WvScatterHash<UniHashTreeBase, UniConfKey, Accessor>
Container
;
33
typedef
UniHashTreeBaseVisitor BaseVisitor;
34
typedef
UniHashTreeBaseComparator BaseComparator;
35
36
public
:
37
~UniHashTreeBase
();
38
40
const
UniConfKey
&
key
()
const
41
{
return
xkey; }
42
44
bool
haschildren
()
const
;
45
46
protected
:
47
UniHashTreeBase
(
UniHashTreeBase
*parent,
const
UniConfKey
&
key
);
48
49
UniConfKey
_fullkey(
const
UniHashTreeBase
*ancestor = NULL)
const
;
50
UniHashTreeBase
*_find(
const
UniConfKey
&
key
)
const
;
51
UniHashTreeBase
*_findchild(
const
UniConfKey
&
key
)
const
;
52
53
static
bool
_recursivecompare(
54
const
UniHashTreeBase
*a,
const
UniHashTreeBase
*b,
55
const
UniHashTreeBaseComparator &comparator);
56
57
static
void
_recursive_unsorted_visit(
58
const
UniHashTreeBase
*a,
59
const
UniHashTreeBaseVisitor &visitor,
void
*userdata,
60
bool
preorder,
bool
postorder);
61
62
UniHashTreeBase
*
xparent
;
63
Container
*
xchildren
;
65
private
:
66
void
_setparent(
UniHashTreeBase
*parent);
67
UniHashTreeBase
*_root()
const
;
68
70
void
link(
UniHashTreeBase
*node);
71
73
void
unlink(
UniHashTreeBase
*node);
74
75
UniConfKey
xkey;
77
protected
:
78
class
Iter
:
public
Container::Iter
79
{
80
public
:
81
Iter
(
UniHashTreeBase
&b) :
Container::Iter
(*b.
xchildren
) { }
82
};
83
friend
class
Iter
;
84
};
85
86
#endif
//__UNIHASHTREE_H
UniConfKey
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
Definition
debian/libwvstreams-dev/usr/include/wvstreams/uniconfkey.h:39
UniHashTreeBase::Iter
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:79
UniHashTreeBase
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:24
UniHashTreeBase::key
const UniConfKey & key() const
Returns the key field.
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:40
UniHashTreeBase::haschildren
bool haschildren() const
Returns true if the node has children.
Definition
unihashtree.cc:114
UniHashTreeBase::xchildren
Container * xchildren
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:63
UniHashTreeBase::xparent
UniHashTreeBase * xparent
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:62
WvScatterHash::Iter
Definition
debian/libwvstreams-dev/usr/include/wvstreams/wvscatterhash.h:181
WvScatterHash
Definition
debian/libwvstreams-dev/usr/include/wvstreams/wvscatterhash.h:126
UniHashTreeBase::Accessor
Definition
debian/libwvstreams-dev/usr/include/wvstreams/unihashtree.h:27
Generated by
1.9.8