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

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

E-mail: