Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / object / dl_list.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 /*
24  * $XConsortium: dl_list.h /main/5 1996/06/11 17:24:17 cde-hal $
25  *
26  * Copyright (c) 1993 HAL Computer Systems International, Ltd.
27  * All rights reserved.  Unpublished -- rights reserved under
28  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
29  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
30  * OR DISCLOSURE.
31  * 
32  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
33  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
34  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
35  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
36  * INTERNATIONAL, LTD.
37  * 
38  *                         RESTRICTED RIGHTS LEGEND
39  * Use, duplication, or disclosure by the Government is subject
40  * to the restrictions as set forth in subparagraph (c)(l)(ii)
41  * of the Rights in Technical Data and Computer Software clause
42  * at DFARS 252.227-7013.
43  *
44  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
45  *                  1315 Dell Avenue
46  *                  Campbell, CA  95008
47  * 
48  */
49
50
51 #ifndef _dl_list_h
52 #define _dl_list_h 1
53
54 #include "utility/filter.h"
55 #include "object/composite.h"
56 #include "index/index.h"
57 #include "object/oid_list.h"
58 #include "object/dl_list_cell.h"
59
60 /***************************************
61 * dl_list class.
62 ****************************************/
63
64 class dl_list: public composite
65 {
66
67
68 public:
69    dl_list(c_code_t = DL_LIST_CODE);
70    dl_list(const dl_list&);
71    virtual ~dl_list();
72
73    void init_data_member(c_index_handlerPtr* indices, 
74                       int num_indices
75                      );
76
77    MMDB_SIGNATURES(dl_list);
78
79 /*
80 // value comparison functions
81    virtual Boolean value_EQ(root&, Boolean safe = true) const ;
82    virtual Boolean value_LS(root&, Boolean safe = true) const ;
83 */
84
85    virtual oid_t get_first_oid(const handler& query, int index);
86
87 // insert component functions. new_cell and old_cell
88 // are handlers to dl_list_cells already existing on
89 // the store 
90    Boolean insert_before(dl_list_cell_handler& new_cell,
91                          dl_list_cell_handler& old_cell
92                         );
93    Boolean insert_after(dl_list_cell_handler& new_cell,
94                         dl_list_cell_handler& old_cell
95                        );
96
97 // insert as head/tail cell. new_cell is a handler to a 
98 // del_list_cell already existing on the store
99    Boolean insert_as_head(const dl_list_cell_handler& new_cell);
100    Boolean insert_as_tail(dl_list_cell_handler& new_cell);
101
102 // iteration over components
103    virtual handler* get_component(int index) ;
104
105 // get a set of locs for element objects satisfying a 'query'
106 // 'index' indicates the index to be used. 
107    virtual oid_list_handler* get_locs(handler& query, int index)
108 ;
109
110 // first/last cell's oid.
111    oid_t first_cell_oid() const ;
112    oid_t last_cell_oid() const ;
113
114 // init/quit batch index
115    void batch_index_begin();
116    void batch_index_end();
117
118 // read in a set of object instances. Used with
119 // batch_index_begin() and batch_index_end() to
120 // load a mixed object stream
121    io_status batch_asciiIn(istream& s);
122
123 // instance in/out function
124    virtual io_status asciiOut(ostream&) ;
125    virtual io_status asciiIn(istream&) ;
126
127 // compacted disk representation In and Out functions
128    virtual int cdr_sizeof();
129    virtual io_status cdrOut(buffer&);
130    virtual io_status cdrIn(buffer&);
131    void commit();
132
133 protected:
134    Boolean insert_to_indices(const dl_list_cell_handler& new_cell);
135
136 protected:
137    oid_t v_dl_list_head;
138    oid_t v_dl_list_tail;
139
140    c_index_handlerPtr *v_indices;
141    unsigned int v_num_indices;
142 };
143
144 HANDLER_SIGNATURES(dl_list)
145    
146 #endif