Jpp  18.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
JACOUSTICS::JModel::hash_map< key_type, value_type > Struct Template Reference

Auxiliary data structure with extended functionality of hash-map. More...

#include <JModel.hh>

Inheritance diagram for JACOUSTICS::JModel::hash_map< key_type, value_type >:
JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t >, JHashMapEvaluator< JEvaluator_t > > JTOOLS::JMappableCollection< JKey_t, JValue_t > std::vector< std::pair< JKey_t, JValue_t > >

Public Types

typedef JKey_t key_type
 
typedef JValue_t mapped_type
 
typedef std::pair< JKey_t,
JValue_t > 
value_type
 
typedef JHashMapEvaluator
< JEvaluator_t > 
evaluator_type
 
typedef JHashCollection
< value_type, evaluator_type
collection_type
 
typedef
collection_type::container_type 
container_type
 
typedef
container_type::const_iterator 
const_iterator
 
typedef
container_type::const_reverse_iterator 
const_reverse_iterator
 
typedef container_type::iterator iterator
 
typedef
container_type::reverse_iterator 
reverse_iterator
 

Public Member Functions

size_t getN (const JMODEL::JOption_t option) const
 Get number of fit parameters. More...
 
size_t getIndex (const key_type key, double value_type::*p, const JMODEL::JOption_t option) const
 Get index of parameter. More...
 
double getParameter (const size_t index, const JMODEL::JOption_t option) const
 Get read access to fit parameter value at given index in buffer. More...
 
double & getParameter (const size_t index, const JMODEL::JOption_t option)
 Get read/write access to fit parameter value at given index in buffer. More...
 
void evaluate (value_type &(value_type::*f1)())
 Evaluate arithmetic operation. More...
 
void evaluate (const hash_map &buffer, value_type &(value_type::*f1)(const value_type &))
 Evaluate arithmetic operation. More...
 
void evaluate (value_type &(value_type::*f1)(const double), const double factor)
 Evaluate arithmetic operation. More...
 
bool equals (const hash_map &buffer) const
 Check equality of hash map. More...
 
bool equals (const hash_map &buffer, const double precision) const
 Check equality of has map. More...
 
virtual void clear () override
 Clear. More...
 
void reset ()
 Reset values. More...
 
void set (const JHashMap &source, const mapped_type &value)
 Set values corresponding to keys in given source. More...
 
virtual mapped_typeget (typename JClass< key_type >::argument_type key) override
 Get mapped value. More...
 
virtual const mapped_typeget (typename JClass< key_type >::argument_type key) const override
 Get mapped value. More...
 
value_typeget (const T &value)
 Get element with given value. More...
 
const value_typeget (const T &value) const
 Get element with given value. More...
 
void swap (JHashCollection &collection)
 Swap hash collection. More...
 
const_iterator find (const T &value) const
 Find element with given value. More...
 
iterator find (const T &value)
 Find element with given value. More...
 
virtual bool insert (const value_type &element)
 Insert element. More...
 
void insert (T __begin, T __end)
 Insert values. More...
 
void erase (iterator pos)
 Erase element at given position. More...
 
void erase (iterator __begin, iterator __end)
 Erase elements in given range. More...
 
bool erase (const T &value)
 Erase element with given value. More...
 
bool has (const T &value) const
 Test whether given value is present. More...
 
int getIndex (const T &value) const
 Get index of given value. More...
 
const mapped_typeoperator[] (typename JClass< key_type >::argument_type key) const
 Get mapped value. More...
 
mapped_typeoperator[] (typename JClass< key_type >::argument_type key)
 Get mapped value. More...
 
void put (typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value)
 Put pair-wise element (key,value) into collection. More...
 

Public Attributes

JHashMapEvaluator< JEvaluator_t > getValue
 Function object for evaluation of element. More...
 

Protected Attributes

JTOOLS::JHashCollection::router_type router
 

Detailed Description

template<class key_type, class value_type>
struct JACOUSTICS::JModel::hash_map< key_type, value_type >

