|
Packit |
857059 |
/* BEGIN_ICS_COPYRIGHT3 ****************************************
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Copyright (c) 2015, Intel Corporation
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
857059 |
modification, are permitted provided that the following conditions are met:
|
|
Packit |
857059 |
|
|
Packit |
857059 |
* Redistributions of source code must retain the above copyright notice,
|
|
Packit |
857059 |
this list of conditions and the following disclaimer.
|
|
Packit |
857059 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit |
857059 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
857059 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
857059 |
* Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
857059 |
may be used to endorse or promote products derived from this software
|
|
Packit |
857059 |
without specific prior written permission.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
857059 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
857059 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
857059 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
857059 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
857059 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
857059 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
857059 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
857059 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
857059 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
** END_ICS_COPYRIGHT3 ****************************************/
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* [ICS VERSION STRING: unknown] */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Map
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#ifndef _IBA_PUBLIC_IMAP_H_INCLUDED_
|
|
Packit |
857059 |
#define _IBA_PUBLIC_IMAP_H_INCLUDED_
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#include "iba/public/datatypes.h"
|
|
Packit |
857059 |
#include "iba/public/imath.h"
|
|
Packit |
857059 |
#include "iba/public/igrowpool.h"
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#ifdef __cplusplus
|
|
Packit |
857059 |
extern "C" {
|
|
Packit |
857059 |
#endif
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* enable this #define for more debug information */
|
|
Packit |
857059 |
#ifdef IB_DEBUG
|
|
Packit |
857059 |
#define MAP_DEBUG 1
|
|
Packit |
857059 |
#else
|
|
Packit |
857059 |
#define MAP_DEBUG 0
|
|
Packit |
857059 |
#endif
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define MAP_RECURSION_THRESHOLD 0
|
|
Packit |
857059 |
#define MAP_CONSOLE_DISPLAY_DEPTH_MAX 7
|
|
Packit |
857059 |
#define MAP_START_SIZE 256
|
|
Packit |
857059 |
#define MAP_GROW_SIZE 256
|
|
Packit |
857059 |
#define MAP_MAX_MIN_DELTA 2
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* define the various rotations */
|
|
Packit |
857059 |
typedef enum _MAP_ROTDIR
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ROTNONE, /* no rotation */
|
|
Packit |
857059 |
MAP_ROTL, /* rotate left */
|
|
Packit |
857059 |
MAP_ROTR, /* rotate right */
|
|
Packit |
857059 |
MAP_ROTDL, /* double rotate left */
|
|
Packit |
857059 |
MAP_ROTDR, /* double rotate right */
|
|
Packit |
857059 |
MAP_RECURSIVE /* too complex for simple rotations */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
} MAP_ROTDIR;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* define the map linkage structure */
|
|
Packit |
857059 |
typedef struct _MAP_ITEM
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
struct _MAP_ITEM *m_pLeft; /* DO NOT USE!! */
|
|
Packit |
857059 |
struct _MAP_ITEM *m_pRight; /* DO NOT USE!! */
|
|
Packit |
857059 |
struct _MAP_ITEM *m_pUp; /* DO NOT USE!! */
|
|
Packit |
857059 |
int8 m_DLMin; /* DO NOT USE!! */
|
|
Packit |
857059 |
int8 m_DLMax; /* DO NOT USE!! */
|
|
Packit |
857059 |
int8 m_DRMin; /* DO NOT USE!! */
|
|
Packit |
857059 |
int8 m_DRMax; /* DO NOT USE!! */
|
|
Packit |
857059 |
uint64 m_Key; /* DO NOT USE!! */
|
|
Packit |
857059 |
void *m_pObj; /* DO NOT USE!! */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
} MAP_ITEM, *PMAP_ITEM;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* define the map structure for global map resources */
|
|
Packit |
857059 |
typedef struct _MAP_RES
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM m_End; /* DO NOT USE!! */
|
|
Packit |
857059 |
uint32 m_Count; /* DO NOT USE!! */
|
|
Packit |
857059 |
boolean m_DelToggle; /* DO NOT USE!! */
|
|
Packit |
857059 |
GROW_POOL m_Pool; /* DO NOT USE!! */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
} MAP_RES, *PMAP_RES;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* Define the iterator used to traverse the tree */
|
|
Packit |
857059 |
typedef struct _MAP_ITERATOR
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM *pItem;
|
|
Packit |
857059 |
} MAP_ITERATOR;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* internal function prototypes not for use by user's of map */
|
|
Packit |
857059 |
MAP_ITEM* MapItorNext( IN MAP_ITERATOR* const pItor );
|
|
Packit |
857059 |
MAP_ITEM* MapItorPrev( IN MAP_ITERATOR* const pItor );
|
|
Packit |
857059 |
void MapUpdateDepthsNoCheck( IN MAP_ITEM* const pItem );
|
|
Packit |
857059 |
MAP_ITEM* MapItorInit( IN MAP_ITEM* const pItem,
|
|
Packit |
857059 |
IN MAP_ITERATOR * const pItor );
|
|
Packit |
857059 |
MAP_ITEM** MapItemGetPtrAbove( IN MAP_ITEM* const pItem );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorItem
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns a pointer to the MAP_ITEM pointed to by the iterator.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the MAP_ITEM to which the iterator points
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITEM*
|
|
Packit |
857059 |
MapItorItem(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
return( pItor->pItem );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapDebugGetRootKey
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns the key value of the current root of the map.
|
|
Packit |
857059 |
* This function is for debugging only and should not be called by
|
|
Packit |
857059 |
* general users of MAP_RES.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pMap - pointer to a MAP_RES
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline uint64
|
|
Packit |
857059 |
MapDebugGetRootKey(
|
|
Packit |
857059 |
IN const MAP_RES* const pMap )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pMap );
|
|
Packit |
857059 |
ASSERT( pMap->m_End.m_pLeft );
|
|
Packit |
857059 |
return( pMap->m_End.m_pLeft->m_Key );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapRoot
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns the current root of the map.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pMap - pointer to a MAP_RES
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITEM*
|
|
Packit |
857059 |
MapRoot(
|
|
Packit |
857059 |
IN const MAP_RES* const pMap )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pMap );
|
|
Packit |
857059 |
return( pMap->m_End.m_pLeft );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorGetPtrAbove
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns a pointer to a the pointer that points to the node at
|
|
Packit |
857059 |
* the Iterator.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* pointer to a pointer to the node at the iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITEM**
|
|
Packit |
857059 |
MapItorGetPtrAbove(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
return( MapItemGetPtrAbove( pItor->pItem ) );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorUp
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Moves the iterator one step toward the root.
|
|
Packit |
857059 |
* Returns a pointer to the new MAP_ITEM pointed to by the iterator.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the MAP_ITEM to which the iterator points
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITERATOR*
|
|
Packit |
857059 |
MapItorUp(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
pItor->pItem = pItor->pItem->m_pUp;
|
|
Packit |
857059 |
return( pItor );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapSetRoot
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Sets the root of the map.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pMap - pointer to a MAP_RES
|
|
Packit |
857059 |
* pItem - pointer to the MAP_RES item. This pointer may be NULL.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapSetRoot(
|
|
Packit |
857059 |
IN MAP_RES* const pMap,
|
|
Packit |
857059 |
IN MAP_ITEM* const pItem )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pMap );
|
|
Packit |
857059 |
pMap->m_End.m_pLeft = pItem;
|
|
Packit |
857059 |
if( pItem )
|
|
Packit |
857059 |
pItem->m_pUp = &pMap->m_End;
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapCount
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns the number of items in the map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pMap - pointer to a MAP_RES
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline uint32
|
|
Packit |
857059 |
MapCount(
|
|
Packit |
857059 |
IN const MAP_RES* const pMap )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pMap );
|
|
Packit |
857059 |
return( pMap->m_Count );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapObj
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns the user object pointed to by an iterator.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - MAP_ITERATOR
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* pointer to the user object
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void*
|
|
Packit |
857059 |
MapObj(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
return( pItor->pItem->m_pObj );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapKey
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns the key pointed to by an iterator.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* Itor - MAP_ITERATOR
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* key value of the object pointed to by the iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline uint64
|
|
Packit |
857059 |
MapKey(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
return( pItor->pItem->m_Key );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapIsLeaf
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns true if the specified MAP_ITEM is a leaf.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItem - pointer to a MAP_ITEM
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline boolean
|
|
Packit |
857059 |
MapIsLeaf(
|
|
Packit |
857059 |
IN const MAP_ITEM* const pItem )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItem );
|
|
Packit |
857059 |
return( (boolean)((pItem->m_pLeft == NULL) && (pItem->m_pRight == NULL)) );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapIsRoot
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns true if the specified MAP_ITEM is the root of the given MAP_RES
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pMap - pointer ot a MAP_ITEM
|
|
Packit |
857059 |
* pItem - pointer to a MAP_ITEM
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the item is the root
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline boolean
|
|
Packit |
857059 |
MapIsRoot(
|
|
Packit |
857059 |
IN const MAP_RES* const pMap,
|
|
Packit |
857059 |
IN const MAP_ITEM* const pItem)
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pMap );
|
|
Packit |
857059 |
return( (boolean)(pMap->m_End.m_pLeft == pItem) );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorIsLeaf
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns true if the item pointed to by the iterator is a leaf.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a MAP_ITERATOR
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE if the iterator's item is a leaf
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline boolean
|
|
Packit |
857059 |
MapItorIsLeaf(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
return( (boolean)((pItor->pItem->m_pLeft == NULL) &&
|
|
Packit |
857059 |
(pItor->pItem->m_pRight == NULL) ));
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorDeleteLeaf
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Performs a simple delete of the item pointed to by the given iterator.
|
|
Packit |
857059 |
* The iterator must point to a leaf item.
|
|
Packit |
857059 |
* The iterator may point to the root node of this iterator.
|
|
Packit |
857059 |
* The balances in the tree nodes are not adjusted!
|
|
Packit |
857059 |
* This internal function should not be called by users of MAP_RES.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a MAP_ITERATOR object
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapItorDeleteLeaf(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
/* The pointer that points to the leaf item must be set to NULL */
|
|
Packit |
857059 |
/* or the node above the node to be deleted, determine when the */
|
|
Packit |
857059 |
/* node to delete hangs to the left or right. */
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
ASSERT( MapIsLeaf( pItor->pItem ) );
|
|
Packit |
857059 |
*(MapItorGetPtrAbove( pItor )) = NULL;
|
|
Packit |
857059 |
/* put the iterator back into the map now that the node */
|
|
Packit |
857059 |
/* it points to has been deleted. */
|
|
Packit |
857059 |
MapItorUp( pItor );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorDeleteRightHalfLeaf
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Performs a simple delete of the item pointed to by the given iterator.
|
|
Packit |
857059 |
* The iterator must point to an item that has a NULL child on the right.
|
|
Packit |
857059 |
* The iterator can NOT point to the root node of this iterator.
|
|
Packit |
857059 |
* The iterator may point to a true leaf.
|
|
Packit |
857059 |
* The balances in the tree nodes is not adjusted!
|
|
Packit |
857059 |
* This internal function should not be called by users of MAP_RES.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a MAP_ITERATOR object
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapItorDeleteRightHalfLeaf(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
ASSERT( pItor->pItem->m_pRight == NULL );
|
|
Packit |
857059 |
*(MapItorGetPtrAbove( pItor )) = pItor->pItem->m_pLeft;
|
|
Packit |
857059 |
if( pItor->pItem->m_pLeft != NULL )
|
|
Packit |
857059 |
pItor->pItem->m_pLeft->m_pUp = pItor->pItem->m_pUp;
|
|
Packit |
857059 |
/* put the iterator back into the map now that the node */
|
|
Packit |
857059 |
/* it points to has been deleted. */
|
|
Packit |
857059 |
MapItorUp( pItor );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorDeleteLeftHalfLeaf
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Performs a simple delete of the item pointed to by the given iterator.
|
|
Packit |
857059 |
* The iterator must point to an item that has a NULL child on the left.
|
|
Packit |
857059 |
* The iterator can NOT point to the root node of this iterator.
|
|
Packit |
857059 |
* The iterator may point to a true leaf.
|
|
Packit |
857059 |
* The balances in the tree nodes is not adjusted!
|
|
Packit |
857059 |
* This internal function should not be called by users of MAP_RES.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a MAP_ITERATOR object
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapItorDeleteLeftHalfLeaf(
|
|
Packit |
857059 |
IN MAP_ITERATOR * const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
ASSERT( pItor->pItem->m_pLeft == NULL );
|
|
Packit |
857059 |
*(MapItorGetPtrAbove( pItor )) = pItor->pItem->m_pRight;
|
|
Packit |
857059 |
if( pItor->pItem->m_pRight != NULL )
|
|
Packit |
857059 |
pItor->pItem->m_pRight->m_pUp = pItor->pItem->m_pUp;
|
|
Packit |
857059 |
/* put the iterator back into the map now that the node */
|
|
Packit |
857059 |
/* it points to has been deleted. */
|
|
Packit |
857059 |
MapItorUp( pItor );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorLeft
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Step the iterator one node down to the left.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the MAP_ITEM to which the iterator moved
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITEM*
|
|
Packit |
857059 |
MapItorLeft(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
pItor->pItem = pItor->pItem->m_pLeft;
|
|
Packit |
857059 |
return( pItor->pItem );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItemInit
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Initializes a MAP_ITEM object.
|
|
Packit |
857059 |
* This function must be called before using a new MAP_ITEM.
|
|
Packit |
857059 |
* This internal function should not be called by users of MAP_RES.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItem - pointer to a MAP_ITEM.
|
|
Packit |
857059 |
* Key - key value associated with this MAP_ITEM.
|
|
Packit |
857059 |
* pObj - user object associated with theis MAP_ITEM.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapItemResetBalances(
|
|
Packit |
857059 |
IN MAP_ITEM* const pItem )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
pItem->m_DLMin = -1;
|
|
Packit |
857059 |
pItem->m_DLMax = -1;
|
|
Packit |
857059 |
pItem->m_DRMin = -1;
|
|
Packit |
857059 |
pItem->m_DRMax = -1;
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorRight
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Step the iterator one node down to the right.
|
|
Packit |
857059 |
* This function should not be called by user's of map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the MAP_ITEM to which the iterator moved
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline MAP_ITEM*
|
|
Packit |
857059 |
MapItorRight(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
pItor->pItem = pItor->pItem->m_pRight;
|
|
Packit |
857059 |
return( pItor->pItem );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapItorAtRoot
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns true if this iterator points to the root node
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* TRUE - The iterator points to the root node
|
|
Packit |
857059 |
* FALSE otherwise
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline boolean
|
|
Packit |
857059 |
MapItorAtRoot(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
return( (boolean)(pItor->pItem->m_pUp == pItor->pItem) );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapIsItorValid
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Returns TRUE if the MAP_ITERATOR points to an object in the map.
|
|
Packit |
857059 |
* Returns FALSE if the iterator points outside the map or to the logical
|
|
Packit |
857059 |
* end of the map (which is of course outstide the map too)
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* Itor - MAP_ITERATOR
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* key value of the object pointed to by the iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline boolean
|
|
Packit |
857059 |
MapIsItorValid(
|
|
Packit |
857059 |
IN const MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
if( pItor->pItem != NULL )
|
|
Packit |
857059 |
return( !MapItorAtRoot( pItor ) );
|
|
Packit |
857059 |
else
|
|
Packit |
857059 |
return( FALSE );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapRotRight
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Rotate the subtree pointed to by *ppRoot to the right. This transform
|
|
Packit |
857059 |
* can rebalance a -2 LL
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* ppRoot - pointer to a pointer to a MAP_ITEM
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapRotRight(
|
|
Packit |
857059 |
IN MAP_ITEM *pItem )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM **ppRoot = MapItemGetPtrAbove( pItem );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
ASSERT( pItem );
|
|
Packit |
857059 |
ASSERT( ppRoot );
|
|
Packit |
857059 |
ASSERT( *ppRoot );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* point to the new root */
|
|
Packit |
857059 |
/* which is the left leaf of the old root */
|
|
Packit |
857059 |
*ppRoot = pItem->m_pLeft;
|
|
Packit |
857059 |
pItem->m_pLeft->m_pUp = pItem->m_pUp;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* Set old root's left tree to the new root's old right tree */
|
|
Packit |
857059 |
pItem->m_pLeft = (*ppRoot)->m_pRight;
|
|
Packit |
857059 |
if( pItem->m_pLeft )
|
|
Packit |
857059 |
pItem->m_pLeft->m_pUp = pItem;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* the right subtree of the new root becomes the old root */
|
|
Packit |
857059 |
/* the unblanaced node */
|
|
Packit |
857059 |
(*ppRoot)->m_pRight = pItem;
|
|
Packit |
857059 |
if( (*ppRoot)->m_pRight )
|
|
Packit |
857059 |
(*ppRoot)->m_pRight->m_pUp = *ppRoot;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
MapUpdateDepthsNoCheck( pItem );
|
|
Packit |
857059 |
MapUpdateDepthsNoCheck( *ppRoot );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapRotLeft
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Rotate the subtree pointed to by *ppRoot to the left. This transform
|
|
Packit |
857059 |
* can rebalance a +2 RR
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* ppRoot - pointer to a pointer to a MAP_ITEM
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void
|
|
Packit |
857059 |
MapRotLeft(
|
|
Packit |
857059 |
IN MAP_ITEM *pItem )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM **ppRoot = MapItemGetPtrAbove( pItem );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
ASSERT( pItem );
|
|
Packit |
857059 |
ASSERT( ppRoot );
|
|
Packit |
857059 |
ASSERT( *ppRoot );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* point the new root */
|
|
Packit |
857059 |
/* which is the right leaf of the old root */
|
|
Packit |
857059 |
*ppRoot = pItem->m_pRight;
|
|
Packit |
857059 |
pItem->m_pRight->m_pUp = pItem->m_pUp;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* setup the left subtree of the old root */
|
|
Packit |
857059 |
/* to be the right subtree of the new root */
|
|
Packit |
857059 |
pItem->m_pRight = (*ppRoot)->m_pLeft;
|
|
Packit |
857059 |
if( pItem->m_pRight )
|
|
Packit |
857059 |
pItem->m_pRight->m_pUp = pItem;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* the right subtree of the new root becomes the old root */
|
|
Packit |
857059 |
/* the unblanaced node */
|
|
Packit |
857059 |
(*ppRoot)->m_pLeft = pItem;
|
|
Packit |
857059 |
if( (*ppRoot)->m_pLeft )
|
|
Packit |
857059 |
(*ppRoot)->m_pLeft->m_pUp = *ppRoot;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
MapUpdateDepthsNoCheck( pItem );
|
|
Packit |
857059 |
MapUpdateDepthsNoCheck( *ppRoot );
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapNext
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Sets a map iterator to the logical next item in the map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the user object at the next map location
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void*
|
|
Packit |
857059 |
MapNext(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM *pItem;
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
pItem = MapItorNext( pItor );
|
|
Packit |
857059 |
if( pItem != NULL )
|
|
Packit |
857059 |
return( pItem->m_pObj );
|
|
Packit |
857059 |
else
|
|
Packit |
857059 |
return NULL;
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/****************************************************************************
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* MapPrev
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Description:
|
|
Packit |
857059 |
* Sets a map iterator to the previous item in the map.
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Inputs:
|
|
Packit |
857059 |
* pItor - pointer to a map iterator
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Outputs:
|
|
Packit |
857059 |
* None
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
* Returns:
|
|
Packit |
857059 |
* Pointer to the user object at the next map location
|
|
Packit |
857059 |
*
|
|
Packit |
857059 |
****************************************************************************/
|
|
Packit |
857059 |
static __inline void*
|
|
Packit |
857059 |
MapPrev(
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor )
|
|
Packit |
857059 |
{
|
|
Packit |
857059 |
MAP_ITEM *pItem;
|
|
Packit |
857059 |
ASSERT( pItor );
|
|
Packit |
857059 |
pItem = MapItorPrev( pItor );
|
|
Packit |
857059 |
if( pItem != NULL )
|
|
Packit |
857059 |
return( pItem->m_pObj );
|
|
Packit |
857059 |
else
|
|
Packit |
857059 |
return NULL;
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void MapInitState( IN MAP_RES * const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
FSTATUS MapInit( IN MAP_RES * const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void MapDestroy( IN MAP_RES * const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
FSTATUS MapInsert( IN MAP_RES* const pMap,
|
|
Packit |
857059 |
IN const uint64 Key,
|
|
Packit |
857059 |
IN const void* const pObj );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void* MapHead( IN const MAP_RES* const pMap,
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void* MapRemoveHead( IN MAP_RES* const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void* MapTail( IN const MAP_RES* const pMap,
|
|
Packit |
857059 |
IN MAP_ITERATOR* const pItor );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void* MapRemoveTail( IN MAP_RES* const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
FSTATUS MapRemove( IN MAP_RES* const pMap,
|
|
Packit |
857059 |
IN const uint64 Key );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void MapConsoleDump( IN const MAP_RES* const pMap );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
void* MapGet( IN const MAP_RES* const pMap,
|
|
Packit |
857059 |
IN const uint64 Key );
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/*FSTATUS MapDebugCheckDepth( IN const MAP_RES * const pMap ); */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#ifdef __cplusplus
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
#endif
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#endif /* _IBA_PUBLIC_IMAP_H_INCLUDED */
|