Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
morkRowProbeMapIter Class Reference

#include <morkRowMap.h>

Inheritance diagram for morkRowProbeMapIter:
Inheritance graph
[legend]
Collaboration diagram for morkRowProbeMapIter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 morkRowProbeMapIter (morkEnv *ev, morkRowProbeMap *ioMap)
 morkRowProbeMapIter ()
void InitRowMapIter (morkEnv *ev, morkRowProbeMap *ioMap)
mork_changeFirstRow (morkEnv *ev, morkRow **outRowPtr)
mork_changeNextRow (morkEnv *ev, morkRow **outRowPtr)
mork_changeHereRow (morkEnv *ev, morkRow **outRowPtr)
mork_changeCutHereRow (morkEnv *ev, morkRow **outRowPtr)
void CloseMapIter (morkEnv *ev)
mork_changeFirst (morkEnv *ev, void *outKey, void *outVal)
mork_changeNext (morkEnv *ev, void *outKey, void *outVal)
mork_changeHere (morkEnv *ev, void *outKey, void *outVal)
mork_changeCutHere (morkEnv *ev, void *outKey, void *outVal)

Protected Member Functions

void InitProbeMapIter (morkEnv *ev, morkProbeMap *ioMap)
void InitMapIter (morkEnv *ev, morkProbeMap *ioMap)
mork_bool IterFirst (morkEnv *ev, void *outKey, void *outVal)
mork_bool IterNext (morkEnv *ev, void *outKey, void *outVal)
mork_bool IterHere (morkEnv *ev, void *outKey, void *outVal)
voidIterFirstVal (morkEnv *ev, void *outKey)
voidIterNextVal (morkEnv *ev, void *outKey)
voidIterHereVal (morkEnv *ev, void *outKey)
voidIterFirstKey (morkEnv *ev)
voidIterNextKey (morkEnv *ev)
voidIterHereKey (morkEnv *ev)

Protected Attributes

morkProbeMapsProbeMapIter_Map
mork_num sProbeMapIter_Seed
mork_i4 sProbeMapIter_HereIx
mork_change sProbeMapIter_Change
mork_u1 sProbeMapIter_Pad [3]

Detailed Description

Definition at line 218 of file morkRowMap.h.


Constructor & Destructor Documentation

Definition at line 221 of file morkRowMap.h.

  : morkProbeMapIter(ev, ioMap) { }

Definition at line 224 of file morkRowMap.h.


Member Function Documentation

mork_change * morkProbeMapIter::CutHere ( morkEnv ev,
void outKey,
void outVal 
) [inherited]

Definition at line 1118 of file morkProbeMap.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change* morkRowProbeMapIter::CutHereRow ( morkEnv ev,
morkRow **  outRowPtr 
) [inline]

Definition at line 237 of file morkRowMap.h.

  { return this->CutHere(ev, outRowPtr, /*val*/ (void*) 0); }

Here is the call graph for this function:

mork_change * morkProbeMapIter::First ( morkEnv ev,
void outKey,
void outVal 
) [inherited]

Definition at line 1091 of file morkProbeMap.cpp.

{
  if ( this->IterFirst(ev, outKey, outVal) )
    return &sProbeMapIter_Change;
  
  return (mork_change*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change* morkRowProbeMapIter::FirstRow ( morkEnv ev,
morkRow **  outRowPtr 
) [inline]

Definition at line 228 of file morkRowMap.h.

  { return this->First(ev, outRowPtr, /*val*/ (void*) 0); }

Here is the call graph for this function:

mork_change * morkProbeMapIter::Here ( morkEnv ev,
void outKey,
void outVal 
) [inherited]

Definition at line 1109 of file morkProbeMap.cpp.

{
  if ( this->IterHere(ev, outKey, outVal) )
    return &sProbeMapIter_Change;
  
  return (mork_change*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change* morkRowProbeMapIter::HereRow ( morkEnv ev,
morkRow **  outRowPtr 
) [inline]

Definition at line 234 of file morkRowMap.h.

  { return this->Here(ev, outRowPtr, /*val*/ (void*) 0); }

Here is the call graph for this function:

void morkProbeMapIter::InitMapIter ( morkEnv ev,
morkProbeMap ioMap 
) [inline, protected, inherited]

Definition at line 390 of file morkProbeMap.h.

  { this->InitProbeMapIter(ev, ioMap); }

Here is the call graph for this function:

Here is the caller graph for this function:

void morkProbeMapIter::InitProbeMapIter ( morkEnv ev,
morkProbeMap ioMap 
) [protected, inherited]

Definition at line 963 of file morkProbeMap.cpp.

{
  sProbeMapIter_Map = 0;
  sProbeMapIter_Seed = 0;

  sProbeMapIter_HereIx = morkProbeMapIter_kBeforeIx;

  if ( ioMap )
  {
    if ( ioMap->GoodProbeMap() )
    {
      if ( ioMap->need_lazy_init() ) // pending lazy action?
        ioMap->probe_map_lazy_init(ev);
        
      sProbeMapIter_Map = ioMap;
      sProbeMapIter_Seed = ioMap->sMap_Seed;
    }
    else ioMap->ProbeMapBadTagError(ev);
  }
  else ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 225 of file morkRowMap.h.

  { this->InitMapIter(ev, ioMap); }

Here is the call graph for this function:

mork_bool morkProbeMapIter::IterFirst ( morkEnv ev,
void outKey,
void outVal 
) [protected, inherited]

Definition at line 985 of file morkProbeMap.cpp.

{
  sProbeMapIter_HereIx = morkProbeMapIter_kAfterIx; // default to done
  morkProbeMap* map = sProbeMapIter_Map;
  
  if ( map && map->GoodProbeMap() ) /* looks good? */
  {
    sProbeMapIter_Seed = map->sMap_Seed; /* sync the seeds */
    
    mork_u1* k = map->sMap_Keys;  // array of keys, each of size sMap_KeySize
    mork_num size = map->sMap_KeySize;  // number of bytes in each key
    mork_count slots = map->sMap_Slots; // total number of key buckets
    mork_pos here = 0;  // first hash bucket
    
    while ( here < (mork_pos)slots )
    {
      if ( !map->ProbeMapIsKeyNil(ev, k + (here * size)) )
      {
        map->get_probe_kv(ev, outAppKey, outAppVal, here);
        
        sProbeMapIter_HereIx = (mork_i4) here;
        return morkBool_kTrue;
      }
      ++here; // next bucket
    } 
  }
  else map->ProbeMapBadTagError(ev);

  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterFirstKey ( morkEnv ev) [protected, inherited]

Definition at line 1187 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_KeyIsIP )
    {
      void* k = 0;
      this->IterFirst(ev, &k, (void*) 0);
      return k;
    }
    else
      map->MapKeyIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterFirstVal ( morkEnv ev,
void outKey 
) [protected, inherited]

Definition at line 1130 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_ValIsIP )
    {
      void* v = 0;
      this->IterFirst(ev, outKey, &v);
      return v;
    }
    else
      map->MapValIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

mork_bool morkProbeMapIter::IterHere ( morkEnv ev,
void outKey,
void outVal 
) [protected, inherited]

Definition at line 1060 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  
  if ( map && map->GoodProbeMap() ) /* looks good? */
  {    
    if ( sProbeMapIter_Seed == map->sMap_Seed ) /* in sync? */
    {
      mork_pos here = (mork_pos) sProbeMapIter_HereIx;
      mork_count slots = map->sMap_Slots; // total number of key buckets
      if ( sProbeMapIter_HereIx >= 0 && (here < (mork_pos)slots))
      {
        mork_u1* k = map->sMap_Keys;  // key array, each of size sMap_KeySize
        mork_num size = map->sMap_KeySize;  // number of bytes in each key

        if ( !map->ProbeMapIsKeyNil(ev, k + (here * size)) )
        {
          map->get_probe_kv(ev, outAppKey, outAppVal, here);
          return morkBool_kTrue;
        }
      }
    }
    else map->MapSeedOutOfSyncError(ev);
  }
  else map->ProbeMapBadTagError(ev);

  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterHereKey ( morkEnv ev) [protected, inherited]

Definition at line 1223 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_KeyIsIP )
    {
      void* k = 0;
      this->IterHere(ev, &k, (void*) 0);
      return k;
    }
    else
      map->MapKeyIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterHereVal ( morkEnv ev,
void outKey 
) [protected, inherited]

Definition at line 1166 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_ValIsIP )
    {
      void* v = 0;
      this->IterHere(ev, outKey, &v);
      return v;
    }
    else
      map->MapValIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

mork_bool morkProbeMapIter::IterNext ( morkEnv ev,
void outKey,
void outVal 
) [protected, inherited]

Definition at line 1017 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  
  if ( map && map->GoodProbeMap() ) /* looks good? */
  {    
    if ( sProbeMapIter_Seed == map->sMap_Seed ) /* in sync? */
    {
      if ( sProbeMapIter_HereIx != morkProbeMapIter_kAfterIx )
      {
        mork_pos here = (mork_pos) sProbeMapIter_HereIx;
        if ( sProbeMapIter_HereIx < 0 )
          here = 0;
        else
          ++here;
          
        sProbeMapIter_HereIx = morkProbeMapIter_kAfterIx; // default to done

        mork_u1* k = map->sMap_Keys;  // key array, each of size sMap_KeySize
        mork_num size = map->sMap_KeySize;  // number of bytes in each key
        mork_count slots = map->sMap_Slots; // total number of key buckets
        
        while ( here < (mork_pos)slots )
        {
          if ( !map->ProbeMapIsKeyNil(ev, k + (here * size)) )
          {
            map->get_probe_kv(ev, outAppKey, outAppVal, here);
            
            sProbeMapIter_HereIx = (mork_i4) here;
            return morkBool_kTrue;
          }
          ++here; // next bucket
        } 
      }
    }
    else map->MapSeedOutOfSyncError(ev);
  }
  else map->ProbeMapBadTagError(ev);

  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterNextKey ( morkEnv ev) [protected, inherited]

Definition at line 1205 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_KeyIsIP )
    {
      void* k = 0;
      this->IterNext(ev, &k, (void*) 0);
      return k;
    }
    else
      map->MapKeyIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkProbeMapIter::IterNextVal ( morkEnv ev,
void outKey 
) [protected, inherited]

Definition at line 1148 of file morkProbeMap.cpp.

{
  morkProbeMap* map = sProbeMapIter_Map;
  if ( map )
  {
    if ( map->sMap_ValIsIP )
    {
      void* v = 0;
      this->IterNext(ev, outKey, &v);
      return v;
    }
    else
      map->MapValIsNotIPError(ev);
  }
  return (void*) 0;
}

Here is the call graph for this function:

mork_change * morkProbeMapIter::Next ( morkEnv ev,
void outKey,
void outVal 
) [inherited]

Definition at line 1100 of file morkProbeMap.cpp.

{
  if ( this->IterNext(ev, outKey, outVal) )
    return &sProbeMapIter_Change;
  
  return (mork_change*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_change* morkRowProbeMapIter::NextRow ( morkEnv ev,
morkRow **  outRowPtr 
) [inline]

Definition at line 231 of file morkRowMap.h.

  { return this->Next(ev, outRowPtr, /*val*/ (void*) 0); }

Here is the call graph for this function:


Member Data Documentation

Definition at line 377 of file morkProbeMap.h.

Definition at line 375 of file morkProbeMap.h.

Definition at line 372 of file morkProbeMap.h.

mork_u1 morkProbeMapIter::sProbeMapIter_Pad[3] [protected, inherited]

Definition at line 378 of file morkProbeMap.h.

Definition at line 373 of file morkProbeMap.h.


The documentation for this class was generated from the following file: