Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends
morkRowSpace Class Reference

#include <morkRowSpace.h>

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

List of all members.

Public Member Functions

void SetRowSpaceDirty ()
void SetRowSpaceClean ()
mork_bool IsRowSpaceClean () const
mork_bool IsRowSpaceDirty () const
virtual void CloseMorkNode (morkEnv *ev)
virtual ~morkRowSpace ()
 morkRowSpace (morkEnv *ev, const morkUsage &inUsage, mork_scope inScope, morkStore *ioStore, nsIMdbHeap *ioNodeHeap, nsIMdbHeap *ioSlotHeap)
void CloseRowSpace (morkEnv *ev)
mork_bool IsRowSpace () const
mork_num CutAllRows (morkEnv *ev, morkPool *ioPool)
morkTableNewTable (morkEnv *ev, mork_kind inTableKind, mdb_bool inMustBeUnique, const mdbOid *inOptionalMetaRowOid)
morkTableNewTableWithTid (morkEnv *ev, mork_tid inTid, mork_kind inTableKind, const mdbOid *inOptionalMetaRowOid)
morkTableFindTableByKind (morkEnv *ev, mork_kind inTableKind)
morkTableFindTableByTid (morkEnv *ev, mork_tid inTid)
mork_tid MakeNewTableId (morkEnv *ev)
mork_rid MakeNewRowId (morkEnv *ev)
morkRowNewRowWithOid (morkEnv *ev, const mdbOid *inOid)
morkRowNewRow (morkEnv *ev)
morkRowFindRow (morkEnv *ev, mork_column inColumn, const mdbYarn *inYarn)
morkAtomRowMapForceMap (morkEnv *ev, mork_column inColumn)
morkAtomRowMapFindMap (morkEnv *ev, mork_column inColumn)
mork_tid SpaceScope () const
void SetSpaceScope (mork_scope inScope)
void SetSpaceDirty ()
void SetSpaceClean ()
mork_bool IsSpaceClean () const
mork_bool IsSpaceDirty () const
void CloseSpace (morkEnv *ev)
mork_bool IsSpace () const
mork_bool MaybeDirtyStoreAndSpace ()
morkPoolGetSpaceStorePool () const
mork_u4 BeadHash () const
mork_bool BeadEqual (const morkBead *inBead) const
void CloseBead (morkEnv *ev)
mork_bool IsBead () const
void SetFrozen ()
void SetMutable ()
void SetAsleep ()
mork_bool IsFrozen () const
mork_bool IsMutable () const
mork_bool IsAsleep () const
void SetNodeClean ()
void SetNodeDirty ()
mork_bool IsNodeClean () const
mork_bool IsNodeDirty () const
void ZapOld (morkEnv *ev, nsIMdbHeap *ioHeap)
voidoperator new (size_t inSize, nsIMdbHeap &ioHeap, morkEnv *ev) CPP_THROW_NEW
void CloseNode (morkEnv *ev)
mdb_err CloseMdbObject (morkEnv *ev)
NS_IMETHOD CloseMdbObject (nsIMdbEnv *ev)
mork_bool IsNode () const
void RefsUnderUsesWarning (morkEnv *ev) const
void NonNodeError (morkEnv *ev) const
void NilHeapError (morkEnv *ev) const
void NonOpenNodeError (morkEnv *ev) const
void NonMutableNodeError (morkEnv *ev) const
void RefsOverflowWarning (morkEnv *ev) const
void UsesOverflowWarning (morkEnv *ev) const
void RefsUnderflowWarning (morkEnv *ev) const
void UsesUnderflowWarning (morkEnv *ev) const
mork_bool GoodRefs () const
mork_bool BadRefs () const
mork_uses StrongRefsOnly () const
mork_refs WeakRefsOnly () const
virtual mork_refs AddStrongRef (morkEnv *ev)
virtual mork_refs CutStrongRef (morkEnv *ev)
mork_refs AddWeakRef (morkEnv *ev)
mork_refs CutWeakRef (morkEnv *ev)
const char * GetNodeAccessAsString () const
const char * GetNodeUsageAsString () const
mork_usage NodeUsage () const
mork_bool IsHeapNode () const
mork_bool IsOpenNode () const
mork_bool IsShutNode () const
mork_bool IsDeadNode () const
mork_bool IsClosingNode () const
mork_bool IsOpenOrClosingNode () const
mork_bool HasNodeAccess () const
void MarkShut ()
void MarkClosing ()
void MarkDead ()

Static Public Member Functions

static void NonRowSpaceTypeError (morkEnv *ev)
static void ZeroScopeError (morkEnv *ev)
static void ZeroKindError (morkEnv *ev)
static void ZeroTidError (morkEnv *ev)
static void MinusOneRidError (morkEnv *ev)
static void SlotWeakRowSpace (morkRowSpace *me, morkEnv *ev, morkRowSpace **ioSlot)
static void SlotStrongRowSpace (morkRowSpace *me, morkEnv *ev, morkRowSpace **ioSlot)
static void NonAsciiSpaceScopeName (morkEnv *ev)
static void NilSpaceStoreError (morkEnv *ev)
static void SlotWeakSpace (morkSpace *me, morkEnv *ev, morkSpace **ioSlot)
static void SlotStrongSpace (morkSpace *me, morkEnv *ev, morkSpace **ioSlot)
static void SlotWeakBead (morkBead *me, morkEnv *ev, morkBead **ioSlot)
static void SlotStrongBead (morkBead *me, morkEnv *ev, morkBead **ioSlot)
static voidMakeNew (size_t inSize, nsIMdbHeap &ioHeap, morkEnv *ev)
static void SlotWeakNode (morkNode *me, morkEnv *ev, morkNode **ioSlot)
static void SlotStrongNode (morkNode *me, morkEnv *ev, morkNode **ioSlot)

Public Attributes

nsIMdbHeapmRowSpace_SlotHeap
morkRowMap mRowSpace_Rows
morkTableMap mRowSpace_Tables
mork_tid mRowSpace_NextTableId
mork_rid mRowSpace_NextRowId
mork_count mRowSpace_IndexCount
morkAtomRowMapmRowSpace_IndexCache [morkRowSpace_kPrimeCacheSize]
morkDeque mRowSpace_TablesByPriority [morkPriority_kCount]
morkStoremSpace_Store
mork_bool mSpace_DoAutoIDs
mork_bool mSpace_HaveDoneAutoIDs
mork_bool mSpace_CanDirty
mork_u1 mSpace_Pad
mork_color mBead_Color
nsIMdbHeapmNode_Heap
mork_base mNode_Base
mork_derived mNode_Derived
mork_access mNode_Access
mork_usage mNode_Usage
mork_able mNode_Mutable
mork_load mNode_Load
mork_uses mNode_Uses
mork_refs mNode_Refs

Protected Member Functions

morkAtomRowMapmake_index (morkEnv *ev, mork_column inColumn)

Friends

class morkHandleFrame

Detailed Description

Definition at line 86 of file morkRowSpace.h.


Constructor & Destructor Documentation

Definition at line 115 of file morkRowSpace.cpp.

{
  MORK_ASSERT(this->IsShutNode());
}

Here is the call graph for this function:

morkRowSpace::morkRowSpace ( morkEnv ev,
const morkUsage inUsage,
mork_scope  inScope,
morkStore ioStore,
nsIMdbHeap ioNodeHeap,
nsIMdbHeap ioSlotHeap 
)

Definition at line 121 of file morkRowSpace.cpp.

: morkSpace(ev, inUsage, inScope, ioStore, ioHeap, ioSlotHeap)
, mRowSpace_SlotHeap( ioSlotHeap )
, mRowSpace_Rows(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap,
  morkRowSpace_kStartRowMapSlotCount)
, mRowSpace_Tables(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioSlotHeap)
, mRowSpace_NextTableId( 1 )
, mRowSpace_NextRowId( 1 )

, mRowSpace_IndexCount( 0 )
{
  morkAtomRowMap** cache = mRowSpace_IndexCache;
  morkAtomRowMap** cacheEnd = cache + morkRowSpace_kPrimeCacheSize;
  while ( cache < cacheEnd )
    *cache++ = 0; // put nil into every slot of cache table
    
  if ( ev->Good() )
  {
    if ( ioSlotHeap )
    {
      mNode_Derived = morkDerived_kRowSpace;
      
      // the morkSpace base constructor handles any dirty propagation
    }
    else
      ev->NilPointerError();
  }
}

Here is the call graph for this function:


Member Function Documentation

mork_uses morkNode::AddStrongRef ( morkEnv ev) [virtual, inherited]

Reimplemented in morkTable.

Definition at line 510 of file morkNode.cpp.

{
  mork_uses outUses = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_uses uses = mNode_Uses;
      mork_refs refs = mNode_Refs;
      if ( refs < uses ) // need to fix broken refs/uses relation?
      { 
        this->RefsUnderUsesWarning(ev);
        mNode_Refs = mNode_Uses = refs = uses;
      }
      if ( refs < morkNode_kMaxRefCount ) // not too great?
      {
        mNode_Refs = ++refs;
        mNode_Uses = ++uses;
      }
      else
        this->RefsOverflowWarning(ev);

      outUses = uses;
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outUses;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_refs morkNode::AddWeakRef ( morkEnv ev) [inherited]

Definition at line 599 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_refs refs = mNode_Refs;
      if ( refs < morkNode_kMaxRefCount ) // not too great?
        mNode_Refs = ++refs;
      else
        this->RefsOverflowWarning(ev);
        
      outRefs = refs;
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkNode::BadRefs ( ) const [inline, inherited]

Definition at line 217 of file morkNode.h.

{ return mNode_Refs < mNode_Uses; }
mork_bool morkBead::BeadEqual ( const morkBead inBead) const [inline, inherited]

Definition at line 88 of file morkBead.h.

  { return ( mBead_Color == inBead->mBead_Color); }

Here is the caller graph for this function:

mork_u4 morkBead::BeadHash ( ) const [inline, inherited]

Definition at line 87 of file morkBead.h.

{ return (mork_u4) mBead_Color; }

Here is the caller graph for this function:

void morkBead::CloseBead ( morkEnv ev) [inherited]

Definition at line 109 of file morkBead.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      if ( !this->IsShutNode() )
      {
        mBead_Color = 0;
        this->MarkShut();
      }
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

mdb_err morkNode::CloseMdbObject ( morkEnv ev) [inherited]

Definition at line 243 of file morkNode.cpp.

{
  // if only one ref, Handle_CutStrongRef will clean up better.
  if (mNode_Uses == 1)
    return CutStrongRef(ev);

  mdb_err outErr = 0;
  
  if ( IsNode() && IsOpenNode() )
  {
    if ( ev )
    {
      CloseMorkNode(ev);
      outErr = ev->AsErr();
    }
  }
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in orkinFactory, orkinPortTableCursor, orkinRowCellCursor, orkinRow, orkinTableRowCursor, orkinThumb, morkStore, orkinCell, orkinEnv, orkinFile, orkinSorting, orkinStore, orkinTable, morkObject, and morkCursor.

Definition at line 238 of file morkNode.cpp.

{
  return morkNode::CloseMdbObject((morkEnv *) mev);
}

Here is the call graph for this function:

Reimplemented from morkSpace.

Definition at line 104 of file morkRowSpace.cpp.

{
  if ( this->IsOpenNode() )
  {
    this->MarkClosing();
    this->CloseRowSpace(ev);
    this->MarkShut();  
  }
}

Here is the call graph for this function:

void morkNode::CloseNode ( morkEnv ev) [inherited]

Definition at line 384 of file morkNode.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
      this->MarkShut();
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 153 of file morkRowSpace.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      morkAtomRowMap** cache = mRowSpace_IndexCache;
      morkAtomRowMap** cacheEnd = cache + morkRowSpace_kPrimeCacheSize;
      --cache; // prepare for preincrement:
      while ( ++cache < cacheEnd )
      {
        if ( *cache )
          morkAtomRowMap::SlotStrongAtomRowMap(0, ev, cache);
      }
      
      mRowSpace_Tables.CloseMorkNode(ev);
      
      morkStore* store = mSpace_Store;
      if ( store )
        this->CutAllRows(ev, &store->mStore_Pool);
      
      mRowSpace_Rows.CloseMorkNode(ev);
      this->CloseSpace(ev);
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkSpace::CloseSpace ( morkEnv ev) [inherited]

Definition at line 133 of file morkSpace.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      morkStore::SlotWeakStore((morkStore*) 0, ev, &mSpace_Store);
      mBead_Color = 0; // this->CloseBead();
      this->MarkShut();
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static/ void

Definition at line 229 of file morkRowSpace.cpp.

{
  if ( this->IsRowSpaceClean() )
    this->MaybeDirtyStoreAndSpace();
  
  mork_num outSlots = mRowSpace_Rows.MapFill();

#ifdef MORK_ENABLE_ZONE_ARENAS
  MORK_USED_2(ev, ioPool);
  return 0;
#else /*MORK_ENABLE_ZONE_ARENAS*/
  morkZone* zone = &mSpace_Store->mStore_Zone;
  morkRow* r = 0; // old key row in the map
  mork_change* c = 0;

#ifdef MORK_ENABLE_PROBE_MAPS
  morkRowProbeMapIter i(ev, &mRowSpace_Rows);
#else /*MORK_ENABLE_PROBE_MAPS*/
  morkRowMapIter i(ev, &mRowSpace_Rows);
#endif /*MORK_ENABLE_PROBE_MAPS*/
  
  for ( c = i.FirstRow(ev, &r); c && ev->Good();
        c = i.NextRow(ev, &r) )
  {
    if ( r )
    {
      if ( r->IsRow() )
      {
        if ( r->mRow_Object )
        {
          morkRowObject::SlotWeakRowObject((morkRowObject*) 0, ev,
            &r->mRow_Object);
        }
        ioPool->ZapRow(ev, r, zone);
      }
      else
        r->NonRowTypeWarning(ev);
    }
    else
      ev->NilPointerError();
    
#ifdef MORK_ENABLE_PROBE_MAPS
    // cut nothing from the map
#else /*MORK_ENABLE_PROBE_MAPS*/
    i.CutHereRow(ev, /*key*/ (morkRow**) 0);
#endif /*MORK_ENABLE_PROBE_MAPS*/
  }
#endif /*MORK_ENABLE_ZONE_ARENAS*/
  
  
  return outSlots;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_uses morkNode::CutStrongRef ( morkEnv ev) [virtual, inherited]

Reimplemented in morkTable.

Definition at line 580 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      if ( this->cut_use_count(ev) )
        outRefs = this->CutWeakRef(ev);
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_refs morkNode::CutWeakRef ( morkEnv ev) [inherited]

Definition at line 623 of file morkNode.cpp.

{
  mork_refs outRefs = 0;
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_uses uses = mNode_Uses;
      mork_refs refs = mNode_Refs;
      if ( refs ) // not yet zero?
        mNode_Refs = --refs;
      else
        this->RefsUnderflowWarning(ev);

      if ( refs < uses ) // need to fix broken refs/uses relation?
      { 
        this->RefsUnderUsesWarning(ev);
        mNode_Refs = mNode_Uses = refs = uses;
      }
        
      outRefs = refs;
      if ( !refs ) // last reference gone? time to destroy node?
        this->ZapOld(ev, mNode_Heap); // self destroy, use this no longer
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
  return outRefs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 528 of file morkRowSpace.cpp.

{
  if ( mRowSpace_IndexCount && ev->Good() )
  {
    mork_count wrap = 0; // count times wrap-around occurs
    morkAtomRowMap** slot = mRowSpace_IndexCache; // table
    morkAtomRowMap** end = slot + morkRowSpace_kPrimeCacheSize;
    slot += ( inCol % morkRowSpace_kPrimeCacheSize ); // hash
    morkAtomRowMap* map = *slot;
    while ( map ) // another used slot to examine?
    {
      if ( inCol == map->mAtomRowMap_IndexColumn ) // found col?
        return map;
      if ( ++slot >= end ) // wrap around?
      {
        slot = mRowSpace_IndexCache;
        if ( ++wrap > 1 ) // wrapped more than once?
          return (morkAtomRowMap*) 0; // stop searching
      }
      map = *slot;
    }
  }
  return (morkAtomRowMap*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkRowSpace::FindRow ( morkEnv ev,
mork_column  inColumn,
const mdbYarn inYarn 
)

Definition at line 554 of file morkRowSpace.cpp.

{
  morkRow* outRow = 0;

  // if yarn hasn't been atomized, there can't be a corresponding row,
  // so pass in PR_FALSE to not create the row - should help history bloat
  morkAtom* atom = mSpace_Store->YarnToAtom(ev, inYarn, PR_FALSE);
  if ( atom ) // have or created an atom corresponding to input yarn?
  {
    mork_aid atomAid = atom->GetBookAtomAid();
    if ( atomAid ) // atom has an identity for use in hash table?
    {
      morkAtomRowMap* map = this->ForceMap(ev, inCol);
      if ( map ) // able to find or create index for col?
      {
        outRow = map->GetAid(ev, atomAid); // search for row
      }
    }
  }
  
  return outRow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 283 of file morkRowSpace.cpp.

{
  if ( inTableKind )
  {
#ifdef MORK_BEAD_OVER_NODE_MAPS

    morkTableMapIter i(ev, &mRowSpace_Tables);
    morkTable* table = i.FirstTable(ev);
    for ( ; table && ev->Good(); table = i.NextTable(ev) )
          
#else /*MORK_BEAD_OVER_NODE_MAPS*/
    mork_tid* key = 0; // nil pointer to suppress key access
    morkTable* table = 0; // old table in the map

    mork_change* c = 0;
    morkTableMapIter i(ev, &mRowSpace_Tables);
    for ( c = i.FirstTable(ev, key, &table); c && ev->Good();
          c = i.NextTable(ev, key, &table) )
#endif /*MORK_BEAD_OVER_NODE_MAPS*/
    {
      if ( table->mTable_Kind == inTableKind )
        return table;
    }
  }
  else
    this->ZeroKindError(ev);
    
  return (morkTable*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkTable* morkRowSpace::FindTableByTid ( morkEnv ev,
mork_tid  inTid 
) [inline]

Definition at line 173 of file morkRowSpace.h.

  { return mRowSpace_Tables.GetTable(ev, inTid); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 484 of file morkRowSpace.cpp.

{
  morkAtomRowMap* outMap = this->FindMap(ev, inCol);
  
  if ( !outMap && ev->Good() ) // no such existing index?
  {
    if ( mRowSpace_IndexCount < morkRowSpace_kMaxIndexCount )
    {
      morkAtomRowMap* map = this->make_index(ev, inCol);
      if ( map ) // created a new index for col?
      {
        mork_count wrap = 0; // count times wrap-around occurs
        morkAtomRowMap** slot = mRowSpace_IndexCache; // table
        morkAtomRowMap** end = slot + morkRowSpace_kPrimeCacheSize;
        slot += ( inCol % morkRowSpace_kPrimeCacheSize ); // hash
        while ( *slot ) // empty slot not yet found?
        {
          if ( ++slot >= end ) // wrap around?
          {
            slot = mRowSpace_IndexCache; // back to table start
            if ( ++wrap > 1 ) // wrapped more than once?
            {
              ev->NewError("no free cache slots"); // disaster
              break; // end while loop
            }
          }
        }
        if ( ev->Good() ) // everything went just fine?
        {
          ++mRowSpace_IndexCount; // note another new map
          *slot = map; // install map in the hash table
          outMap = map; // return the new map from function
        }
        else
          map->CutStrongRef(ev); // discard map on error
      }
    }
    else
      ev->NewError("too many indexes"); // why so many indexes?
  }
  return outMap;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char * morkNode::GetNodeAccessAsString ( ) const [inherited]

Definition at line 658 of file morkNode.cpp.

{
  const char* outString = morkNode_kBroken;
  switch( mNode_Access )
  {
    case morkAccess_kOpen: outString = "open"; break;
    case morkAccess_kClosing: outString = "closing"; break;
    case morkAccess_kShut: outString = "shut"; break;
    case morkAccess_kDead: outString = "dead"; break;
  }
  return outString;
}
const char * morkNode::GetNodeUsageAsString ( ) const [inherited]

Definition at line 672 of file morkNode.cpp.

{
  const char* outString = morkNode_kBroken;
  switch( mNode_Usage )
  {
    case morkUsage_kHeap: outString = "heap"; break;
    case morkUsage_kStack: outString = "stack"; break;
    case morkUsage_kMember: outString = "member"; break;
    case morkUsage_kGlobal: outString = "global"; break;
    case morkUsage_kPool: outString = "pool"; break;
    case morkUsage_kNone: outString = "none"; break;
  }
  return outString;
}
morkPool * morkSpace::GetSpaceStorePool ( ) const [inherited]

Definition at line 165 of file morkSpace.cpp.

{
  return &mSpace_Store->mStore_Pool;
}

Here is the caller graph for this function:

mork_bool morkNode::GoodRefs ( ) const [inline, inherited]

Definition at line 216 of file morkNode.h.

{ return mNode_Refs >= mNode_Uses; }
mork_bool morkNode::HasNodeAccess ( ) const [inline, inherited]

Definition at line 251 of file morkNode.h.

  { return ( IsOpenNode() || IsShutNode() || IsClosingNode() ); }

Here is the call graph for this function:

mork_bool morkNode::IsAsleep ( ) const [inline, inherited]

Definition at line 142 of file morkNode.h.

mork_bool morkBead::IsBead ( ) const [inline, inherited]

Definition at line 113 of file morkBead.h.

  { return IsNode() && mNode_Derived == morkDerived_kBead; }

Here is the call graph for this function:

mork_bool morkNode::IsClosingNode ( ) const [inline, inherited]

Definition at line 245 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsDeadNode ( ) const [inline, inherited]

Definition at line 242 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsFrozen ( ) const [inline, inherited]

Definition at line 140 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsHeapNode ( ) const [inline, inherited]

Definition at line 233 of file morkNode.h.

  { return mNode_Usage == morkUsage_kHeap; }
mork_bool morkNode::IsMutable ( ) const [inline, inherited]

Definition at line 141 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkNode::IsNode ( ) const [inline, inherited]

Definition at line 193 of file morkNode.h.

  { return mNode_Base == morkBase_kNode; }
mork_bool morkNode::IsNodeClean ( ) const [inline, inherited]

Definition at line 147 of file morkNode.h.

{ return mNode_Load == morkLoad_kClean; }

Here is the caller graph for this function:

mork_bool morkNode::IsNodeDirty ( ) const [inline, inherited]

Definition at line 148 of file morkNode.h.

{ return mNode_Load == morkLoad_kDirty; }

Here is the caller graph for this function:

mork_bool morkNode::IsOpenNode ( ) const [inline, inherited]

Definition at line 236 of file morkNode.h.

mork_bool morkNode::IsOpenOrClosingNode ( ) const [inline, inherited]

Definition at line 248 of file morkNode.h.

  { return IsOpenNode() || IsClosingNode(); }

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkRowSpace::IsRowSpace ( ) const [inline]

Definition at line 147 of file morkRowSpace.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file morkRowSpace.h.

{ return this->IsNodeClean(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 134 of file morkRowSpace.h.

{ return this->IsNodeDirty(); }

Here is the call graph for this function:

mork_bool morkNode::IsShutNode ( ) const [inline, inherited]

Definition at line 239 of file morkNode.h.

Here is the caller graph for this function:

mork_bool morkSpace::IsSpace ( ) const [inline, inherited]

Definition at line 117 of file morkSpace.h.

Here is the call graph for this function:

mork_bool morkSpace::IsSpaceClean ( ) const [inline, inherited]

Definition at line 100 of file morkSpace.h.

{ return this->IsNodeClean(); }

Here is the call graph for this function:

mork_bool morkSpace::IsSpaceDirty ( ) const [inline, inherited]

Definition at line 101 of file morkSpace.h.

{ return this->IsNodeDirty(); }

Here is the call graph for this function:

morkAtomRowMap * morkRowSpace::make_index ( morkEnv ev,
mork_column  inColumn 
) [protected]

Definition at line 441 of file morkRowSpace.cpp.

{
  morkAtomRowMap* outMap = 0;
  nsIMdbHeap* heap = mRowSpace_SlotHeap;
  if ( heap ) // have expected heap for allocations?
  {
    morkAtomRowMap* map = new(*heap, ev)
      morkAtomRowMap(ev, morkUsage::kHeap, heap, heap, inCol);
    
    if ( map ) // able to create new map index?
    {
      if ( ev->Good() ) // no errors during construction?
      {
#ifdef MORK_ENABLE_PROBE_MAPS
        morkRowProbeMapIter i(ev, &mRowSpace_Rows);
#else /*MORK_ENABLE_PROBE_MAPS*/
        morkRowMapIter i(ev, &mRowSpace_Rows);
#endif /*MORK_ENABLE_PROBE_MAPS*/
        mork_change* c = 0;
        morkRow* row = 0;
        mork_aid aidKey = 0;
        
        for ( c = i.FirstRow(ev, &row); c && ev->Good();
              c = i.NextRow(ev, &row) ) // another row in space?
        {
          aidKey = row->GetCellAtomAid(ev, inCol);
          if ( aidKey ) // row has indexed attribute?
            map->AddAid(ev, aidKey, row); // include in map
        }
      }
      if ( ev->Good() ) // no errors constructing index?
        outMap = map; // return from function
      else
        map->CutStrongRef(ev); // discard map on error
    }
  }
  else
    ev->NilPointerError();
  
  return outMap;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void * morkNode::MakeNew ( size_t  inSize,
nsIMdbHeap ioHeap,
morkEnv ev 
) [static, inherited]

Definition at line 177 of file morkNode.cpp.

{
  void* node = 0;
  if ( &ioHeap )
  {
    ioHeap.Alloc(ev->AsMdbEnv(), inSize, (void **) &node);
    if ( !node )
      ev->OutOfMemoryError();
  }
  else
    ev->NilPointerError();
  
  return node;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 416 of file morkRowSpace.cpp.

{
  mork_rid outRid = 0;
  mork_rid id = mRowSpace_NextRowId;
  mork_num count = 9; // try up to eight times
  mdbOid oid;
  oid.mOid_Scope = this->SpaceScope();
  
  while ( !outRid && --count ) // still trying to find an unused row ID?
  {
    oid.mOid_Id = id;
    if ( !mRowSpace_Rows.GetOid(ev, &oid) )
      outRid = id;
    else
    {
      MORK_ASSERT(morkBool_kFalse); // alert developer about ID problems
      ++id;
    }
  }
  
  mRowSpace_NextRowId = id + 1;
  return outRid;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 394 of file morkRowSpace.cpp.

{
  mork_tid outTid = 0;
  mork_tid id = mRowSpace_NextTableId;
  mork_num count = 9; // try up to eight times
  
  while ( !outTid && --count ) // still trying to find an unused table ID?
  {
    if ( !mRowSpace_Tables.GetTable(ev, id) )
      outTid = id;
    else
    {
      MORK_ASSERT(morkBool_kFalse); // alert developer about ID problems
      ++id;
    }
  }
  
  mRowSpace_NextTableId = id + 1;
  return outTid;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::MarkClosing ( ) [inline, inherited]

Definition at line 255 of file morkNode.h.

void morkNode::MarkDead ( ) [inline, inherited]

Definition at line 256 of file morkNode.h.

void morkNode::MarkShut ( ) [inline, inherited]

Definition at line 254 of file morkNode.h.

Definition at line 170 of file morkSpace.cpp.

{
  morkStore* store = mSpace_Store;
  if ( store && store->mStore_CanDirty )
  {
    store->SetStoreDirty();
    mSpace_CanDirty = morkBool_kTrue;
  }
  
  if ( mSpace_CanDirty )
  {
    this->SetSpaceDirty();
    return morkBool_kTrue;
  }
  
  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 212 of file morkRowSpace.cpp.

{
  ev->NewError("row ID is -1");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 614 of file morkRowSpace.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    mork_rid id = this->MakeNewRowId(ev);
    if ( id )
    {
      morkStore* store = mSpace_Store;
      if ( store )
      {
        mdbOid oid;
        oid.mOid_Scope = this->SpaceScope();
        oid.mOid_Id = id;
        morkPool* pool = this->GetSpaceStorePool();
        morkRow* row = pool->NewRow(ev, &store->mStore_Zone);
        if ( row )
        {
          row->InitRow(ev, &oid, this, /*length*/ 0, pool);
          
          if ( ev->Good() && mRowSpace_Rows.AddRow(ev, row) )
            outRow = row;
          else
            pool->ZapRow(ev, row, &store->mStore_Zone);

          if ( this->IsRowSpaceClean() && store->mStore_CanDirty )
            this->MaybeDirtyStoreAndSpace(); // InitRow() does already
        }
      }
      else
        this->NilSpaceStoreError(ev);
    }
  }
  return outRow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 578 of file morkRowSpace.cpp.

{
  morkRow* outRow = mRowSpace_Rows.GetOid(ev, inOid);
  MORK_ASSERT(outRow==0);
  if ( !outRow && ev->Good() )
  {
    morkStore* store = mSpace_Store;
    if ( store )
    {
      morkPool* pool = this->GetSpaceStorePool();
      morkRow* row = pool->NewRow(ev, &store->mStore_Zone);
      if ( row )
      {
        row->InitRow(ev, inOid, this, /*length*/ 0, pool);
        
        if ( ev->Good() && mRowSpace_Rows.AddRow(ev, row) )
        {
          outRow = row;
          mork_rid rid = inOid->mOid_Id;
          if ( mRowSpace_NextRowId <= rid )
            mRowSpace_NextRowId = rid + 1;
        }
        else
          pool->ZapRow(ev, row, &store->mStore_Zone);

        if ( this->IsRowSpaceClean() && store->mStore_CanDirty )
          this->MaybeDirtyStoreAndSpace(); // InitRow() does already
      }
    }
    else
      this->NilSpaceStoreError(ev);
  }
  return outRow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkTable * morkRowSpace::NewTable ( morkEnv ev,
mork_kind  inTableKind,
mdb_bool  inMustBeUnique,
const mdbOid inOptionalMetaRowOid 
)

Definition at line 351 of file morkRowSpace.cpp.

{
  morkTable* outTable = 0;
  morkStore* store = mSpace_Store;
  
  if ( inTableKind && store )
  {
    if ( inMustBeUnique ) // need to look for existing table first?
      outTable = this->FindTableByKind(ev, inTableKind);
      
    if ( !outTable && ev->Good() )
    {
      mork_tid id = this->MakeNewTableId(ev);
      if ( id )
      {
        nsIMdbHeap* heap = mSpace_Store->mPort_Heap;
        morkTable* table = new(*heap, ev)
          morkTable(ev, morkUsage::kHeap, heap, mSpace_Store, heap, this,
            inOptionalMetaRowOid, id, inTableKind, inMustBeUnique);
        if ( table )
        {
          if ( mRowSpace_Tables.AddTable(ev, table) )
            outTable = table;
          else
            table->Release();

          if ( this->IsRowSpaceClean() && store->mStore_CanDirty )
            this->MaybeDirtyStoreAndSpace(); // morkTable does already
        }
      }
    }
  }
  else if ( store )
    this->ZeroKindError(ev);
  else
    this->NilSpaceStoreError(ev);
    
  return outTable;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkTable * morkRowSpace::NewTableWithTid ( morkEnv ev,
mork_tid  inTid,
mork_kind  inTableKind,
const mdbOid inOptionalMetaRowOid 
)

Definition at line 314 of file morkRowSpace.cpp.

{
  morkTable* outTable = 0;
  morkStore* store = mSpace_Store;
  
  if ( inTableKind && store )
  {
    mdb_bool mustBeUnique = morkBool_kFalse;
    nsIMdbHeap* heap = store->mPort_Heap;
    morkTable* table = new(*heap, ev)
      morkTable(ev, morkUsage::kHeap, heap, store, heap, this,
        inOptionalMetaRowOid, inTid, inTableKind, mustBeUnique);
    if ( table )
    {
      if ( mRowSpace_Tables.AddTable(ev, table) )
      {
        outTable = table;
        if ( mRowSpace_NextTableId <= inTid )
          mRowSpace_NextTableId = inTid + 1;
      }
        
      if ( this->IsRowSpaceClean() && store->mStore_CanDirty )
        this->MaybeDirtyStoreAndSpace(); // morkTable does already

    }
  }
  else if ( store )
    this->ZeroKindError(ev);
  else
    this->NilSpaceStoreError(ev);
    
  return outTable;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::NilHeapError ( morkEnv ev) const [inherited]

Definition at line 354 of file morkNode.cpp.

{
  ev->NewError("nil mNode_Heap");
}

Here is the caller graph for this function:

void morkSpace::NilSpaceStoreError ( morkEnv ev) [static, inherited]

Definition at line 160 of file morkSpace.cpp.

{
  ev->NewError("nil mSpace_Store");
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_usage morkNode::NodeUsage ( ) const [inline, inherited]

Definition at line 231 of file morkNode.h.

{ return mNode_Usage; }
void morkSpace::NonAsciiSpaceScopeName ( morkEnv ev) [static, inherited]

Definition at line 154 of file morkSpace.cpp.

{
  ev->NewError("SpaceScope() > 0x7F");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::NonMutableNodeError ( morkEnv ev) const [inherited]

Definition at line 348 of file morkNode.cpp.

{
  ev->NewError("non-mutable-morkNode");
}

Here is the caller graph for this function:

void morkNode::NonNodeError ( morkEnv ev) const [inherited]

Definition at line 336 of file morkNode.cpp.

{
  ev->NewError("non-morkNode");
}
void morkNode::NonOpenNodeError ( morkEnv ev) const [inherited]

Definition at line 342 of file morkNode.cpp.

{
  ev->NewError("non-open-morkNode");
}

Here is the caller graph for this function:

Definition at line 188 of file morkRowSpace.cpp.

{
  ev->NewError("non morkRowSpace");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* morkNode::operator new ( size_t  inSize,
nsIMdbHeap ioHeap,
morkEnv ev 
) [inline, inherited]

Reimplemented in morkTable, morkFactory, morkPool, and morkSorting.

Definition at line 159 of file morkNode.h.

  { return morkNode::MakeNew(inSize, ioHeap, ev); }

Here is the call graph for this function:

void morkNode::RefsOverflowWarning ( morkEnv ev) const [inherited]

Definition at line 360 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Refs overflow");
}

Here is the caller graph for this function:

void morkNode::RefsUnderflowWarning ( morkEnv ev) const [inherited]

Definition at line 372 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Refs underflow");
}

Here is the caller graph for this function:

void morkNode::RefsUnderUsesWarning ( morkEnv ev) const [inherited]

Definition at line 330 of file morkNode.cpp.

{
  ev->NewError("mNode_Refs < mNode_Uses");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkNode::SetAsleep ( ) [inline, inherited]

Definition at line 138 of file morkNode.h.

void morkNode::SetFrozen ( ) [inline, inherited]

Definition at line 136 of file morkNode.h.

void morkNode::SetMutable ( ) [inline, inherited]

Definition at line 137 of file morkNode.h.

void morkNode::SetNodeClean ( ) [inline, inherited]

Definition at line 144 of file morkNode.h.

Here is the caller graph for this function:

void morkNode::SetNodeDirty ( ) [inline, inherited]

Definition at line 145 of file morkNode.h.

Here is the caller graph for this function:

Definition at line 131 of file morkRowSpace.h.

{ this->SetNodeClean(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 130 of file morkRowSpace.h.

{ this->SetNodeDirty(); }

Here is the call graph for this function:

Here is the caller graph for this function:

void morkSpace::SetSpaceClean ( ) [inline, inherited]

Definition at line 98 of file morkSpace.h.

{ this->SetNodeClean(); }

Here is the call graph for this function:

void morkSpace::SetSpaceDirty ( ) [inline, inherited]

Definition at line 97 of file morkSpace.h.

{ this->SetNodeDirty(); }

Here is the call graph for this function:

Here is the caller graph for this function:

void morkSpace::SetSpaceScope ( mork_scope  inScope) [inline, inherited]

Definition at line 85 of file morkSpace.h.

{ mBead_Color = inScope; }
static void morkBead::SlotStrongBead ( morkBead me,
morkEnv ev,
morkBead **  ioSlot 
) [inline, static, inherited]

Definition at line 124 of file morkBead.h.

  { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

void morkNode::SlotStrongNode ( morkNode me,
morkEnv ev,
morkNode **  ioSlot 
) [static, inherited]

Definition at line 466 of file morkNode.cpp.

{
  morkNode* node = *ioSlot;
  if ( me != node )
  {
    if ( node )
    {
      // what if this nulls out the ev and causes asserts?
      // can we move this after the CutStrongRef()?
      *ioSlot = 0;
      node->CutStrongRef(ev);
    }
    if ( me && me->AddStrongRef(ev) )
      *ioSlot = me;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void morkRowSpace::SlotStrongRowSpace ( morkRowSpace me,
morkEnv ev,
morkRowSpace **  ioSlot 
) [inline, static]

Definition at line 198 of file morkRowSpace.h.

  { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

Here is the caller graph for this function:

static void morkSpace::SlotStrongSpace ( morkSpace me,
morkEnv ev,
morkSpace **  ioSlot 
) [inline, static, inherited]

Definition at line 135 of file morkSpace.h.

  { morkNode::SlotStrongNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

static void morkBead::SlotWeakBead ( morkBead me,
morkEnv ev,
morkBead **  ioSlot 
) [inline, static, inherited]

Definition at line 120 of file morkBead.h.

  { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

void morkNode::SlotWeakNode ( morkNode me,
morkEnv ev,
morkNode **  ioSlot 
) [static, inherited]

Definition at line 489 of file morkNode.cpp.

{
  morkNode* node = *ioSlot;
  if ( me != node )
  {
    if ( node )
    {
      *ioSlot = 0;
      node->CutWeakRef(ev);
    }
    if ( me && me->AddWeakRef(ev) )
      *ioSlot = me;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void morkRowSpace::SlotWeakRowSpace ( morkRowSpace me,
morkEnv ev,
morkRowSpace **  ioSlot 
) [inline, static]

Definition at line 194 of file morkRowSpace.h.

  { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

static void morkSpace::SlotWeakSpace ( morkSpace me,
morkEnv ev,
morkSpace **  ioSlot 
) [inline, static, inherited]

Definition at line 131 of file morkSpace.h.

  { morkNode::SlotWeakNode((morkNode*) me, ev, (morkNode**) ioSlot); }

Here is the call graph for this function:

mork_tid morkSpace::SpaceScope ( ) const [inline, inherited]

Definition at line 84 of file morkSpace.h.

{ return mBead_Color; }

Here is the caller graph for this function:

mork_uses morkNode::StrongRefsOnly ( ) const [inline, inherited]

Definition at line 219 of file morkNode.h.

{ return mNode_Uses; }

Here is the caller graph for this function:

void morkNode::UsesOverflowWarning ( morkEnv ev) const [inherited]

Definition at line 366 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Uses overflow");
}
void morkNode::UsesUnderflowWarning ( morkEnv ev) const [inherited]

Definition at line 378 of file morkNode.cpp.

{
  ev->NewWarning("mNode_Uses underflow");
}

Here is the caller graph for this function:

mork_refs morkNode::WeakRefsOnly ( ) const [inline, inherited]

Definition at line 220 of file morkNode.h.

{ return (mork_refs) ( mNode_Refs - mNode_Uses ); }

Here is the caller graph for this function:

void morkNode::ZapOld ( morkEnv ev,
nsIMdbHeap ioHeap 
) [inherited]

Definition at line 193 of file morkNode.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      mork_usage usage = mNode_Usage; // mNode_Usage before ~morkNode
      this->morkNode::~morkNode(); // first call polymorphic destructor
      if ( ioHeap ) // was this node heap allocated?
        ioHeap->Free(ev->AsMdbEnv(), this);
      else if ( usage == morkUsage_kPool ) // mNode_Usage before ~morkNode
      {
        morkHandle* h = (morkHandle*) this;
        if ( h->IsHandle() && h->GoodHandleTag() )
        {
          if ( h->mHandle_Face )
          {
            if (ev->mEnv_HandlePool)
              ev->mEnv_HandlePool->ZapHandle(ev, h->mHandle_Face);
            else if (h->mHandle_Env && h->mHandle_Env->mEnv_HandlePool)
              h->mHandle_Env->mEnv_HandlePool->ZapHandle(ev, h->mHandle_Face);
          }
          else
            ev->NilPointerError();
        }
      }
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 194 of file morkRowSpace.cpp.

{
  ev->NewError("zero table kind");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 200 of file morkRowSpace.cpp.

{
  ev->NewError("zero row scope");
}

Here is the call graph for this function:

Definition at line 206 of file morkRowSpace.cpp.

{
  ev->NewError("zero table ID");
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class morkHandleFrame [friend, inherited]

Reimplemented in morkHandle.

Definition at line 131 of file morkNode.h.


Member Data Documentation

Definition at line 83 of file morkBead.h.

Definition at line 122 of file morkNode.h.

Definition at line 119 of file morkNode.h.

Definition at line 120 of file morkNode.h.

Definition at line 117 of file morkNode.h.

Definition at line 125 of file morkNode.h.

Definition at line 124 of file morkNode.h.

Definition at line 128 of file morkNode.h.

Definition at line 123 of file morkNode.h.

Definition at line 127 of file morkNode.h.

Definition at line 125 of file morkRowSpace.h.

Definition at line 122 of file morkRowSpace.h.

Definition at line 120 of file morkRowSpace.h.

Definition at line 119 of file morkRowSpace.h.

Definition at line 115 of file morkRowSpace.h.

Definition at line 110 of file morkRowSpace.h.

Definition at line 117 of file morkRowSpace.h.

Definition at line 127 of file morkRowSpace.h.

Definition at line 93 of file morkSpace.h.

Definition at line 91 of file morkSpace.h.

Definition at line 92 of file morkSpace.h.

Definition at line 94 of file morkSpace.h.

Definition at line 89 of file morkSpace.h.


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