Auxiliary data structure with extended functionality of hash-map.

Definition at line 791 of file JAcoustics/JModel.hh.

Member Typedef Documentation

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JKey_t JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::key_type
inherited

Definition at line 78 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JValue_t JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::mapped_type
inherited

Definition at line 79 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef std::pair<JKey_t, JValue_t> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::value_type
inherited

Definition at line 80 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JHashMapEvaluator<JEvaluator_t> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::evaluator_type
inherited

Definition at line 81 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef JHashCollection<value_type, evaluator_type> JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::collection_type
inherited

Definition at line 83 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef collection_type::container_type JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::container_type
inherited

Definition at line 84 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::const_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::const_iterator
inherited

Definition at line 86 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::const_reverse_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::const_reverse_iterator
inherited

Definition at line 87 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::iterator
inherited

Definition at line 88 of file JHashMap.hh.

template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
typedef container_type::reverse_iterator JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::reverse_iterator
inherited

Definition at line 89 of file JHashMap.hh.

Member Function Documentation

template<class key_type, class value_type>
size_t JACOUSTICS::JModel::hash_map< key_type, value_type >::getN ( const JMODEL::JOption_t  option) const
inline

Get number of fit parameters.

Parameters
optionoption
Returns
number of parameters

Definition at line 800 of file JAcoustics/JModel.hh.

801  {
802  return this->size() * value_type::getN(option);
803  }
JMODEL::JOption_t option
double getN(const JRange< T > &range, const double R)
Get expected number of occurrences due to given rate within specified interval.
Definition: JRange.hh:704
template<class key_type, class value_type>
size_t JACOUSTICS::JModel::hash_map< key_type, value_type >::getIndex ( const key_type  key,
double value_type::*  p,
const JMODEL::JOption_t  option 
) const
inline

Get index of parameter.

Parameters
keykey
ppointer to data member
optionoption
Returns
index

Definition at line 814 of file JAcoustics/JModel.hh.

815  {
816  value_type* __p__ = NULL;
817 
818  if (this->has(key))
819  return static_cast<const JHashMap<key_type, value_type>&>(*this).getIndex(key) * value_type::getN(option) + ((double*) &(__p__->*p) - (double*) __p__);
820  else
821  THROW(JValueOutOfRange, "Invalid key " << key);
822  }
JMODEL::JOption_t option
double getN(const JRange< T > &range, const double R)
Get expected number of occurrences due to given rate within specified interval.
Definition: JRange.hh:704
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
std::pair< JKey_t, JValue_t > value_type
Definition: JHashMap.hh:80
bool has(const T &value) const
Test whether given value is present.
template<class key_type, class value_type>
double JACOUSTICS::JModel::hash_map< key_type, value_type >::getParameter ( const size_t  index,
const JMODEL::JOption_t  option 
) const
inline

Get read access to fit parameter value at given index in buffer.

Parameters
indexindex
optionoption
Returns
value

Definition at line 832 of file JAcoustics/JModel.hh.

833  {
834  const size_t pos = index / value_type::getN(option); // position of element in buffer
835  const size_t offset = index % value_type::getN(option); // offset of parameter in element
836 
837  const value_type& value = this->data()[pos].second; // value of element at given position
838 
839  return ((const double*) &value)[offset]; // parameter at given offset
840  }
JMODEL::JOption_t option
double getN(const JRange< T > &range, const double R)
Get expected number of occurrences due to given rate within specified interval.
Definition: JRange.hh:704
std::pair< JKey_t, JValue_t > value_type
Definition: JHashMap.hh:80
template<class key_type, class value_type>
double& JACOUSTICS::JModel::hash_map< key_type, value_type >::getParameter ( const size_t  index,
const JMODEL::JOption_t  option 
)
inline

Get read/write access to fit parameter value at given index in buffer.

Parameters
indexindex
optionoption
Returns
value

Definition at line 850 of file JAcoustics/JModel.hh.

