Hash map (a.k.a. dictionary) is a useful and convenient data structure. Bada SDK provides HashMap and HashMapT classes implementing it. I normally used the templated version of it, HashMapT. However, I came across the fact that it supported neither base class String nor DateTime out-of-box.
The following classes, children of IHashCodeProviderT<> and IComparerT<>, solve this misunderstanding:
/* * HashMapTExtensions.h */#ifndef HASHMAPTEXTENSIONS_H_#define HASHMAPTEXTENSIONS_H_#include<FBase.h>// The following *KeyHashCodeProvider classes are required to use// String and DateTime as a key for HashMapTclassStringKeyHashCodeProvider:publicOsp::Base::Collection::IHashCodeProviderT<Osp::Base::String>{public:virtualintGetHashCode(constOsp::Base::String&obj)const;};classDateTimeKeyHashCodeProvider:publicOsp::Base::Collection::IHashCodeProviderT<Osp::Base::DateTime>{public:virtualintGetHashCode(constOsp::Base::DateTime&obj)const;};// The following *KeyComparer classes are required to use// String and DateTime as a key for HashMapTclassStringKeyComparer:publicOsp::Base::Collection::IComparerT<Osp::Base::String>{public:virtualresultCompare(constOsp::Base::String&obj1,constOsp::Base::String&obj2,int&cmp)const;};classDateTimeKeyComparer:publicOsp::Base::Collection::IComparerT<Osp::Base::DateTime>{public:virtualresultCompare(constOsp::Base::DateTime&obj1,constOsp::Base::DateTime&obj2,int&cmp)const;};#endif /* HASHMAPTEXTENSIONS_H_ */