2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
24 * $XConsortium: oid_list.h /main/5 1996/07/18 14:43:51 drk $
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
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
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.
44 * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
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"
62 /***************************************
63 * Primitive string class.
64 ****************************************/
66 class oid_list: public composite
69 Boolean f_internal_index;
70 chunks_index* chk_index;
78 // init the list (memory resident) with sz dummy oid_ts
79 void init_data_member(int sz);
82 void init_persistent_info(persistent_info* x);
86 oid_list(c_code_t = OID_LIST_CODE);
87 oid_list(int num_oids, c_code_t);
90 // expand the list to include extra x oids.
91 // handle both the memory and disk list.
92 Boolean expand_space(int x);
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()
99 MMDB_SIGNATURES(oid_list);
101 virtual oid_t operator()(int);
103 // insert a component
104 virtual Boolean insert_component(const oid_t&);
106 // update a component
107 virtual Boolean update_component(int index, const oid_t&);
109 // remove a component
110 virtual Boolean remove_component(const oid_t&);
113 virtual io_status asciiOut(ostream&) ;
114 virtual io_status asciiIn(istream&) ;
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&);
121 friend class oid_list_handler;
124 typedef oid_list* oid_listPtr;
129 #ifndef _oid_list_handler_h
130 #define _oid_list_handler_h 1
133 class oid_list_handler : public handler
137 oid_list_handler(int num_oids, storagePtr = 0);
138 oid_list_handler(const oid_t&, storagePtr = 0);
139 virtual ~oid_list_handler();
141 oid_list* operator ->();