Annotation of parser3/src/include/pa_pool.h, revision 1.10

1.1       paf         1: /*
1.10    ! paf         2:   $Id: pa_pool.h,v 1.9 2001/01/29 10:15: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.1       paf        23:        }
1.9       paf        24:        String& make_string(char *src) {
                     25:                return *new(this) String(this, src);
1.5       paf        26:        }
1.9       paf        27:        Hash& make_hash() {
1.10    ! paf        28:                return *new(this) Hash(this, false);
        !            29:        }
        !            30:        Hash& make_thread_safe_hash() {
        !            31:                return *new(this) Hash(this, true);
1.7       paf        32:        }
1.9       paf        33:        Array& make_array() {
                     34:                return *new(this) Array(this);
1.7       paf        35:        }
1.9       paf        36:        Array& make_array(int initial_rows) {
                     37:                return *new(this) Array(this, initial_rows);
1.1       paf        38:        }
1.8       paf        39: 
                     40: private: //disabled
                     41: 
                     42:        Pool& operator = (Pool& src) { return *this; }
                     43:        Pool(Pool& src) {}
1.1       paf        44: };
                     45: 
                     46: #endif

E-mail: