Back to index

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

#include <morkProbeMap.h>

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

List of all members.

Public Member Functions

 morkProbeMapIter (morkEnv *ev, morkProbeMap *ioMap)
void CloseMapIter (morkEnv *ev)
 morkProbeMapIter ()
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 369 of file morkProbeMap.h.


Constructor & Destructor Documentation

Definition at line 925 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:


Member Function Documentation

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

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 * morkProbeMapIter::First ( morkEnv ev,
void outKey,
void outVal 
)

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 * morkProbeMapIter::Here ( morkEnv ev,
void outKey,
void outVal 
)

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:

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

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]

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:

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

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]

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]

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]

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]

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]

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]

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]

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]

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 
)

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:


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.

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 files: