Hi,

On Tue, Nov 01, 2011 at 03:25:05PM +0800, wsq003 wrote:
> hi,
> 
> I found ebtree works in a good manner, so want to use it in other places.
> Dose ebtree support key-value pair? I would like to use it to replace 
> std::map at some specific condition.

it's mainly used for that. The principle is that you store a key in a
node and you store this node into a larger struct which contains all
your values. Then when you lookup the key, you find the node so you
know the struct holding the key. That's how it's used in haproxy. Look
at task.c for instance, the timer queue is scanned to wake up all tasks
with an expired timer. The key here is the timer and the "value" is the
task.

Willy


Reply via email to