Annotation of parser3/src/include/pa_pool.h, revision 1.11
1.1 paf 1: /*
1.11 ! paf 2: $Id: pa_pool.h,v 1.10 2001/01/29 12:13:14 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.1 paf 13:
14: class Pool {
15: public:
16: Pool();
17: ~Pool();
1.5 paf 18: void *malloc(size_t size);
1.1 paf 19: void *calloc(size_t size);
20:
1.9 paf 21: String& make_string() {
22: return *new(this) String(this);
1.5 paf 23: }
1.9 paf 24: Hash& make_hash() {
1.10 paf 25: return *new(this) Hash(this, false);
26: }
27: Hash& make_thread_safe_hash() {
28: return *new(this) Hash(this, true);
1.7 paf 29: }
1.9 paf 30: Array& make_array() {
31: return *new(this) Array(this);
1.7 paf 32: }
1.9 paf 33: Array& make_array(int initial_rows) {
34: return *new(this) Array(this, initial_rows);
1.1 paf 35: }
1.8 paf 36:
37: private: //disabled
38:
39: Pool& operator = (Pool& src) { return *this; }
40: Pool(Pool& src) {}
1.1 paf 41: };
42:
43: #endif
E-mail: