1 #ifndef __JTOOLS__JHASHMAP__
2 #define __JTOOLS__JHASHMAP__
22 namespace JPP {
using namespace JTOOLS; }
32 template<
class JEvaluator_t>
36 using JEvaluator_t::operator();
44 JEvaluator_t(evaluator)
54 template<
class JKey_t,
class JValue_t>
57 return JEvaluator_t::operator()(pair.first);
71 template<
class JKey_t,
class JValue_t,
class JEvaluator_t = JHashEvaluator>
73 public JHashCollection<std::pair<JKey_t, JValue_t>, JHashMapEvaluator<JEvaluator_t> >,
88 typedef typename container_type::iterator
iterator;
99 JHashMap(
const JEvaluator_t& evaluator = JEvaluator_t()) :
118 for (
iterator i = this->begin();
i != this->end(); ++
i) {
135 (*this)[
i->first] = value;
148 const int ival = this->
getValue(key);
150 if (!this->
router.has(ival)) {
154 return container_type::operator[](this->
router.get(ival)).second;
168 const int ival = this->
getValue(key);
170 if (this->
router.has(ival))
171 return container_type::operator[](this->
router.get(ival)).second;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose class for a hash collection of unique elements.
JArgument< T >::argument_type argument_type
Auxiliary data structure for handling std::ostream.
Template for generic class types.
Exception for accessing an index in a collection that is outside of its range.