Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / schema / store_desc.h
1 /*
2  * $XConsortium: store_desc.h /main/6 1996/07/18 14:51:13 drk $
3  *
4  * Copyright (c) 1993 HAL Computer Systems International, Ltd.
5  * All rights reserved.  Unpublished -- rights reserved under
6  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
7  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
8  * OR DISCLOSURE.
9  * 
10  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
11  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
12  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
13  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
14  * INTERNATIONAL, LTD.
15  * 
16  *                         RESTRICTED RIGHTS LEGEND
17  * Use, duplication, or disclosure by the Government is subject
18  * to the restrictions as set forth in subparagraph (c)(l)(ii)
19  * of the Rights in Technical Data and Computer Software clause
20  * at DFARS 252.227-7013.
21  *
22  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
23  *                  1315 Dell Avenue
24  *                  Campbell, CA  95008
25  * 
26  */
27
28
29 #ifndef _store_desc_h
30 #define _store_desc_h 1
31
32 #include "object/handler.h"
33 #include "schema/desc.h"
34
35 #include "storage/lru.h"
36 #include "storage/page_storage.h"
37 #include "storage/unixf_storage.h"
38
39 #define NUM_FILES 20
40 #define ACTIVE_UNIXF_SZ NUM_FILES
41 #define INACTIVE_UNIXF_SZ 1000
42
43
44 class store_desc : public desc 
45 {
46
47 public:
48    store_desc(const char* name);
49    store_desc(int class_code, const char* comment = "");
50    ~store_desc();
51
52    virtual abs_storage* get_store() { 
53      return v_store_ptr; 
54    };
55
56    void set_mode(const char*);
57    void set_order(const char*);
58
59    int get_mode();
60    mmdb_byte_order_t get_order();
61
62    virtual ostream& asciiOut(ostream& out, Boolean last = true);
63
64 protected:
65 /*
66    char mode_str[NAMESIZ];
67    char order_str[NAMESIZ];
68 */
69
70 #ifdef C_API
71    static lru* v_unixf_pool_ptr;
72 #define v_unixf_pool (*v_unixf_pool_ptr)
73 #else
74    static lru v_unixf_pool;
75 #endif
76
77    abs_storage* v_store_ptr; 
78
79 private:
80    char* mode_str;
81    char* order_str;
82
83 #ifdef C_API
84    friend void initialize_MMDB();
85    friend void quit_MMDB();
86 #endif
87 };
88
89 class page_store_desc : public store_desc 
90 {
91
92 public:
93    page_store_desc();
94    ~page_store_desc() {};
95
96    abs_storage* init_store(char* store_path);
97
98    void sync_store();
99    void quit_store();
100
101    void set_page_sz(int);
102    void set_cached_pages(int);
103
104    virtual ostream& asciiOut(ostream& out, Boolean last = true);
105
106 protected:
107    int page_sz;
108    int cached_pages;
109 };
110
111 #endif