- * You must provide a key name, which is case sensitive. If you provide a non-existent key name,
- * the function returns NULL, otherwise a pointer to the item referenced by the key is returned.
+ *
+ * @param key The key parameter is an arbitary string which identifies the extension data
+ * @param p If you provide a non-existent key, this value will be NULL. Otherwise a pointer to the item you requested will be placed in this templated parameter.
+ * @return Returns true if the item was found and false if it was nor, regardless of wether 'p' is NULL. This allows you to store NULL values in Extensible.
+ */
+ template<typename T> bool GetExt(const std::string &key, T* &p)
+ {
+ ExtensibleStore::iterator iter = this->Extension_Items.find(key);
+ if(iter != this->Extension_Items.end())
+ {
+ p = (T*)iter->second;
+ return true;
+ }
+ else
+ {
+ p = NULL;
+ return false;
+ }
+ }
+
+ /** Get an extension item.
+ *
+ * @param key The key parameter is an arbitary string which identifies the extension data
+ * @return Returns true if the item was found and false if it was not.
+ *
+ * This single-parameter version only checks if the key exists, it does nothing with
+ * the 'data' field and is probably only useful in conjunction with the single-parameter
+ * version of Extend().
+ */
+ bool GetExt(const std::string &key)
+ {
+ return (this->Extension_Items.find(key) != this->Extension_Items.end());
+ }
+
+ /** Get a list of all extension items names.
+ * @param list A deque of strings to receive the list
+ * @return This function writes a list of all extension items stored in this object by name into the given deque and returns void.