851  {
852  const size_t pos = index / value_type::getN(option); // position of element in buffer
853  const size_t offset = index % value_type::getN(option); // offset of parameter in element
854 
855  value_type& value = this->data()[pos].second; // value of element at given position
856 
857  return ((double*) &value)[offset]; // parameter at given offset
858  }
JMODEL::JOption_t option
double getN(const JRange< T > &range, const double R)
Get expected number of occurrences due to given rate within specified interval.
Definition: JRange.hh:704
std::pair< JKey_t, JValue_t > value_type
Definition: JHashMap.hh:80
template<class key_type, class value_type>
void JACOUSTICS::JModel::hash_map< key_type, value_type >::evaluate ( value_type &(value_type::*)()  f1)
inline

Evaluate arithmetic operation.

Parameters
f1operation

Definition at line 866 of file JAcoustics/JModel.hh.

867  {
868  for (typename JHashMap<key_type, value_type>::iterator i = this->begin(); i != this->end(); ++i) {
869  (i->second.*f1)();
870  }
871  }
const JPolynome f1(1.0, 2.0, 3.0)
Function.
container_type::iterator iterator
Definition: JHashMap.hh:88
template<class key_type, class value_type>
void JACOUSTICS::JModel::hash_map< key_type, value_type >::evaluate ( const hash_map< key_type, value_type > &  buffer,
value_type &(value_type::*)(const value_type &)  f1 
)
inline

Evaluate arithmetic operation.

Parameters
bufferbuffer
f1operation

Definition at line 880 of file JAcoustics/JModel.hh.

881  {
882  for (typename JHashMap<key_type, value_type>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
883  ((*this)[i->first].*f1)(i->second);
884  }
885  }
const JPolynome f1(1.0, 2.0, 3.0)
Function.
container_type::const_iterator const_iterator
Definition: JHashMap.hh:86
template<class key_type, class value_type>
void JACOUSTICS::JModel::hash_map< key_type, value_type >::evaluate ( value_type &(value_type::*)(const double)  f1,
const double  factor 
)
inline

Evaluate arithmetic operation.

Parameters
f1operation
factorfactor

Definition at line 894 of file JAcoustics/JModel.hh.

895  {
896  for (typename JHashMap<key_type, value_type>::iterator i = this->begin(); i != this->end(); ++i) {
897  (i->second.*f1)(factor);
898  }
899  }
const JPolynome f1(1.0, 2.0, 3.0)
Function.
container_type::iterator iterator
Definition: JHashMap.hh:88
template<class key_type, class value_type>
bool JACOUSTICS::JModel::hash_map< key_type, value_type >::equals ( const hash_map< key_type, value_type > &  buffer) const
inline

Check equality of hash map.

Parameters
bufferbuffer
Returns
true if hash map is equal; else false

Definition at line 908 of file JAcoustics/JModel.hh.

909  {
911  p = this->begin(),
912  q = buffer.begin(); ; ++p, ++q) {
913 
914  if (p != this->end() && q != buffer.end()) {
915 
916  if (p->first != q->first || p->second != q->second) {
917  return false;
918  }
919 
920  } else if (p == this->end() && q == buffer.end()) {
921 
922  return true;
923 
924  } else {
925 
926  return false;
927  }
928  }
929  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:86
template<class key_type, class value_type>
bool JACOUSTICS::JModel::hash_map< key_type, value_type >::equals ( const hash_map< key_type, value_type > &  buffer,
const double  precision 
) const
inline

Check equality of has map.

Parameters
bufferbuffer
precisionprecision
Returns
true if hash map is equal; else false

Definition at line 939 of file JAcoustics/JModel.hh.

940  {
942  p = this->begin(),
943  q = buffer.begin(); ; ++p, ++q) {
944 
945  if (p != this->end() && q != buffer.end()) {
946 
947  if (p->first != q->first || !p->second.equals(q->second, precision)) {
948  return false;
949  }
950 
951  } else if (p == this->end() && q == buffer.end()) {
952 
953  return true;
954 
955  } else {
956 
957  return false;
958  }
959  }
960  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:86
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual void JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::clear ( )
inlineoverridevirtualinherited

