#include <lut.hh>
Collaboration diagram for oln::level::hlut_def< T, T2 >:
Public Types | |
typedef T2 | output_t |
Public Member Functions | |
hlut_def & | set (const T &val, const T2 &newval) |
hlut_def & | set_default (const T2 &defaultval) |
Set a default value. | |
const T2 | operator() (const T &val) const |
If the value has not been set, return the default value.
** hlut_def<int> l; ** ** l.set(16, 64); ** ** cout << l(16) << "," // print "64," ** << l(51) << endl; // print "0" ** l.set_default(42); ** cout << l(51) << endl; // print "42" **
Definition at line 111 of file lut.hh.
|
Get the value corresponding to the key. Return defaultval_ if the key has not been set. Definition at line 148 of file lut.hh.
00149 { 00150 static typename hmap_t::const_iterator i; 00151 i = hmap_.find(val); 00152 return i != hmap_.end() ? i->second : defaultval_; 00153 } |
|
Register a value.
Definition at line 129 of file lut.hh. Referenced by oln::morpho::internal_kill_cc_area().
00130 { 00131 hmap_[val] = newval; 00132 return *this; 00133 } |