Annotation of parser3/src/include/pa_vhash.h, revision 1.2

1.1       paf         1: /*
1.2     ! paf         2:   $Id: pa_vhash.h,v 1.1 2001/02/22 16:21:49 paf Exp $
1.1       paf         3: */
                      4: 
                      5: #ifndef PA_VHASH_H
                      6: #define PA_VHASH_H
                      7: 
                      8: #include "pa_value.h"
1.2     ! paf         9: #include "pa_hash.h"
1.1       paf        10: 
                     11: class VHash : public Value {
                     12: public: // value
                     13: 
                     14:        // all: for error reporting after fail(), etc
                     15:        const char *type() const { return "Hash"; }
                     16: 
                     17:        // hash: (key)=value
                     18:        Value *get_element(const String& name) { 
                     19:                return static_cast<Value *>(hash.get(name));
                     20:        }
                     21:        
                     22:        // hash: (key)=value
                     23:        void put_element(const String& name, Value *value) { 
                     24:                hash.put(name, value);
                     25:        }
                     26: 
                     27: public: // usage
                     28: 
                     29:        VHash(Pool& apool) : Value(apool), hash(apool) {}
                     30: 
                     31: private:
                     32:        Hash hash;
                     33: };
                     34: 
                     35: #endif

E-mail: