summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/tagmap.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-17 09:26:29 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-17 09:26:29 +0000
commitd061ced59276808138b8a62ca99c6530d0b179bf (patch)
treee08630dd72dce81f385643006b35aa9a802e657b /src/lib/util/tagmap.h
parent14e2b9acf31db5fbc78a1ece0548130e4d7bed24 (diff)
Created new template class tagged_list which manages a simple list
along with a tagmap. Changed memory regions, input ports, and devices to use this class. For devices, converted typenext and classnext fields into methods which dynamically search for the next item. Changed a number of macros to use the features of the class, removing the need for a bunch of helper functions.
Diffstat (limited to 'src/lib/util/tagmap.h')
-rw-r--r--src/lib/util/tagmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h
index b6e771f815c..2a22ad74222 100644
--- a/src/lib/util/tagmap.h
+++ b/src/lib/util/tagmap.h
@@ -116,6 +116,9 @@ tagmap_error tagmap_add_unique_hash(tagmap *map, const char *tag, void *object,
/* remove an entry from a tagmap */
void tagmap_remove(tagmap *map, const char *tag);
+/* remove an entry from a tagmap by object pointer */
+void tagmap_remove_object(tagmap *map, void *object);
+
/***************************************************************************
@@ -140,6 +143,7 @@ public:
tagmap_error add(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add(this, tag, (void *)object, replace_if_duplicate); }
tagmap_error add_unique_hash(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add_unique_hash(this, tag, (void *)object, replace_if_duplicate); }
void remove(const char *tag) { tagmap_remove(this, tag); }
+ void remove(T object) { tagmap_remove_object(this, object); }
T find(const char *tag) const { return reinterpret_cast<T>(tagmap_find(this, tag)); }
T find(const char *tag, UINT32 hash) const { return reinterpret_cast<T>(tagmap_find_prehashed(this, tag, hash)); }