Clear.

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 107 of file JHashMap.hh.

108  {
110  }
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
void JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::reset ( )
inlineinherited

Reset values.

Definition at line 116 of file JHashMap.hh.

117  {
118  for (iterator i = this->begin(); i != this->end(); ++i) {
119  i->second = mapped_type();
120  }
121  }
JValue_t mapped_type
Definition: JHashMap.hh:79
container_type::iterator iterator
Definition: JHashMap.hh:88
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
void JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::set ( const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  source,
const mapped_type value 
)
inlineinherited

Set values corresponding to keys in given source.

Parameters
sourcesource
valuevalue

Definition at line 130 of file JHashMap.hh.

131  {
132  this->clear();
133 
134  for (const_iterator i = source.begin(); i != source.end(); ++i) {
135  (*this)[i->first] = value;
136  }
137  }
virtual void clear() override
Clear.
Definition: JHashMap.hh:107
container_type::const_iterator const_iterator
Definition: JHashMap.hh:86
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual mapped_type& JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::get ( typename JClass< key_type >::argument_type  key)
inlineoverridevirtualinherited

Get mapped value.

Parameters
keykey
Returns
mapped value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 146 of file JHashMap.hh.

147  {
148  const int ival = this->getValue(key);
149 
150  if (!this->router.has(ival)) {
152  }
153 
154  return container_type::operator[](this->router.get(ival)).second;
155  }
JValue_t mapped_type
Definition: JHashMap.hh:79
virtual bool insert(const value_type &element)
Insert element.
std::pair< JKey_t, JValue_t > value_type
Definition: JHashMap.hh:80
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
template<class JKey_t, class JValue_t, class JEvaluator_t = JHashEvaluator>
virtual const mapped_type& JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t >::get ( typename JClass< key_type >::argument_type  key) const
inlineoverridevirtualinherited

Get mapped value.

This method will throw an exception if given key is not present following the prerequisite of constness.

Parameters
keykey
Returns
mapped value

Implements JTOOLS::JMappableCollection< JKey_t, JValue_t >.

Definition at line 166 of file JHashMap.hh.

