CUBRID Engine  latest
load_object_table.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * load_object_table.h: Object table definitions
21  */
22 
23 #ifndef _LOAD_OBJECT_TABLE_H_
24 #define _LOAD_OBJECT_TABLE_H_
25 
26 #include "oid.h"
27 #include "work_space.h"
28 
29 /*
30  * INST_FLAG_
31  * These define the allowed values for the flags field of
32  * the INST_INFO structure.
33  */
34 #define INST_FLAG_RESERVED 1
35 #define INST_FLAG_INSERTED 2
36 #define INST_FLAG_CLASS_ATT 4
37 
38 /*
39  * INST_INFO
40  * Structure maintained inside a CLASS_TABLE.
41  * The instance table is maintained as an array indexed by instance id.
42  * Each class will have an instance array that grows as necessary.
43  * This really should be replaced with the fh_ file hashing module.
44  */
45 typedef struct instance_info INST_INFO;
47 {
49  int flags;
50 };
51 
52 /*
53  * CLASS_TABLE
54  * This holds information about the classes being populated by the loader.
55  * Each class in the loader input file will have an entry on this list.
56  */
57 typedef struct class_table CLASS_TABLE;
59 {
60  struct class_table *next;
61 
64  int count;
65  int presize;
66 
68 };
69 
70 /* mapping */
71 typedef int (*OTABLE_MAPFUNC) (CLASS_TABLE * class_, OID * oid);
72 
73 /* The global class table */
74 extern CLASS_TABLE *Classes;
75 
76 /* class table maintenance */
77 extern int otable_presize (MOP class_, int size);
78 extern void otable_set_presize (CLASS_TABLE * table, int size);
79 extern int otable_insert (CLASS_TABLE * table, OID * instance, int id);
80 extern int otable_reserve (CLASS_TABLE * table, OID * instance, int id);
81 extern int otable_update (CLASS_TABLE * table, int id);
82 extern void otable_class_att_ref (INST_INFO * inst);
84 extern INST_INFO *otable_find (CLASS_TABLE * table, int id);
85 
86 /* module control */
87 extern int otable_prepare (void);
88 extern int otable_init (void);
89 extern void otable_final (void);
90 
91 extern int otable_map_reserved (OTABLE_MAPFUNC mapfunc, int stop_on_error);
92 
93 #endif /* _LOAD_OBJECT_TABLE_H_ */
CLASS_TABLE * Classes
INST_INFO * instances
int otable_update(CLASS_TABLE *table, int id)
INST_INFO * otable_find(CLASS_TABLE *table, int id)
int otable_map_reserved(OTABLE_MAPFUNC mapfunc, int stop_on_error)
struct class_table * next
void otable_set_presize(CLASS_TABLE *table, int size)
int(* OTABLE_MAPFUNC)(CLASS_TABLE *class_, OID *oid)
int otable_init(void)
int otable_prepare(void)
int otable_presize(MOP class_, int size)
entry_workpool * instance
int otable_reserve(CLASS_TABLE *table, OID *instance, int id)
void otable_class_att_ref(INST_INFO *inst)
CLASS_TABLE * otable_find_class(MOP class_)
void otable_final(void)
int otable_insert(CLASS_TABLE *table, OID *instance, int id)