Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / oliasdb / collectionIterator.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: collectionIterator.h /main/3 1996/06/11 17:28:33 cde-hal $ */
24
25 #ifndef _collection_iterator_h
26 #define _collection_iterator_h 1
27
28 #include "api/info_base.h"
29 #include "object/cset.h"
30
31 // collectionIterator iterates over MMDB's cset objects through
32 // index.
33
34 class collectionIterator
35 {
36 public:
37    collectionIterator(info_base*, int set_position);
38    ~collectionIterator();
39
40 // advance the iterator to the next position.
41 // A newly constructed iterator's position is
42 // undefined. This operator must be called to
43 // advance to the 1st position.
44
45 // return 1 if advance successful and 0 otherwize.
46    virtual unsigned int operator++() ;
47
48 protected:
49    oid_t get_oid(int index);
50
51 protected:
52    int f_index;
53    cset_handler* f_set_ptr;
54    info_base* f_base;
55 };
56
57 // iterator over node set
58 class nodeCollectionIterator : public collectionIterator
59 {
60
61 public:
62    nodeCollectionIterator(info_base*);
63    ~nodeCollectionIterator();
64
65    const char* get_locator();
66 };
67
68 // iterator over graphic set
69 class graphicCollectionIterator : public collectionIterator
70 {
71
72 public:
73    graphicCollectionIterator(info_base*);
74    ~graphicCollectionIterator();
75
76    const char* get_locator();
77 };
78
79 // iterator over stylesheet set
80 class stylesheetCollectionIterator : public collectionIterator
81 {
82
83 public:
84    stylesheetCollectionIterator(info_base*);
85    ~stylesheetCollectionIterator();
86
87    const char* get_locator();
88 };
89
90 // iterator over locator set
91 class locatorCollectionIterator : public collectionIterator
92 {
93
94 public:
95    locatorCollectionIterator(info_base*);
96    ~locatorCollectionIterator();
97
98    const char* get_locator();
99 };
100
101 #endif