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: cset.h /main/5 1996/06/11 17:24:03 cde-hal $
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/filter.h"
55 #include "object/composite.h"
56 #include "index/index.h"
58 /***************************************
60 ****************************************/
62 class cset: public composite
66 c_index_handlerPtr *indices;
67 unsigned int num_indices;
71 // indices[] array elements:
73 // [1]: whole object index;
74 // [2]: component 1 index;
75 // [3]: component 2 index;
77 // [n+1]: component n object index.
79 cset( c_code_t c_id = SET_CODE );
82 void init_data_member(c_index_handlerPtr* indices,
86 MMDB_SIGNATURES(cset);
89 // value comparison functions
90 virtual Boolean value_EQ(root&, Boolean safe = true) const ;
91 virtual Boolean value_LS(root&, Boolean safe = true) const ;
94 // iteration over components
95 // no delete to returned component if comp is zero when passed in.
96 virtual handler* get_component(int index) ;
98 // get a set of locs for element objects satisfying a 'query'
99 // 'index' indicates the index to be used.
100 virtual oid_list_handler* get_locs(handler& query, int index);
102 virtual oid_t get_first_oid(const handler& query, int index);
104 // get a pointer to an index
105 virtual c_index_handler* get_index_ptr(int index);
107 // insert/remove a component
108 virtual Boolean insert_object(const handler&) ;
109 virtual Boolean remove_component(const oid_t&) ;
111 // update a component
112 virtual Boolean update_index( handler* old_comp_obj,
113 handler* new_comp_obj,
118 // compacted disk representation In and Out functions
119 virtual int cdr_sizeof();
120 virtual io_status cdrOut(buffer&);
121 virtual io_status cdrIn(buffer&);
123 void commit(); // for commit all components
126 // init/quit batch index
127 void batch_index_begin();
128 void batch_index_end();
130 // read in a set of object instances. Used with
131 // batch_index_begin() and batch_index_end() to
132 // load a mixed object stream
133 io_status batch_asciiIn(istream& s);
135 // object instance in/out function
136 io_status asciiIn(istream& s) ;
137 io_status asciiOut(ostream& s) ;
141 typedef cset* csetPtr;
144 HANDLER_SIGNATURES(cset)