167  {
168  const int ival = this->getValue(key);
169 
170  if (this->router.has(ival))
171  return container_type::operator[](this->router.get(ival)).second;
172  else
173  THROW(JIndexOutOfRange, "JHashMap::get(): invalid key " << STREAM("?") << key);
174  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
Auxiliary data structure for handling std::ostream.
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
value_type& JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::get ( const T value)
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 176 of file JHashCollection.hh.

177  {
178  const int ival = this->getValue(value);
179 
180  if (!router.has(ival)) {
181  this->insert(value);
182  }
183 
184  return container_type::operator[](router.get(ival)).second;
185  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
const value_type& JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::get ( const T value) const
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 197 of file JHashCollection.hh.

198  {
199  const int ival = this->getValue(value);
200 
201  if (router.has(ival)) {
202  return container_type::operator[](router.get(ival)).second;
203  }
204 
205  THROW(JIndexOutOfRange, "JHashCollection::get(): invalid value.");
206  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::swap ( JHashCollection< std::pair< JKey_t, JValue_t >, JHashMapEvaluator< JEvaluator_t > > &  collection)
inlineinherited

Swap hash collection.

Parameters
collectionhash collection

Definition at line 123 of file JHashCollection.hh.

124  {
125  router.swap(collection.router);
126 
127  container_type::swap(collection);
128  }
const_iterator JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::find ( const T value) const
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 138 of file JHashCollection.hh.

139  {
140  const int ival = this->getValue(value);
141 
142  if (router.has(ival))
143  return this->begin() + router.get(ival);
144  else
145  return this->end();
146  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
iterator JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::find ( const T value)
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 156 of file JHashCollection.hh.

157  {
158  const int ival = this->getValue(value);
159 
160  if (router.has(ival))
161  return this->begin() + router.get(ival);
162  else
163  return this->end();
164  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
virtual bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::insert ( const value_type element)
inlinevirtualinherited

Insert element.

Parameters
elementelement
Returns
true if inserted; else false

Definition at line 215 of file JHashCollection.hh.

216  {
217  const int ival = this->getValue(element);
218 
219  if (!router.has(ival)) {
220 
221  container_type::push_back(element);
222 
223  router.put(ival, this->size() - 1);
224 
225  return true;
226  }
227 
228  return false;
229  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::insert ( T  __begin,
T  __end 
)
inlineinherited

Insert values.

Parameters
__beginbegin of values
__endend of values

Definition at line 239 of file JHashCollection.hh.

240  {
241  for (T i = __begin; i != __end; ++i) {
242  insert(*i);
243  }
244  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( iterator  pos)
inlineinherited

Erase element at given position.

Parameters
posvalid position

Definition at line 252 of file JHashCollection.hh.

253  {
254  router.put(this->getValue(*pos), router.getDefaultAddress());
255 
256  for (iterator i = container_type::erase(pos); i != this->end(); ++i) {
257  router.put(this->getValue(*i), distance(this->begin(), i));
258  }
259  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
void JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( iterator  __begin,
iterator  __end 
)
inlineinherited

Erase elements in given range.

Parameters
__beginbegin position (included)
__endend position (excluded)

Definition at line 268 of file JHashCollection.hh.

269  {
270  for (iterator i = __begin; i != __end; ++i) {
271  router.put(this->getValue(*i), router.getDefaultAddress());
272  }
273 
274  for (iterator i = container_type::erase(__begin, __end); i != this->end(); ++i) {
275  router.put(this->getValue(*i), distance(this->begin(), i));
276  }
277  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::erase ( const T value)
inlineinherited

Erase element with given value.

Parameters
valuevalue
Returns
true if element has been erased; else false

Definition at line 287 of file JHashCollection.hh.

288  {
289  const int ival = this->getValue(value);
290 
291  if (router.has(ival)) {
292 
293  this->erase(this->begin() + router.get(ival));
294 
295  return true;
296  }
297 
298  return false;
299  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
bool JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::has ( const T value) const
inlineinherited

Test whether given value is present.

Parameters
valuevalue
Returns
true if present; else false

Definition at line 309 of file JHashCollection.hh.

310  {
311  return router.has(this->getValue(value));
312  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
int JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::getIndex ( const T value) const
inlineinherited

Get index of given value.

Parameters
valuevalue
Returns
indecx

Definition at line 322 of file JHashCollection.hh.

323  {
324  return router.get(this->getValue(value));
325  }
JHashMapEvaluator< JEvaluator_t > getValue
Function object for evaluation of element.
template<class JKey_t, class JValue_t>
const mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key) const
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 73 of file JMappableCollection.hh.

74  {
75  return get(key);
76  }
template<class JKey_t, class JValue_t>
mapped_type& JTOOLS::JMappableCollection< JKey_t, JValue_t >::operator[] ( typename JClass< key_type >::argument_type  key)
inlineinherited

Get mapped value.

Parameters
keykey
Returns
value

Definition at line 85 of file JMappableCollection.hh.

86  {
87  return get(key);
88  }
template<class JKey_t, class JValue_t>
void JTOOLS::JMappableCollection< JKey_t, JValue_t >::put ( typename JClass< key_type >::argument_type  key,
typename JClass< mapped_type >::argument_type  value 
)
inlineinherited

Put pair-wise element (key,value) into collection.

Parameters
keykey
valuevalue

Definition at line 97 of file JMappableCollection.hh.

99  {
100  get(key) = value;
101  }

Member Data Documentation

JHashMapEvaluator< JEvaluator_t > JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::getValue
inherited

Function object for evaluation of element.

Definition at line 331 of file JHashCollection.hh.

JTOOLS::JHashCollection::router_type JTOOLS::JHashCollection< std::pair< JKey_t, JValue_t > , JHashMapEvaluator< JEvaluator_t > >::router
protectedinherited

The documentation for this struct was generated from the following file: