28 #ifndef _CEGUINamedDefinitionCollator_h_
29 #define _CEGUINamedDefinitionCollator_h_
31 #include "CEGUI/Base.h"
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
47 template<
typename K,
typename V>
55 {
return d_values.size(); }
59 {
return d_values.at(idx).second; }
62 const V&
at(
size_t idx)
const
63 {
return d_values.at(idx).second; }
71 void set(
const K& key,
const V& val)
73 typename ValueArray::iterator i =
74 std::find_if(d_values.begin(), d_values.end(),
pred(key));
76 if (i != d_values.end())
79 d_values.push_back(std::make_pair(key, val));
83 typedef std::pair<K, V> Entry;
84 typedef std::vector<Entry CEGUI_VECTOR_ALLOC(Entry)> ValueArray;
89 pred(
const K& k) : d_k(k) {}
90 bool operator()(
const Entry& e)
91 {
return e.first == d_k; }
107 d_iter(iter.d_iter) {}
109 const V& operator*()
const
110 {
return d_iter->second; }
112 const V* operator->()
const
116 {
return d_iter == iter.d_iter; }
119 {
return !operator==(iter); }
149 d_iter = iter.d_iter;
154 typename ValueArray::const_iterator d_iter;
160 const_iterator end()
const
161 {
return const_iterator(d_values.end()); }
163 const_iterator find(
const K& key)
const
165 return const_iterator(std::find_if(d_values.begin(),
174 #if defined(_MSC_VER)
175 # pragma warning(pop)