|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Command dispatcher pattern implementation. More...
Go to the source code of this file.
Classes | |
| class | AHDispatcher< Key, Operation > |
| Tree-based command dispatcher. More... | |
| class | AhHashDispatcher< Key, Operation > |
| Hash-based command dispatcher. More... | |
| struct | AhHashDispatcher< Key, Operation >::Equal |
Command dispatcher pattern implementation.
This file provides two dispatcher classes that map keys to callable operations, enabling dynamic command dispatching based on runtime keys.
A dispatcher is a registry that associates keys with operations (functions, lambdas, or function objects). At runtime, you can execute an operation by providing its key. This is useful for:
| Class | Backing Store | Lookup Time |
|---|---|---|
| AHDispatcher | DynMapTree (balanced tree) | O(log n) |
| AhHashDispatcher | ODhashTable (hash table) | O(1) average |
Definition in file ah-dispatcher.H.