1 #ifndef __JTOOLS__JHASHCOLLECTION__
2 #define __JTOOLS__JHASHCOLLECTION__
21 namespace JPP {
using namespace JTOOLS; }
45 template<
class JElement_t,
class JEvaluator_t = JHashEvaluator>
58 typedef typename container_type::iterator
iterator;
82 for (
iterator i = this->begin(); i != this->end(); ++i) {
86 container_type::clear();
99 const int ival = this->
getValue(value);
123 const int ival = this->
getValue(value);
149 const int ival = this->
getValue(value);
151 if (!this->
router.has(ival)) {
155 return container_type::operator[](
router.get(ival)).second;
170 const int ival = this->
getValue(value);
173 return container_type::operator[](
router.get(ival)).second;
189 const int ival = this->
getValue(element);
191 if (!this->
router.has(ival)) {
193 container_type::push_back(element);
197 router.put(ival, distance(this->begin(), i));
217 iterator i = container_type::erase(pos);
219 for ( ; i != this->end(); ++i) {
233 for (
iterator i = __begin; i != __end; ++i) {
237 iterator i = container_type::erase(__begin, __end);
239 for ( ; i != this->end(); ++i) {
254 const int ival = this->
getValue(value);
256 if (this->
router.has(ival)) {
278 bool has(
const T& value)
const
297 for (
value_type element; n != 0 && in >> element; --n) {
298 object.insert(element);
314 int n =
object.size();
342 return container_type::insert(pos, element);
Interface for binary output.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JArgument< T >::argument_type argument_type
Interface for binary input.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Template for generic class types.
Exception for accessing an index in a collection that is outside of its range.