WvStreams
Main Page
Modules
Classes
Files
File List
File Members
xplc
catiter.cc
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
*
3
* XPLC - Cross-Platform Lightweight Components
4
* Copyright (C) 2004, Net Integration Technologies, Inc.
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation; either version 2.1 of
9
* the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19
* USA
20
*/
21
22
#include <
xplc/utils.h
>
23
#include "catiter.h"
24
25
UUID_MAP_BEGIN
(
CategoryIterator
)
26
UUID_MAP_ENTRY
(
IObject
)
27
UUID_MAP_ENTRY
(
ICategoryIterator
)
28
UUID_MAP_END
29
30
CategoryIterator
::
CategoryIterator
(
ICategory
* aCategory,
31
CategoryEntryNode
* aEntries):
32
category(aCategory),
33
current(aEntries) {
34
/*
35
* Prevent the category from dying, which in turn prevents the
36
* category manager from dying (which would free the list).
37
*/
38
category->
addRef
();
39
}
40
41
const
UUID
&
CategoryIterator::getUuid
() {
42
if
(current)
43
return
current->entry;
44
45
return
UUID_null;
46
}
47
48
const
char
*
CategoryIterator::getString
() {
49
if
(current)
50
return
current->str;
51
52
return
0;
53
}
54
55
void
CategoryIterator::next
() {
56
if
(current)
57
current = current->next;
58
}
59
60
bool
CategoryIterator::done
() {
61
return
current == 0;
62
}
63
64
CategoryIterator::~CategoryIterator() {
65
category->
release
();
66
}
67
Generated on Wed Aug 28 2019 23:57:17 for WvStreams by
1.8.3.1