Annotation of parser3/src/include/pa_pool.h, revision 1.12
1.1 paf 1: /*
1.12 ! paf 2: $Id: pa_pool.h,v 1.11 2001/01/29 14:00:39 paf Exp $
1.1 paf 3: */
4:
5: #ifndef PA_POOL_H
6: #define PA_POOL_H
7:
8: #include <stddef.h>
9:
1.4 paf 10: #include "pa_string.h"
1.5 paf 11: #include "pa_hash.h"
1.7 paf 12: #include "pa_array.h"
1.12 ! paf 13: #include "pa_table.h"
1.1 paf 14:
15: class Pool {
16: public:
17: Pool();
18: ~Pool();
1.5 paf 19: void *malloc(size_t size);
1.1 paf 20: void *calloc(size_t size);
21:
1.9 paf 22: String& make_string() {
23: return *new(this) String(this);
1.5 paf 24: }
1.9 paf 25: Hash& make_hash() {
1.10 paf 26: return *new(this) Hash(this, false);
27: }
28: Hash& make_thread_safe_hash() {
29: return *new(this) Hash(this, true);
1.7 paf 30: }
1.9 paf 31: Array& make_array() {
32: return *new(this) Array(this);
1.7 paf 33: }
1.9 paf 34: Array& make_array(int initial_rows) {
35: return *new(this) Array(this, initial_rows);
1.1 paf 36: }
1.12 ! paf 37: Table& make_table(char *afile, uint aline, Array *acolumns, int initial_rows) {
! 38: return *new(this) Table(this, afile, aline, acolumns, initial_rows);
! 39: }
1.8 paf 40:
41: private: //disabled
42:
1.12 ! paf 43: Pool(Pool&) {}
! 44: Pool& operator = (Pool&) { return *this; }
1.1 paf 45: };
46:
47: #endif
E-mail: