|
| virtual bool | add (const K_TYPE &k, const V_TYPE &v)=0 |
| | Adds a new key-value pair to the map.
|
| |
| virtual bool | remove (const K_TYPE &k)=0 |
| | Removes a key-value pair from the map.
|
| |
| virtual bool | containsKey (const K_TYPE &k) const =0 |
| | Checks if a key exists in the map.
|
| |
| virtual V_TYPE | get (const K_TYPE &k) const =0 |
| | Gets the value associated with a key.
|
| |
| virtual bool | update (const K_TYPE &key, const V_TYPE &value)=0 |
| | Updates the value for an existing key.
|
| |
| virtual const V_TYPE & | operator[] (const K_TYPE &k) const =0 |
| | Const access to mapped values.
|
| |
| virtual V_TYPE & | operator[] (const K_TYPE &k)=0 |
| | Non-const access to mapped values.
|
| |
|
| ~map () override |
| | Virtual destructor.
|
| |
template<typename K_TYPE, typename V_TYPE, typename ALLOC = allocator<couple<const K_TYPE, V_TYPE>>>
class original::map< K_TYPE, V_TYPE, ALLOC >
Abstract base class for key-value mapping containers.
- Template Parameters
-
| K_TYPE | The key type (must support equality comparison and hashing) |
| V_TYPE | The value type to store |
| ALLOC | Allocator type for memory management (default: allocator) |
This abstract class defines the common interface for all map implementations in the framework. Concrete implementations should inherit from this class and provide the actual storage mechanism.
The map guarantees:
- Unique keys (no duplicates)
- Efficient value lookup by key
- Type-safe operations
- Exception safety (throws noElementError for invalid access)
- Note
- This class is not meant to be instantiated directly - use concrete implementations like hashMap or treeMap instead.