diff --git a/src/core/default-value.h b/src/core/default-value.h index b43f013be..8d252ab45 100644 --- a/src/core/default-value.h +++ b/src/core/default-value.h @@ -97,6 +97,21 @@ class DefaultValueList static Iterator End (void); static void Remove (const std::string &name); static void Add (DefaultValueBase *defaultValue); + + template + static const T* Get (const std::string &name) + { + for (Iterator iter = Begin (); iter != End (); iter++) + { + const DefaultValueBase *value = *iter; + if (value->GetName () == name) + { + return dynamic_cast (value); + } + } + return NULL; + } + private: typedef std::list List; static List *GetList (void);