Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / object / cset.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: cset.h /main/5 1996/06/11 17:24:03 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 _cset_h
52 #define _cset_h 1
53
54 #include "utility/filter.h"
55 #include "object/composite.h"
56 #include "index/index.h"
57
58 /***************************************
59 * a set class.
60 ****************************************/
61
62 class cset: public composite
63 {
64
65 protected:
66    c_index_handlerPtr *indices; 
67    unsigned int num_indices;
68
69 public:
70
71 // indices[] array elements:
72 //      [0]: oid index;
73 //      [1]: whole object index;
74 //      [2]: component 1 index;
75 //      [3]: component 2 index;
76 //         ... ...    
77 //      [n+1]: component n object index.
78
79    cset( c_code_t c_id = SET_CODE );
80    virtual ~cset();
81
82    void init_data_member(c_index_handlerPtr* indices, 
83                       int num_indices
84                      );
85
86    MMDB_SIGNATURES(cset);
87
88 /*
89 // value comparison functions
90    virtual Boolean value_EQ(root&, Boolean safe = true) const ;
91    virtual Boolean value_LS(root&, Boolean safe = true) const ;
92 */
93
94 // iteration over components
95 // no delete to returned component if comp is zero when passed in. 
96    virtual handler* get_component(int index) ;
97
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);
101
102    virtual oid_t get_first_oid(const handler& query, int index);
103
104 // get a pointer to an index
105    virtual c_index_handler* get_index_ptr(int index);
106
107 // insert/remove a component
108    virtual Boolean insert_object(const handler&) ;
109    virtual Boolean remove_component(const oid_t&) ;
110
111 // update a component 
112    virtual Boolean update_index( handler* old_comp_obj, 
113                                  handler* new_comp_obj, 
114                                  int index,
115                                  oid_t& main_obj_oid
116                                 );
117
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&);
122
123    void commit(); // for commit all components
124
125
126 // init/quit batch index 
127    void batch_index_begin();
128    void batch_index_end();
129
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); 
134
135 // object instance in/out function
136    io_status asciiIn(istream& s) ;
137    io_status asciiOut(ostream& s) ;
138
139 };
140
141 typedef cset* csetPtr;
142
143
144 HANDLER_SIGNATURES(cset)
145    
146 #endif