Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / object / oid_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: oid_list.h /main/5 1996/07/18 14:43:51 drk $
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 _oid_list_h
52 #define _oid_list_h 1
53
54 #include "utility/ostring.h"
55 #include "dstr/dlist.h"
56 #include "dstr/dlist_void_ptr_cell.h"
57 #include "object/oid.h"
58 #include "object/composite.h"
59 #include "storage/page_storage.h"
60 #include "storage/chunks_index.h"
61
62 /***************************************
63 * Primitive string class.
64 ****************************************/
65
66 class oid_list: public composite
67 {
68 protected:
69    Boolean f_internal_index;
70    chunks_index* chk_index;
71
72    union {
73       mmdb_pos_t loc;
74       ostring* p;
75    } list_ptr;
76
77 protected:
78 // init the list (memory resident) with sz dummy oid_ts
79    void init_data_member(int sz);    
80
81 public:
82    void init_persistent_info(persistent_info* x);
83
84
85    oid_list(oid_list&);
86    oid_list(c_code_t = OID_LIST_CODE);
87    oid_list(int num_oids, c_code_t);
88    virtual ~oid_list();
89
90 // expand the list to include extra x oids.
91 // handle both the memory and disk list.
92    Boolean expand_space(int x);
93
94    void build_internal_index(); // set up an index on the list
95    void reqest_build_internal_index(); 
96                                // request building an internal 
97                                // index in the operator()
98
99    MMDB_SIGNATURES(oid_list);
100
101    virtual oid_t operator()(int);
102
103 // insert a component
104    virtual Boolean insert_component(const oid_t&);
105
106 // update a component
107    virtual Boolean update_component(int index, const oid_t&);
108
109 // remove a component
110    virtual Boolean remove_component(const oid_t&);
111
112 // print function
113    virtual io_status asciiOut(ostream&) ;
114    virtual io_status asciiIn(istream&) ;
115
116 // compacted disk representation In and Out functions
117    virtual int cdr_sizeof();
118    virtual io_status cdrOut(buffer&);
119    virtual io_status cdrIn(buffer&);
120
121    friend class oid_list_handler;
122 };
123
124 typedef oid_list* oid_listPtr;
125
126 /*
127 #endif
128    
129 #ifndef _oid_list_handler_h
130 #define _oid_list_handler_h 1
131 */
132
133 class oid_list_handler : public handler
134 {
135
136 public:
137    oid_list_handler(int num_oids, storagePtr = 0);
138    oid_list_handler(const oid_t&, storagePtr = 0);
139    virtual ~oid_list_handler();
140
141    oid_list* operator ->();
142 };
143
144    
145 #endif