diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-05-04T12·21+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-05-04T12·21+0000 |
commit | 0832956089516d32371060c98df4f8d0cbff2b0f (patch) | |
tree | ff054ab5727324f0de5bdc56460aeafded11f5f5 /src/libexpr/nixexpr.hh | |
parent | 9840368cad6088e4221fb323202861c97d70bb37 (diff) |
* Use the new ATermMap.
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r-- | src/libexpr/nixexpr.hh | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 298a9f0b949b..e3c7ee60745c 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -5,6 +5,7 @@ #include <aterm2.h> +#include "aterm-map.hh" #include "util.hh" @@ -16,44 +17,6 @@ typedef ATerm Expr; typedef ATerm Pos; -/* Mappings from ATerms to ATerms. This is just a wrapper around - ATerm tables. */ -class ATermMap -{ -private: - unsigned int maxLoadPct; - ATermTable table; - -public: - ATermMap(unsigned int initialSize = 64, unsigned int maxLoadPct = 75); - ATermMap(const ATermMap & map); - ~ATermMap(); - - ATermMap & operator = (const ATermMap & map); - - void set(ATerm key, ATerm value); - void set(const string & key, ATerm value); - - ATerm get(ATerm key) const; - ATerm get(const string & key) const; - - void remove(ATerm key); - void remove(const string & key); - - ATermList keys() const; - - void add(const ATermMap & map); - - void reset(); - -private: - void add(const ATermMap & map, ATermList & keys); - - void free(); - void copy(const ATermMap & map); -}; - - /* A STL vector of ATerms. Should be used with great care since it's stored on the heap, and the elements are therefore not roots to the ATerm garbage collector. */ |