the_Foundation 1.0
|
Data Structures | |
struct | iMap |
struct | iMapNode |
Nodes inserted to the map must be based on iMapNode. More... | |
struct | iMapReverseIterator |
struct | iMapReverseConstIterator |
Typedefs | |
typedef int64_t | iMapKey |
typedef int(* | iMapNodeCmpFunc) (iMapKey, iMapKey) |
Functions | |
iMap * | new_Map (iMapNodeCmpFunc cmp) |
void | delete_Map (iMap *) |
void | init_Map (iMap *, iMapNodeCmpFunc cmp) |
void | deinit_Map (iMap *) |
iBool | contains_Map (const iMap *, iMapKey key) |
iMapNode * | value_Map (const iMap *, iMapKey key) |
void | clear_Map (iMap *) |
iMapNode * | insert_Map (iMap *, iMapNode *node) |
iMapNode * | remove_Map (iMap *, iMapKey key) |
iMapNode * | removeNode_Map (iMap *, iMapNode *node) |
Iterators | |
void | init_MapIterator (iMapIterator *, iMap *) |
void | next_MapIterator (iMapIterator *) |
void | init_MapReverseIterator (iMapReverseIterator *, iMap *) |
void | next_MapReverseIterator (iMapReverseIterator *) |
iMapNode * | remove_MapIterator (iMapIterator *d) |
iMapNode * | remove_MapReverseIterator (iMapReverseIterator *d) |
void | init_MapConstIterator (iMapConstIterator *, const iMap *) |
void | next_MapConstIterator (iMapConstIterator *) |
void | init_MapReverseConstIterator (iMapReverseConstIterator *, const iMap *) |
void | next_MapReverseConstIterator (iMapReverseConstIterator *) |
Map of sorted unique integer nodes.
Map is implemented as a red-black tree, i.e., a balanced BST.
Map does not have ownership of the nodes. This means the nodes can be any type of object as long as they are derived from MapNode.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
iMapNode * insert_Map | ( | iMap * | , |
iMapNode * | node | ||
) |
Inserts a node into the map.
node | Node to be inserted. Ownership not taken. The key member must be set to the key value. |