/* */ #include "Dictionary.h" #include "MetaEntryVisitor.h" Dictionary::Dictionary() {} Dictionary::~Dictionary() { clearTable(); } void Dictionary::clearTable() { for(MetaTable::iterator itr = table.begin(); itr != table.end(); itr++) { delete itr->second; } } const MetaEntry* Dictionary::get(const string& name) const { MetaTable::const_iterator itr = table.find(name); if(itr == table.end()) { return NULL; } else { return itr->second; } } void Dictionary::put(const string& name, MetaEntry* entry) { table[name] = entry; order.push_back(name); } void Dictionary::accept(MetaEntryVisitor* v) const { v->visit(this); } const Order& Dictionary::getOrder() const { return order; }