27 #ifndef _CEGUINamedDefinitionCollator_h_
28 #define _CEGUINamedDefinitionCollator_h_
30 #include "CEGUI/Base.h"
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
46 template<
typename K,
typename V>
54 {
return d_values.size(); }
58 {
return d_values.at(idx).second; }
61 const V&
at(
size_t idx)
const
62 {
return d_values.at(idx).second; }
70 void set(
const K& key,
const V& val)
72 typename ValueArray::iterator i =
73 std::find_if(d_values.begin(), d_values.end(),
pred(key));
75 if (i != d_values.end())
78 d_values.push_back(std::make_pair(key, val));
82 typedef std::pair<K, V> Entry;
83 typedef std::vector<Entry CEGUI_VECTOR_ALLOC(Entry)> ValueArray;
88 pred(
const K& k) : d_k(k) {}
89 bool operator()(
const Entry& e)
90 {
return e.first == d_k; }
106 d_iter(iter.d_iter) {}
111 const V& operator*()
const
112 {
return d_iter->second; }
114 const V* operator->()
const
118 {
return d_iter == iter.d_iter; }
121 {
return !operator==(iter); }
151 d_iter = iter.d_iter;
156 typename ValueArray::const_iterator d_iter;
162 const_iterator end()
const
163 {
return const_iterator(d_values.end()); }
165 const_iterator find(
const K& key)
const
167 return const_iterator(std::find_if(d_values.begin(),
176 #if defined(_MSC_VER)
177 # pragma warning(pop)