Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Friends
morkStore Class Reference

#include <morkStore.h>

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

List of all members.

Public Member Functions

void ClosePort (morkEnv *ev)
mork_bool IsPort () const
NS_IMETHOD GetWeakRefCount (nsIMdbEnv *ev, mdb_count *outCount)
NS_IMETHOD GetStrongRefCount (nsIMdbEnv *ev, mdb_count *outCount)
NS_IMETHOD AddWeakRef (nsIMdbEnv *ev)
NS_IMETHOD AddStrongRef (nsIMdbEnv *ev)
NS_IMETHOD CutWeakRef (nsIMdbEnv *ev)
NS_IMETHOD CutStrongRef (nsIMdbEnv *ev)
NS_IMETHOD CloseMdbObject (nsIMdbEnv *ev)
NS_IMETHOD IsOpenMdbObject (nsIMdbEnv *ev, mdb_bool *outOpen)
NS_IMETHOD GetIsPortReadonly (nsIMdbEnv *ev, mdb_bool *outBool)
NS_IMETHOD GetIsStore (nsIMdbEnv *ev, mdb_bool *outBool)
NS_IMETHOD GetIsStoreAndDirty (nsIMdbEnv *ev, mdb_bool *outBool)
NS_IMETHOD GetUsagePolicy (nsIMdbEnv *ev, mdbUsagePolicy *ioUsagePolicy)
NS_IMETHOD SetUsagePolicy (nsIMdbEnv *ev, const mdbUsagePolicy *inUsagePolicy)
NS_IMETHOD IdleMemoryPurge (nsIMdbEnv *ev, mdb_size *outEstimatedBytesFreed)
NS_IMETHOD SessionMemoryPurge (nsIMdbEnv *ev, mdb_size inDesiredBytesFreed, mdb_size *outEstimatedBytesFreed)
NS_IMETHOD PanicMemoryPurge (nsIMdbEnv *ev, mdb_size *outEstimatedBytesFreed)
NS_IMETHOD GetPortFilePath (nsIMdbEnv *ev, mdbYarn *outFilePath, mdbYarn *outFormatVersion)
NS_IMETHOD GetPortFile (nsIMdbEnv *ev, nsIMdbFile **acqFile)
NS_IMETHOD BestExportFormat (nsIMdbEnv *ev, mdbYarn *outFormatVersion)
NS_IMETHOD CanExportToFormat (nsIMdbEnv *ev, const char *inFormatVersion, mdb_bool *outCanExport)
NS_IMETHOD ExportToFormat (nsIMdbEnv *ev, nsIMdbFile *ioFile, const char *inFormatVersion, nsIMdbThumb **acqThumb)
NS_IMETHOD TokenToString (nsIMdbEnv *ev, mdb_token inToken, mdbYarn *outTokenName)
NS_IMETHOD StringToToken (nsIMdbEnv *ev, const char *inTokenName, mdb_token *outToken)
NS_IMETHOD QueryToken (nsIMdbEnv *ev, const char *inTokenName, mdb_token *outToken)
NS_IMETHOD HasRow (nsIMdbEnv *ev, const mdbOid *inOid, mdb_bool *outHasRow)
NS_IMETHOD GetRowRefCount (nsIMdbEnv *ev, const mdbOid *inOid, mdb_count *outRefCount)
NS_IMETHOD GetRow (nsIMdbEnv *ev, const mdbOid *inOid, nsIMdbRow **acqRow)
NS_IMETHOD FindRow (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_column inColumn, const mdbYarn *inTargetCellValue, mdbOid *outRowOid, nsIMdbRow **acqRow)
NS_IMETHOD HasTable (nsIMdbEnv *ev, const mdbOid *inOid, mdb_bool *outHasTable)
NS_IMETHOD GetTable (nsIMdbEnv *ev, const mdbOid *inOid, nsIMdbTable **acqTable)
NS_IMETHOD HasTableKind (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_count *outTableCount, mdb_bool *outSupportsTable)
NS_IMETHOD GetTableKind (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_count *outTableCount, mdb_bool *outMustBeUnique, nsIMdbTable **acqTable)
NS_IMETHOD GetPortTableCursor (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, nsIMdbPortTableCursor **acqCursor)
NS_IMETHOD ShouldCompress (nsIMdbEnv *ev, mdb_percent inPercentWaste, mdb_percent *outActualWaste, mdb_bool *outShould)
NS_IMETHOD NewTable (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_bool inMustBeUnique, const mdbOid *inOptionalMetaRowOid, nsIMdbTable **acqTable)
NS_IMETHOD NewTableWithOid (nsIMdbEnv *ev, const mdbOid *inOid, mdb_kind inTableKind, mdb_bool inMustBeUnique, const mdbOid *inOptionalMetaRowOid, nsIMdbTable **acqTable)
NS_IMETHOD RowScopeHasAssignedIds (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_bool *outCallerAssigned, mdb_bool *outStoreAssigned)
NS_IMETHOD SetCallerAssignedIds (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_bool *outCallerAssigned, mdb_bool *outStoreAssigned)
NS_IMETHOD SetStoreAssignedIds (nsIMdbEnv *ev, mdb_scope inRowScope, mdb_bool *outCallerAssigned, mdb_bool *outStoreAssigned)
NS_IMETHOD NewRowWithOid (nsIMdbEnv *ev, const mdbOid *inOid, nsIMdbRow **acqRow)
NS_IMETHOD NewRow (nsIMdbEnv *ev, mdb_scope inRowScope, nsIMdbRow **acqRow)
NS_IMETHOD ImportContent (nsIMdbEnv *ev, mdb_scope inRowScope, nsIMdbPort *ioPort, nsIMdbThumb **acqThumb)
NS_IMETHOD ImportFile (nsIMdbEnv *ev, nsIMdbFile *ioFile, nsIMdbThumb **acqThumb)
NS_IMETHOD ShareAtomColumnsHint (nsIMdbEnv *ev, mdb_scope inScopeHint, const mdbColumnSet *inColumnSet)
NS_IMETHOD AvoidAtomColumnsHint (nsIMdbEnv *ev, const mdbColumnSet *inColumnSet)
NS_IMETHOD SmallCommit (nsIMdbEnv *ev)
NS_IMETHOD LargeCommit (nsIMdbEnv *ev, nsIMdbThumb **acqThumb)
NS_IMETHOD SessionCommit (nsIMdbEnv *ev, nsIMdbThumb **acqThumb)
NS_IMETHOD CompressCommit (nsIMdbEnv *ev, nsIMdbThumb **acqThumb)
void SetStoreDirty ()
void SetStoreClean ()
mork_bool IsStoreClean () const
mork_bool IsStoreDirty () const
void MaybeDirtyStore ()
mork_percent PercentOfStoreWasted (morkEnv *ev)
void SetStoreAndAllSpacesCanDirty (morkEnv *ev, mork_bool inCanDirty)
morkFarBookAtomStageAliasAsFarBookAtom (morkEnv *ev, const morkMid *inMid, morkAtomSpace *ioSpace, mork_cscode inForm)
morkFarBookAtomStageYarnAsFarBookAtom (morkEnv *ev, const mdbYarn *inYarn, morkAtomSpace *ioSpace)
morkFarBookAtomStageStringAsFarBookAtom (morkEnv *ev, const char *inString, mork_cscode inForm, morkAtomSpace *ioSpace)
mork_bool DoPreferLargeOverCompressCommit (morkEnv *ev)
morkAtomSpaceLazyGetOidAtomSpace (morkEnv *ev)
morkAtomSpaceLazyGetGroundAtomSpace (morkEnv *ev)
morkAtomSpaceLazyGetGroundColumnSpace (morkEnv *ev)
morkStreamLazyGetInStream (morkEnv *ev)
morkBuilderLazyGetBuilder (morkEnv *ev)
void ForgetBuilder (morkEnv *ev)
morkStreamLazyGetOutStream (morkEnv *ev)
morkRowSpaceLazyGetRowSpace (morkEnv *ev, mdb_scope inRowScope)
morkAtomSpaceLazyGetAtomSpace (morkEnv *ev, mdb_scope inAtomScope)
virtual void CloseMorkNode (morkEnv *ev)
virtual ~morkStore ()
 morkStore (morkEnv *ev, const morkUsage &inUsage, nsIMdbHeap *ioNodeHeap, morkFactory *inFactory, nsIMdbHeap *ioPortHeap)
void CloseStore (morkEnv *ev)
morkEnvCanUseStore (nsIMdbEnv *mev, mork_bool inMutable, mdb_err *outErr) const
mork_bool IsStore () const
morkAtomYarnToAtom (morkEnv *ev, const mdbYarn *inYarn, PRBool createIfMissing=PR_TRUE)
morkAtomAddAlias (morkEnv *ev, const morkMid &inMid, mork_cscode inForm)
void RenumberAllCollectableContent (morkEnv *ev)
nsIMdbStoreAcquireStoreHandle (morkEnv *ev)
morkPoolStorePool ()
mork_bool OpenStoreFile (morkEnv *ev, mork_bool inFrozen, nsIMdbFile *ioFile, const mdbOpenPolicy *inOpenPolicy)
mork_bool CreateStoreFile (morkEnv *ev, nsIMdbFile *ioFile, const mdbOpenPolicy *inOpenPolicy)
morkAtomCopyAtom (morkEnv *ev, const morkAtom *inAtom)
mork_token CopyToken (morkEnv *ev, mdb_token inToken, morkStore *inStore)
mork_token BufToToken (morkEnv *ev, const morkBuf *inBuf)
mork_token StringToToken (morkEnv *ev, const char *inTokenName)
mork_token QueryToken (morkEnv *ev, const char *inTokenName)
void TokenToString (morkEnv *ev, mdb_token inToken, mdbYarn *outTokenName)
mork_bool MidToOid (morkEnv *ev, const morkMid &inMid, mdbOid *outOid)
mork_bool OidToYarn (morkEnv *ev, const mdbOid &inOid, mdbYarn *outYarn)
mork_bool MidToYarn (morkEnv *ev, const morkMid &inMid, mdbYarn *outYarn)
morkBookAtomMidToAtom (morkEnv *ev, const morkMid &inMid)
morkRowMidToRow (morkEnv *ev, const morkMid &inMid)
morkTableMidToTable (morkEnv *ev, const morkMid &inMid)
morkRowOidToRow (morkEnv *ev, const mdbOid *inOid)
morkTableOidToTable (morkEnv *ev, const mdbOid *inOid, const mdbOid *inOptionalMetaRowOid)
mork_bool HasTableKind (morkEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_count *outTableCount)
morkTableGetTableKind (morkEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_count *outTableCount, mdb_bool *outMustBeUnique)
morkRowFindRow (morkEnv *ev, mdb_scope inScope, mdb_column inColumn, const mdbYarn *inTargetCellValue)
morkRowGetRow (morkEnv *ev, const mdbOid *inOid)
morkTableGetTable (morkEnv *ev, const mdbOid *inOid)
morkTableNewTable (morkEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind, mdb_bool inMustBeUnique, const mdbOid *inOptionalMetaRowOid)
morkPortTableCursorGetPortTableCursor (morkEnv *ev, mdb_scope inRowScope, mdb_kind inTableKind)
morkRowNewRowWithOid (morkEnv *ev, const mdbOid *inOid)
morkRowNewRow (morkEnv *ev, mdb_scope inRowScope)
morkThumbMakeCompressCommitThumb (morkEnv *ev, mork_bool inDoCollect)
mork_bool MarkAllStoreContentDirty (morkEnv *ev)
NS_DECL_ISUPPORTS NS_IMETHOD IsFrozenMdbObject (nsIMdbEnv *ev, mdb_bool *outIsReadonly)
NS_IMETHOD GetMdbFactory (nsIMdbEnv *ev, nsIMdbFactory **acqFactory)
mork_refs AddWeakRef (morkEnv *ev)
virtual mork_refs AddStrongRef (morkEnv *ev)
mork_refs CutWeakRef (morkEnv *ev)
virtual mork_refs CutStrongRef (morkEnv *ev)
mdb_err CloseMdbObject (morkEnv *ev)
void CloseObject (morkEnv *ev)
mork_bool IsObject () 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)
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
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 SlotWeakPort (morkPort *me, morkEnv *ev, morkPort **ioSlot)
static void SlotStrongPort (morkPort *me, morkEnv *ev, morkPort **ioSlot)
static void NonStoreTypeError (morkEnv *ev)
static void NilStoreFileError (morkEnv *ev)
static void CannotAutoAssignAtomIdentityError (morkEnv *ev)
static void SmallTokenToOneByteYarn (morkEnv *ev, mdb_token inToken, mdbYarn *outYarn)
static void SlotWeakStore (morkStore *me, morkEnv *ev, morkStore **ioSlot)
static void SlotStrongStore (morkStore *me, morkEnv *ev, morkStore **ioSlot)
static void SlotWeakObject (morkObject *me, morkEnv *ev, morkObject **ioSlot)
static void SlotStrongObject (morkObject *me, morkEnv *ev, morkObject **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

NS_DECL_ISUPPORTS_INHERITED
morkEnv
mPort_Env
morkFactorymPort_Factory
nsIMdbHeapmPort_Heap
morkAtomSpacemStore_OidAtomSpace
morkAtomSpacemStore_GroundAtomSpace
morkAtomSpacemStore_GroundColumnSpace
nsIMdbFilemStore_File
morkStreammStore_InStream
morkBuildermStore_Builder
morkStreammStore_OutStream
morkRowSpaceMap mStore_RowSpaces
morkAtomSpaceMap mStore_AtomSpaces
morkZone mStore_Zone
morkPool mStore_Pool
morkFarBookAtom mStore_FarBookAtom
mork_gid mStore_CommitGroupIdentity
mork_pos mStore_FirstCommitGroupPos
mork_pos mStore_SecondCommitGroupPos
mork_bool mStore_CanAutoAssignAtomIdentity
mork_bool mStore_CanDirty
mork_u1 mStore_CanWriteIncremental
mork_u1 mStore_Pad
morkHandlemObject_Handle
morkEnvmMorkEnv
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

Private Member Functions

 morkStore (const morkStore &other)
morkStoreoperator= (const morkStore &other)

Friends

class morkHandleFrame

Detailed Description

Definition at line 100 of file morkStore.h.


Constructor & Destructor Documentation

morkStore::~morkStore ( ) [virtual]
morkStore::morkStore ( morkEnv ev,
const morkUsage inUsage,
nsIMdbHeap ioNodeHeap,
morkFactory inFactory,
nsIMdbHeap ioPortHeap 
)

Definition at line 185 of file morkStore.cpp.

: morkObject(ev, inUsage, ioNodeHeap, morkColor_kNone, (morkHandle*) 0)
, mPort_Env( ev )
, mPort_Factory( 0 )
, mPort_Heap( 0 )
, mStore_OidAtomSpace( 0 )
, mStore_GroundAtomSpace( 0 )
, mStore_GroundColumnSpace( 0 )

, mStore_File( 0 )
, mStore_InStream( 0 )
, mStore_Builder( 0 )
, mStore_OutStream( 0 )

, mStore_RowSpaces(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
, mStore_AtomSpaces(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
, mStore_Zone(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)
, mStore_Pool(ev, morkUsage::kMember, (nsIMdbHeap*) 0, ioPortHeap)

, mStore_CommitGroupIdentity( 0 )

, mStore_FirstCommitGroupPos( 0 )
, mStore_SecondCommitGroupPos( 0 )

// disable auto-assignment of atom IDs until someone knows it is okay:
, mStore_CanAutoAssignAtomIdentity( morkBool_kFalse )
, mStore_CanDirty( morkBool_kFalse ) // not until the store is open
, mStore_CanWriteIncremental( morkBool_kTrue ) // always with few exceptions
{
  MOZ_COUNT_CTOR(morkStore);
  if ( ev->Good() )
  {
    if ( inFactory && ioPortHeap )
    {
      morkFactory::SlotWeakFactory(inFactory, ev, &mPort_Factory);
      nsIMdbHeap_SlotStrongHeap(ioPortHeap, ev, &mPort_Heap);
      if ( ev->Good() )
        mNode_Derived = morkDerived_kPort;
    }
    else
      ev->NilPointerError();
  }
  if ( ev->Good() )
  {
    mNode_Derived = morkDerived_kStore;
    
  }
}

Here is the call graph for this function:

morkStore::morkStore ( const morkStore other) [private]

Member Function Documentation

Definition at line 386 of file morkStore.cpp.

{
  return this;
}

Here is the caller graph for this function:

morkAtom * morkStore::AddAlias ( morkEnv ev,
const morkMid inMid,
mork_cscode  inForm 
)

Definition at line 940 of file morkStore.cpp.

{
  morkBookAtom* outAtom = 0;
  if ( ev->Good() )
  {
    const mdbOid* oid = &inMid.mMid_Oid;
    morkAtomSpace* atomSpace = this->LazyGetAtomSpace(ev, oid->mOid_Scope);
    if ( atomSpace )
    {
      morkFarBookAtom* keyAtom =
        this->StageAliasAsFarBookAtom(ev, &inMid, atomSpace, inForm);
      if ( keyAtom )
      {
         morkAtomAidMap* map = &atomSpace->mAtomSpace_AtomAids;
        outAtom = map->GetAid(ev, (mork_aid) oid->mOid_Id);
        if ( outAtom )
        {
          if ( !outAtom->EqualFormAndBody(ev, keyAtom) )
              ev->NewError("duplicate alias ID");
        }
        else
        {
          this->MaybeDirtyStore();
          keyAtom->mBookAtom_Id = oid->mOid_Id;
          outAtom = atomSpace->MakeBookAtomCopyWithAid(ev,
            *keyAtom, (mork_aid) oid->mOid_Id);
            
          // if ( outAtom && outAtom->IsWeeBook() )
          // {
          //   if ( oid->mOid_Scope == morkStore_kColumnSpaceScope )
          //   {
          //    mork_size size = outAtom->mAtom_Size;
          //     if ( size >= 7 && size <= 11 )
          //       this->SyncTokenIdChange(ev, outAtom, oid);
          //   }
          // }
        }
      }
    }
  }
  return outAtom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from morkObject.

Definition at line 1348 of file morkStore.cpp.

{
  return AddRef();
}

Here is the call graph for this function:

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:

Reimplemented from morkObject.

Definition at line 1342 of file morkStore.cpp.

{
  morkEnv *ev  = morkEnv::FromMdbEnv(mev);
  return morkNode::AddWeakRef(ev);
}

Here is the call 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:

Implements nsIMdbStore.

Definition at line 2185 of file morkStore.cpp.

{
  MORK_USED_1(inColumnSet);
  mdb_err outErr = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing for a hint method
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call 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:

NS_IMETHODIMP morkStore::BestExportFormat ( nsIMdbEnv ev,
mdbYarn outFormatVersion 
) [virtual]

Implements nsIMdbPort.

Definition at line 1593 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  if ( outFormatVersion )
    outFormatVersion->mYarn_Fill = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    ev->StubMethodOnlyError();
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

Definition at line 1014 of file morkStore.cpp.

{
  mork_token outToken = 0;
  if ( ev->Good() )
  {
    const mork_u1* s = (const mork_u1*) inBuf->mBuf_Body;
    mork_bool nonAscii = ( *s > 0x7F );
    mork_size length = inBuf->mBuf_Fill;
    if ( nonAscii || length > 1 ) // more than one byte?
    {
      mork_cscode form = 0; // default charset
      morkAtomSpace* space = this->LazyGetGroundColumnSpace(ev);
      if ( space )
      {
        morkFarBookAtom* keyAtom = 0;
        if ( length <= morkBookAtom_kMaxBodySize )
        {
          mork_aid aid = 1; // dummy
          //mStore_BookAtom.InitMaxBookAtom(ev, *inBuf, form, space, aid);
          mStore_FarBookAtom.InitFarBookAtom(ev, *inBuf, form, space, aid);
          keyAtom = &mStore_FarBookAtom;
        }
        if ( keyAtom )
        {
          morkAtomBodyMap* map = &space->mAtomSpace_AtomBodies;
          morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
          if ( bookAtom )
            outToken = bookAtom->mBookAtom_Id;
          else
          {
            this->MaybeDirtyStore();
            bookAtom = space->MakeBookAtomCopy(ev, *keyAtom);
            if ( bookAtom )
            {
              outToken = bookAtom->mBookAtom_Id;
              bookAtom->MakeCellUseForever(ev);
            }
          }
        }
      }
    }
    else // only a single byte in inTokenName string:
      outToken = *s;
  }
  
  return outToken;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::CanExportToFormat ( nsIMdbEnv ev,
const char *  inFormatVersion,
mdb_bool outCanExport 
) [virtual]

Implements nsIMdbPort.

Definition at line 1610 of file morkStore.cpp.

{
  MORK_USED_1(inFormatVersion);
  mdb_bool canExport = morkBool_kFalse;
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    ev->StubMethodOnlyError();
    outErr = ev->AsErr();
  }
  if ( outCanExport )
    *outCanExport = canExport;
  return outErr;
}

Here is the call graph for this function:

Definition at line 650 of file morkStore.cpp.

{
  ev->NewError("false mStore_CanAutoAssignAtomIdentity");
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkEnv * morkStore::CanUseStore ( nsIMdbEnv mev,
mork_bool  inMutable,
mdb_err outErr 
) const

Definition at line 1404 of file morkStore.cpp.

{
  morkEnv* outEnv = 0;
  morkEnv* ev = morkEnv::FromMdbEnv(mev);
  if ( ev )
  {
    if (IsStore())
      outEnv = ev;
    else
      NonStoreTypeError(ev);
    *outErr = ev->AsErr();
  }
  MORK_ASSERT(outEnv);
  return outEnv;
}

Here is the call graph for this function:

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:

Reimplemented from morkObject.

Definition at line 1366 of file morkStore.cpp.

{
  morkEnv *ev = morkEnv::FromMdbEnv(mev);
  CloseMorkNode(ev);
  Release();
  return NS_OK;
}

Here is the call 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:

void morkStore::CloseMorkNode ( morkEnv ev) [virtual]

Reimplemented from morkObject.

Definition at line 136 of file morkStore.cpp.

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

Here is the call graph for this function:

Here is the caller 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:

void morkObject::CloseObject ( morkEnv ev) [inherited]

Definition at line 119 of file morkObject.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      if ( !this->IsShutNode() )
      {
        if ( mObject_Handle )
          morkHandle::SlotWeakHandle((morkHandle*) 0L, ev, &mObject_Handle);
          
        mBead_Color = 0; // this->CloseBead(ev);
        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 147 of file morkStore.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      morkFactory::SlotWeakFactory((morkFactory*) 0, ev, &mPort_Factory);
      nsIMdbHeap_SlotStrongHeap((nsIMdbHeap*) 0, ev, &mPort_Heap);
      this->CloseObject(ev);
      this->MarkShut();
    }
    else
      this->NonNodeError(ev);
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::CompressCommit ( nsIMdbEnv ev,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbStore.

Definition at line 2295 of file morkStore.cpp.

{
  nsresult outErr = NS_OK;
  nsIMdbThumb* outThumb = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    mork_bool doCollect = morkBool_kFalse;
    morkThumb* thumb = morkThumb::Make_CompressCommit(ev, mPort_Heap, this, doCollect);
    if ( thumb )
    {
      outThumb = thumb;
      thumb->AddRef();
      mStore_CanWriteIncremental = morkBool_kTrue;
    }
      
    outErr = ev->AsErr();
  }
  if ( acqThumb )
    *acqThumb = outThumb;
  return outErr;
}

Here is the call graph for this function:

morkAtom * morkStore::CopyAtom ( morkEnv ev,
const morkAtom inAtom 
)

Definition at line 694 of file morkStore.cpp.

{
  morkAtom* outAtom = 0;
  if ( inAtom )
  {
    mdbYarn yarn;
    if ( inAtom->AliasYarn(&yarn) )
      outAtom = this->YarnToAtom(ev, &yarn, PR_TRUE /* create */);
  }
  return outAtom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_token morkStore::CopyToken ( morkEnv ev,
mdb_token  inToken,
morkStore inStore 
)

Definition at line 986 of file morkStore.cpp.

{
  mork_token outToken = 0;
  if ( inStore == this ) // same store?
    outToken = inToken; // just return token unchanged
  else
  {
    char yarnBuf[ morkStore_kMaxCopyTokenSize ];
    mdbYarn yarn;
    yarn.mYarn_Buf = yarnBuf;
    yarn.mYarn_Fill = 0;
    yarn.mYarn_Size = morkStore_kMaxCopyTokenSize;
    yarn.mYarn_More = 0;
    yarn.mYarn_Form = 0;
    yarn.mYarn_Grow = 0;
    
    inStore->TokenToString(ev, inToken, &yarn);
    if ( ev->Good() )
    {
      morkBuf buf(yarn.mYarn_Buf, yarn.mYarn_Fill);
      outToken = this->BufToToken(ev, &buf);
    }
  }
  return outToken;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::CreateStoreFile ( morkEnv ev,
nsIMdbFile ioFile,
const mdbOpenPolicy inOpenPolicy 
)

Definition at line 682 of file morkStore.cpp.

{
  MORK_USED_1(inOpenPolicy);
  nsIMdbFile_SlotStrongFile(ioFile, ev, &mStore_File);
  
  return ev->Good();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from morkObject.

Definition at line 1360 of file morkStore.cpp.

{
  return Release();
}
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:

Reimplemented from morkObject.

Definition at line 1354 of file morkStore.cpp.

{
  morkEnv *ev  = morkEnv::FromMdbEnv(mev);
  return morkNode::CutWeakRef(ev);
}

Here is the call 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 287 of file morkStore.cpp.

{
  nsIMdbFile* file = mStore_File;
  if ( file && mStore_CanWriteIncremental )
  {
    mdb_pos fileEof = 0;
    file->Eof(ev->AsMdbEnv(), &fileEof);
    if ( ev->Good() && fileEof > 128 )
      return morkBool_kTrue;
  }
  return morkBool_kFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::ExportToFormat ( nsIMdbEnv ev,
nsIMdbFile ioFile,
const char *  inFormatVersion,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbPort.

Definition at line 1630 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbThumb* outThumb = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    if ( ioFile && inFormatVersion && acqThumb )
    {
      ev->StubMethodOnlyError();
    }
    else
      ev->NilPointerError();
    
    outErr = ev->AsErr();
  }
  if ( acqThumb )
    *acqThumb = outThumb;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::FindRow ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_column  inColumn,
const mdbYarn inTargetCellValue,
mdbOid outRowOid,
nsIMdbRow **  acqRow 
) [virtual]

Implements nsIMdbPort.

Definition at line 1794 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbRow* outRow = 0;
  mdbOid rowOid;
  rowOid.mOid_Scope = 0;
  rowOid.mOid_Id = (mdb_id) -1;
  
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = FindRow(ev, inRowScope, inColumn, inTargetCellValue);
    if ( row && ev->Good() )
    {
      rowOid = row->mRow_Oid;
      if ( acqRow )
          outRow = row->AcquireRowHandle(ev, this);
    }
    outErr = ev->AsErr();
  }
  if ( acqRow )
    *acqRow = outRow;
  if ( outRowOid )
    *outRowOid = rowOid;

  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkStore::FindRow ( morkEnv ev,
mdb_scope  inScope,
mdb_column  inColumn,
const mdbYarn inTargetCellValue 
)

Definition at line 1179 of file morkStore.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inScope);
    if ( rowSpace )
    {
      outRow = rowSpace->FindRow(ev, inColumn, inYarn);
    }
  }
  return outRow;
}

Here is the call graph for this function:

Definition at line 557 of file morkStore.cpp.

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetIsPortReadonly ( nsIMdbEnv ev,
mdb_bool outBool 
) [virtual]

Implements nsIMdbPort.

Definition at line 1388 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_bool isReadOnly = morkBool_kFalse;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    ev->StubMethodOnlyError();
    outErr = ev->AsErr();
  }
  if ( outBool )
    *outBool = isReadOnly;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetIsStore ( nsIMdbEnv ev,
mdb_bool outBool 
) [virtual]

Implements nsIMdbPort.

Definition at line 1422 of file morkStore.cpp.

{
  MORK_USED_1(mev);
 if ( outBool )
    *outBool = morkBool_kTrue;
  return 0;
}
NS_IMETHODIMP morkStore::GetIsStoreAndDirty ( nsIMdbEnv ev,
mdb_bool outBool 
) [virtual]

Implements nsIMdbPort.

Definition at line 1431 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_bool isStoreAndDirty = morkBool_kFalse;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    ev->StubMethodOnlyError();
    outErr = ev->AsErr();
  }
  if ( outBool )
    *outBool = isStoreAndDirty;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkObject::GetMdbFactory ( nsIMdbEnv ev,
nsIMdbFactory **  acqFactory 
) [virtual, inherited]

Implements nsIMdbObject.

Definition at line 146 of file morkObject.cpp.

{
  nsresult rv;
  nsCOMPtr <nsIMdbObject> obj = do_QueryInterface(mev);
  if (obj)
    rv = obj->GetMdbFactory(mev, acqFactory);
  else
    return NS_ERROR_NO_INTERFACE;

  return rv;
} 

Here is the call 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;
}
NS_IMETHODIMP morkStore::GetPortFile ( nsIMdbEnv ev,
nsIMdbFile **  acqFile 
) [virtual]

Implements nsIMdbPort.

Definition at line 1561 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  if ( acqFile )
    *acqFile = 0;

  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    
    if ( mStore_File )
    {
      if ( acqFile )
      {
        mStore_File->AddRef();
        if ( ev->Good() )
          *acqFile = mStore_File;
      }
    }
    else
      NilStoreFileError(ev);
      
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetPortFilePath ( nsIMdbEnv ev,
mdbYarn outFilePath,
mdbYarn outFormatVersion 
) [virtual]

Implements nsIMdbPort.

Definition at line 1537 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  if ( outFormatVersion )
    outFormatVersion->mYarn_Fill = 0;
  if ( outFilePath )
    outFilePath->mYarn_Fill = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    if ( mStore_File )
      mStore_File->Path(mev, outFilePath);
    else
      NilStoreFileError(ev);
    
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetPortTableCursor ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
nsIMdbPortTableCursor **  acqCursor 
) [virtual]

Implements nsIMdbPort.

Definition at line 1949 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbPortTableCursor* outCursor = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkPortTableCursor* cursor =
      GetPortTableCursor(ev, inRowScope,
        inTableKind);
    if ( cursor && ev->Good() )
      outCursor = cursor;

    outErr = ev->AsErr();
  }
  if ( acqCursor )
    *acqCursor = outCursor;
  return outErr;
}

Here is the call graph for this function:

morkPortTableCursor * morkStore::GetPortTableCursor ( morkEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind 
)

Definition at line 1241 of file morkStore.cpp.

{
  morkPortTableCursor* outCursor = 0;
  if ( ev->Good() )
  {
    nsIMdbHeap* heap = mPort_Heap;
    outCursor = new(*heap, ev) 
      morkPortTableCursor(ev, morkUsage::kHeap, heap, this,
        inRowScope, inTableKind, heap);
  }
  NS_IF_ADDREF(outCursor);
  return outCursor;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetRow ( nsIMdbEnv ev,
const mdbOid inOid,
nsIMdbRow **  acqRow 
) [virtual]

Implements nsIMdbPort.

Definition at line 1750 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbRow* outRow = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = GetRow(ev, inOid);
    if ( row && ev->Good() )
      outRow = row->AcquireRowHandle(ev, this);
      
    outErr = ev->AsErr();
  }
  if ( acqRow )
    *acqRow = outRow;
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkStore::GetRow ( morkEnv ev,
const mdbOid inOid 
)

Definition at line 1195 of file morkStore.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
    if ( rowSpace )
    {
      outRow = rowSpace->mRowSpace_Rows.GetOid(ev, inOid);
    }
  }
  return outRow;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetRowRefCount ( nsIMdbEnv ev,
const mdbOid inOid,
mdb_count outRefCount 
) [virtual]

Implements nsIMdbPort.

Definition at line 1772 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_count count = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = GetRow(ev, inOid);
    if ( row && ev->Good() )
      count = row->mRow_GcUses;
      
    outErr = ev->AsErr();
  }
  if ( outRefCount )
    *outRefCount = count;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetStrongRefCount ( nsIMdbEnv ev,
mdb_count outCount 
) [virtual]

Reimplemented from morkObject.

Definition at line 1334 of file morkStore.cpp.

{
  *outCount = StrongRefsOnly();
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetTable ( nsIMdbEnv ev,
const mdbOid inOid,
nsIMdbTable **  acqTable 
) [virtual]

Implements nsIMdbPort.

Definition at line 1884 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbTable* outTable = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkTable* table = GetTable(ev, inOid);
    if ( table && ev->Good() )
      outTable = table->AcquireTableHandle(ev);
    outErr = ev->AsErr();
  }
  if ( acqTable )
    *acqTable = outTable;
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkTable * morkStore::GetTable ( morkEnv ev,
const mdbOid inOid 
)

Definition at line 1210 of file morkStore.cpp.

{
  morkTable* outTable = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
    if ( rowSpace )
    {
      outTable = rowSpace->FindTableByTid(ev, inOid->mOid_Id);
    }
  }
  return outTable;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetTableKind ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_count outTableCount,
mdb_bool outMustBeUnique,
nsIMdbTable **  acqTable 
) [virtual]

Implements nsIMdbPort.

Definition at line 1924 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbTable* outTable = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkTable* table = GetTableKind(ev, inRowScope,
        inTableKind, outTableCount, outMustBeUnique);
    if ( table && ev->Good() )
      outTable = table->AcquireTableHandle(ev);
    outErr = ev->AsErr();
  }
  if ( acqTable )
    *acqTable = outTable;
  return outErr;
}

Here is the call graph for this function:

morkTable * morkStore::GetTableKind ( morkEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_count outTableCount,
mdb_bool outMustBeUnique 
)

Definition at line 1155 of file morkStore.cpp.

{
  morkTable* outTable = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
    if ( rowSpace )
    {
      outTable = rowSpace->FindTableByKind(ev, inTableKind);
      if ( outTable )
      {
        if ( outTableCount )
          *outTableCount = outTable->GetRowCount();
        if ( outMustBeUnique )
          *outMustBeUnique = outTable->IsTableUnique();
      }
    }
  }
  return outTable;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetUsagePolicy ( nsIMdbEnv ev,
mdbUsagePolicy ioUsagePolicy 
) [virtual]

Implements nsIMdbPort.

Definition at line 1447 of file morkStore.cpp.

{
  MORK_USED_1(ioUsagePolicy);
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    ev->StubMethodOnlyError();
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::GetWeakRefCount ( nsIMdbEnv ev,
mdb_count outCount 
) [virtual]

Reimplemented from morkObject.

Definition at line 1327 of file morkStore.cpp.

{
  *outCount = WeakRefsOnly();
  return NS_OK;
}  

Here is the call 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:

NS_IMETHODIMP morkStore::HasRow ( nsIMdbEnv ev,
const mdbOid inOid,
mdb_bool outHasRow 
) [virtual]

Implements nsIMdbPort.

Definition at line 1728 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_bool hasRow = morkBool_kFalse;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = GetRow(ev, inOid);
    if ( row )
      hasRow = morkBool_kTrue;
      
    outErr = ev->AsErr();
  }
  if ( outHasRow )
    *outHasRow = hasRow;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::HasTable ( nsIMdbEnv ev,
const mdbOid inOid,
mdb_bool outHasTable 
) [virtual]

Implements nsIMdbPort.

Definition at line 1862 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mork_bool hasTable = morkBool_kFalse;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkTable* table = GetTable(ev, inOid);
    if ( table )
      hasTable = morkBool_kTrue;
    
    outErr = ev->AsErr();
  }
  if ( outHasTable )
    *outHasTable = hasTable;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::HasTableKind ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_count outTableCount,
mdb_bool outSupportsTable 
) [virtual]

Implements nsIMdbPort.

Definition at line 1905 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    *outSupportsTable = HasTableKind(ev, inRowScope,
        inTableKind, outTableCount);
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

mork_bool morkStore::HasTableKind ( morkEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_count outTableCount 
)

Definition at line 1140 of file morkStore.cpp.

{
  MORK_USED_2(inRowScope,inTableKind);
  mork_bool outBool = morkBool_kFalse;
  mdb_count tableCount = 0;

  ev->StubMethodOnlyError();
  
  if ( outTableCount )
    *outTableCount = tableCount;
  return outBool;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::IdleMemoryPurge ( nsIMdbEnv ev,
mdb_size outEstimatedBytesFreed 
) [virtual]

Implements nsIMdbPort.

Definition at line 1479 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_size estimatedBytesFreed = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing?
    outErr = ev->AsErr();
  }
  if ( outEstimatedBytesFreed )
    *outEstimatedBytesFreed = estimatedBytesFreed;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::ImportContent ( nsIMdbEnv ev,
mdb_scope  inRowScope,
nsIMdbPort ioPort,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbStore.

Definition at line 2141 of file morkStore.cpp.

{
  NS_ASSERTION(PR_FALSE, " not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP morkStore::ImportFile ( nsIMdbEnv ev,
nsIMdbFile ioFile,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbStore.

Definition at line 2154 of file morkStore.cpp.

{
  NS_ASSERTION(PR_FALSE, " not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}
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:

NS_IMETHODIMP morkObject::IsFrozenMdbObject ( nsIMdbEnv ev,
mdb_bool outIsReadonly 
) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkCursor.

Definition at line 211 of file morkObject.cpp.

{
  *outIsReadonly = IsFrozen();
  return NS_OK;
}

Here is the call 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 morkObject::IsObject ( ) const [inline, inherited]

Definition at line 149 of file morkObject.h.

Here is the call graph for this function:

NS_IMETHODIMP morkStore::IsOpenMdbObject ( nsIMdbEnv ev,
mdb_bool outOpen 
) [virtual]

Reimplemented from morkObject.

Definition at line 1375 of file morkStore.cpp.

{
  *outOpen = IsOpenNode();
  return NS_OK;
}

Here is the call 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 morkStore::IsPort ( ) const [inline]

Definition at line 116 of file morkStore.h.

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

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 morkStore::IsStore ( ) const [inline]

Definition at line 665 of file morkStore.h.

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::IsStoreClean ( ) const [inline]

Definition at line 599 of file morkStore.h.

{ return this->IsNodeClean(); }

Here is the call graph for this function:

mork_bool morkStore::IsStoreDirty ( ) const [inline]

Definition at line 600 of file morkStore.h.

{ return this->IsNodeDirty(); }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::LargeCommit ( nsIMdbEnv ev,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbStore.

Definition at line 2217 of file morkStore.cpp.

{
  nsresult outErr = 0;
  nsIMdbThumb* outThumb = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    
    morkThumb* thumb = 0;
    // morkFile* file = store->mStore_File;
    if ( DoPreferLargeOverCompressCommit(ev) )
    {
      thumb = morkThumb::Make_LargeCommit(ev, mPort_Heap, this);
    }
    else
    {
      mork_bool doCollect = morkBool_kFalse;
      thumb = morkThumb::Make_CompressCommit(ev, mPort_Heap, this, doCollect);
    }
    
    if ( thumb )
    {
      outThumb = thumb;
      thumb->AddRef();
    }
      
    outErr = ev->AsErr();
  }
  if ( acqThumb )
    *acqThumb = outThumb;
  return outErr;
}

Here is the call graph for this function:

Definition at line 608 of file morkStore.cpp.

{
  morkAtomSpace* outSpace = mStore_AtomSpaces.GetAtomSpace(ev, inAtomScope);
  if ( !outSpace && ev->Good() ) // try to make new space?
  {
    if ( inAtomScope == morkStore_kValueSpaceScope )
      outSpace = this->LazyGetGroundAtomSpace(ev);
      
    else if ( inAtomScope == morkStore_kGroundColumnSpace )
      outSpace = this->LazyGetGroundColumnSpace(ev);
    else
    {
      nsIMdbHeap* heap = mPort_Heap;
      outSpace = new(*heap, ev) 
        morkAtomSpace(ev, morkUsage::kHeap, inAtomScope, this, heap, heap);
        
      if ( outSpace ) // successful space creation?
      {
        this->MaybeDirtyStore();
    
        // note adding to node map creates it's own strong ref...
        if ( mStore_AtomSpaces.AddAtomSpace(ev, outSpace) )
          outSpace->CutStrongRef(ev); // ...so we can drop our strong ref
      }
    }
  }
  return outSpace;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 565 of file morkStore.cpp.

{
  if ( !mStore_Builder )
  {
    morkStream* stream = this->LazyGetInStream(ev);
    if ( stream )
    {
      nsIMdbHeap* heap = mPort_Heap;
      morkBuilder* builder = new(*heap, ev) 
        morkBuilder(ev, morkUsage::kHeap, heap, stream,
          morkBuilder_kDefaultBytesPerParseSegment, heap, this);
      if ( builder )
      {
        mStore_Builder = builder; // transfer strong ref to this slot
      }
    }
  }
  return mStore_Builder;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 472 of file morkStore.cpp.

{
  if ( !mStore_GroundAtomSpace )
  {
    mork_scope atomScope = morkStore_kValueSpaceScope;
    nsIMdbHeap* heap = mPort_Heap;
    morkAtomSpace* space = new(*heap, ev) 
      morkAtomSpace(ev, morkUsage::kHeap, atomScope, this, heap, heap);
      
    if ( space ) // successful space creation?
    {
      this->MaybeDirtyStore();
    
      mStore_GroundAtomSpace = space; // transfer strong ref to this slot
      mStore_AtomSpaces.AddAtomSpace(ev, space);
    }
  }
  return mStore_GroundAtomSpace;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 492 of file morkStore.cpp.

{
  if ( !mStore_GroundColumnSpace )
  {
    mork_scope atomScope = morkStore_kGroundColumnSpace;
    nsIMdbHeap* heap = mPort_Heap;
    morkAtomSpace* space = new(*heap, ev) 
      morkAtomSpace(ev, morkUsage::kHeap, atomScope, this, heap, heap);
      
    if ( space ) // successful space creation?
    {
      this->MaybeDirtyStore();
    
      mStore_GroundColumnSpace = space; // transfer strong ref to this slot
      mStore_AtomSpaces.AddAtomSpace(ev, space);
    }
  }
  return mStore_GroundColumnSpace;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 512 of file morkStore.cpp.

{
  if ( !mStore_InStream )
  {
    nsIMdbFile* file = mStore_File;
    if ( file )
    {
      morkStream* stream = new(*mPort_Heap, ev) 
        morkStream(ev, morkUsage::kHeap, mPort_Heap, file,
          morkStore_kStreamBufSize, /*frozen*/ morkBool_kTrue);
      if ( stream )
      {
        this->MaybeDirtyStore();
        mStore_InStream = stream; // transfer strong ref to this slot
      }
    }
    else
      this->NilStoreFileError(ev);
  }
  return mStore_InStream;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 463 of file morkStore.cpp.

Definition at line 534 of file morkStore.cpp.

{
  if ( !mStore_OutStream )
  {
    nsIMdbFile* file = mStore_File;
    if ( file )
    {
      morkStream* stream = new(*mPort_Heap, ev) 
        morkStream(ev, morkUsage::kHeap, mPort_Heap, file,
          morkStore_kStreamBufSize, /*frozen*/ morkBool_kFalse);
      if ( stream )
      {
        this->MaybeDirtyStore();
        mStore_InStream = stream; // transfer strong ref to this slot
      }
    }
    else
      this->NilStoreFileError(ev);
  }
  return mStore_OutStream;
}

Here is the call graph for this function:

Definition at line 586 of file morkStore.cpp.

{
  morkRowSpace* outSpace = mStore_RowSpaces.GetRowSpace(ev, inRowScope);
  if ( !outSpace && ev->Good() ) // try to make new space?
  {
    nsIMdbHeap* heap = mPort_Heap;
    outSpace = new(*heap, ev) 
      morkRowSpace(ev, morkUsage::kHeap, inRowScope, this, heap, heap);
      
    if ( outSpace ) // successful space creation?
    {
      this->MaybeDirtyStore();
    
      // note adding to node map creates it's own strong ref...
      if ( mStore_RowSpaces.AddRowSpace(ev, outSpace) )
        outSpace->CutStrongRef(ev); // ...so we can drop our strong ref
    }
  }
  return outSpace;
}

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:

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 604 of file morkStore.h.

  { if ( mStore_CanDirty ) this->SetStoreDirty(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 826 of file morkStore.cpp.

{
  morkBookAtom* outAtom = 0;
  mdbOid oid;
  if ( this->MidToOid(ev, inMid, &oid) )
  {
    morkAtomSpace* atomSpace = mStore_AtomSpaces.GetAtomSpace(ev, oid.mOid_Scope);
    if ( atomSpace )
    {
      morkAtomAidMap* map = &atomSpace->mAtomSpace_AtomAids;
      outAtom = map->GetAid(ev, (mork_aid) oid.mOid_Id);
    }
  }
  return outAtom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::MidToOid ( morkEnv ev,
const morkMid inMid,
mdbOid outOid 
)

Definition at line 741 of file morkStore.cpp.

{
  *outOid = inMid.mMid_Oid;
  const morkBuf* buf = inMid.mMid_Buf;
  if ( buf && !outOid->mOid_Scope )
  {
    if ( buf->mBuf_Fill <= morkBookAtom_kMaxBodySize )
    {
      if ( buf->mBuf_Fill == 1 )
      {
        mork_u1* name = (mork_u1*) buf->mBuf_Body;
        if ( name )
        {
          outOid->mOid_Scope = (mork_scope) *name;
          return ev->Good();
        }
      }
      morkAtomSpace* groundSpace = this->LazyGetGroundColumnSpace(ev);
      if ( groundSpace )
      {
        mork_cscode form = 0; // default
        mork_aid aid = 1; // dummy
        mStore_FarBookAtom.InitFarBookAtom(ev, *buf, form, groundSpace, aid);
        morkFarBookAtom* keyAtom = &mStore_FarBookAtom;
        morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
        morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
        if ( bookAtom )
          outOid->mOid_Scope = bookAtom->mBookAtom_Id;
        else
        {
          this->MaybeDirtyStore();
          bookAtom = groundSpace->MakeBookAtomCopy(ev, *keyAtom);
          if ( bookAtom )
          {
            outOid->mOid_Scope = bookAtom->mBookAtom_Id;
            bookAtom->MakeCellUseForever(ev);
          }
        }
      }
    }
  }
  return ev->Good();
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkStore::MidToRow ( morkEnv ev,
const morkMid inMid 
)

Definition at line 786 of file morkStore.cpp.

{
  mdbOid tempOid;
  this->MidToOid(ev, inMid, &tempOid);
  return this->OidToRow(ev, &tempOid);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 794 of file morkStore.cpp.

{
  mdbOid tempOid;
  this->MidToOid(ev, inMid, &tempOid);
  return this->OidToTable(ev, &tempOid, /*metarow*/ (mdbOid*) 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::MidToYarn ( morkEnv ev,
const morkMid inMid,
mdbYarn outYarn 
)

Definition at line 802 of file morkStore.cpp.

{
  mdbOid tempOid;
  this->MidToOid(ev, inMid, &tempOid);
  return this->OidToYarn(ev, tempOid, outYarn);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::NewRow ( nsIMdbEnv ev,
mdb_scope  inRowScope,
nsIMdbRow **  acqRow 
) [virtual]

Implements nsIMdbStore.

Definition at line 2116 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbRow* outRow = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = NewRow(ev, inRowScope);
    if ( row && ev->Good() )
      outRow = row->AcquireRowHandle(ev, this);
      
    outErr = ev->AsErr();
  }
  if ( acqRow )
    *acqRow = outRow;
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkStore::NewRow ( morkEnv ev,
mdb_scope  inRowScope 
)

Definition at line 1257 of file morkStore.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
    if ( rowSpace )
      outRow = rowSpace->NewRow(ev);
  }
  return outRow;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::NewRowWithOid ( nsIMdbEnv ev,
const mdbOid inOid,
nsIMdbRow **  acqRow 
) [virtual]

Implements nsIMdbStore.

Definition at line 2095 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbRow* outRow = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkRow* row = NewRowWithOid(ev, inOid);
    if ( row && ev->Good() )
      outRow = row->AcquireRowHandle(ev, this);
      
    outErr = ev->AsErr();
  }
  if ( acqRow )
    *acqRow = outRow;
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1270 of file morkStore.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
    if ( rowSpace )
      outRow = rowSpace->NewRowWithOid(ev, inOid);
  }
  return outRow;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::NewTable ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_bool  inMustBeUnique,
const mdbOid inOptionalMetaRowOid,
nsIMdbTable **  acqTable 
) [virtual]

Implements nsIMdbStore.

Definition at line 2006 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbTable* outTable = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkTable* table = NewTable(ev, inRowScope,
        inTableKind, inMustBeUnique, inOptionalMetaRowOid);
    if ( table && ev->Good() )
      outTable = table->AcquireTableHandle(ev);
    outErr = ev->AsErr();
  }
  if ( acqTable )
    *acqTable = outTable;
  return outErr;
}

Here is the call graph for this function:

morkTable * morkStore::NewTable ( morkEnv ev,
mdb_scope  inRowScope,
mdb_kind  inTableKind,
mdb_bool  inMustBeUnique,
const mdbOid inOptionalMetaRowOid 
)

Definition at line 1225 of file morkStore.cpp.

{
  morkTable* outTable = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inRowScope);
    if ( rowSpace )
      outTable = rowSpace->NewTable(ev, inTableKind, inMustBeUnique,
        inOptionalMetaRowOid);
  }
  return outTable;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::NewTableWithOid ( nsIMdbEnv ev,
const mdbOid inOid,
mdb_kind  inTableKind,
mdb_bool  inMustBeUnique,
const mdbOid inOptionalMetaRowOid,
nsIMdbTable **  acqTable 
) [virtual]

Implements nsIMdbStore.

Definition at line 2031 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  nsIMdbTable* outTable = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    morkTable* table = OidToTable(ev, inOid,
      inOptionalMetaRowOid);
    if ( table && ev->Good() )
    {
      table->mTable_Kind = inTableKind;
      if ( inMustBeUnique )
        table->SetTableUnique();
      outTable = table->AcquireTableHandle(ev);
    }
    outErr = ev->AsErr();
  }
  if ( acqTable )
    *acqTable = outTable;
  return outErr;
}

Here is the call 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:

Definition at line 644 of file morkStore.cpp.

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

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 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 638 of file morkStore.cpp.

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

Here is the call graph for this function:

Here is the caller graph for this function:

morkRow * morkStore::OidToRow ( morkEnv ev,
const mdbOid inOid 
)

Definition at line 1283 of file morkStore.cpp.

{
  morkRow* outRow = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
    if ( rowSpace )
    {
      outRow = rowSpace->mRowSpace_Rows.GetOid(ev, inOid);
      if ( !outRow && ev->Good() )
        outRow = rowSpace->NewRowWithOid(ev, inOid);
    }
  }
  return outRow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkTable * morkStore::OidToTable ( morkEnv ev,
const mdbOid inOid,
const mdbOid inOptionalMetaRowOid 
)

Definition at line 1301 of file morkStore.cpp.

{
  morkTable* outTable = 0;
  if ( ev->Good() )
  {
    morkRowSpace* rowSpace = this->LazyGetRowSpace(ev, inOid->mOid_Scope);
    if ( rowSpace )
    {
      outTable = rowSpace->mRowSpace_Tables.GetTable(ev, inOid->mOid_Id);
      if ( !outTable && ev->Good() )
      {
        mork_kind tableKind = morkStore_kNoneToken;
        outTable = rowSpace->NewTableWithTid(ev, inOid->mOid_Id, tableKind,
          inOptionalMetaRowOid);
      }
    }
  }
  return outTable;
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::OidToYarn ( morkEnv ev,
const mdbOid inOid,
mdbYarn outYarn 
)

Definition at line 810 of file morkStore.cpp.

{
  morkBookAtom* atom = 0;
      
  morkAtomSpace* atomSpace = mStore_AtomSpaces.GetAtomSpace(ev, inOid.mOid_Scope);
  if ( atomSpace )
  {
    morkAtomAidMap* map = &atomSpace->mAtomSpace_AtomAids;
    atom = map->GetAid(ev, (mork_aid) inOid.mOid_Id);
  }
  atom->GetYarn(outYarn); // note this is safe even when atom==nil

  return ev->Good();
}

Here is the call graph for this function:

Here is the caller graph for this function:

mork_bool morkStore::OpenStoreFile ( morkEnv ev,
mork_bool  inFrozen,
nsIMdbFile ioFile,
const mdbOpenPolicy inOpenPolicy 
)

Definition at line 657 of file morkStore.cpp.

{
  MORK_USED_2(inOpenPolicy,inFrozen);
  nsIMdbFile_SlotStrongFile(ioFile, ev, &mStore_File);
  
  // if ( ev->Good() )
  // {
  //   morkFile* file = morkFile::OpenOldFile(ev, mPort_Heap,
  //     inFilePath, inFrozen);
  //   if ( ioFile )
  //   {
  //     if ( ev->Good() )
  //       morkFile::SlotStrongFile(file, ev, &mStore_File);
  //     else
  //       file->CutStrongRef(ev);
  //       
  //   }
  // }
  return ev->Good();
}

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:

morkStore& morkStore::operator= ( const morkStore other) [private]
NS_IMETHODIMP morkStore::PanicMemoryPurge ( nsIMdbEnv ev,
mdb_size outEstimatedBytesFreed 
) [virtual]

Implements nsIMdbPort.

Definition at line 1517 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_size estimate = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing?
    outErr = ev->AsErr();
  }
  if ( outEstimatedBytesFreed )
    *outEstimatedBytesFreed = estimate;
  return outErr;
}

Here is the call graph for this function:

Definition at line 301 of file morkStore.cpp.

{
  mork_percent outPercent = 0;
  nsIMdbFile* file = mStore_File;
  
  if ( file )
  {
    mork_pos firstPos = mStore_FirstCommitGroupPos;
    mork_pos secondPos = mStore_SecondCommitGroupPos;
    if ( firstPos || secondPos )
    {
      if ( firstPos < 512 && secondPos > firstPos )
        firstPos = secondPos; // better approximation of first commit
        
      mork_pos fileLength = 0;
      file->Eof(ev->AsMdbEnv(), &fileLength); // end of file
      if ( ev->Good() && fileLength > firstPos )
      {
        mork_size groupContent = fileLength - firstPos;
        outPercent = ( groupContent * 100 ) / fileLength;
      }
    }
  }
  else
    this->NilStoreFileError(ev);
    
  return outPercent;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::QueryToken ( nsIMdbEnv ev,
const char *  inTokenName,
mdb_token outToken 
) [virtual]

Implements nsIMdbPort.

Definition at line 1702 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_token token = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    token = QueryToken(ev, inTokenName);
    outErr = ev->AsErr();
  }
  if ( outToken )
    *outToken = token;
  return outErr;
}

Here is the call graph for this function:

mork_token morkStore::QueryToken ( morkEnv ev,
const char *  inTokenName 
)

Definition at line 1105 of file morkStore.cpp.

{
  mork_token outToken = 0;
  if ( ev->Good() )
  {
    const mork_u1* s = (const mork_u1*) inTokenName;
    mork_bool nonAscii = ( *s > 0x7F );
    if ( nonAscii || ( *s && s[ 1 ] ) ) // more than one byte?
    {
      mork_cscode form = 0; // default charset
      morkAtomSpace* groundSpace = this->LazyGetGroundColumnSpace(ev);
      if ( groundSpace )
      {
        morkFarBookAtom* keyAtom =
          this->StageStringAsFarBookAtom(ev, inTokenName, form, groundSpace);
        if ( keyAtom )
        {
          morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
          morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
          if ( bookAtom )
          {
            outToken = bookAtom->mBookAtom_Id;
            bookAtom->MakeCellUseForever(ev);
          }
        }
      }
    }
    else // only a single byte in inTokenName string:
      outToken = *s;
  }
  
  return outToken;
}

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:

Definition at line 379 of file morkStore.cpp.

{
  MORK_USED_1(ev);
  // do nothing currently
}

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::RowScopeHasAssignedIds ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_bool outCallerAssigned,
mdb_bool outStoreAssigned 
) [virtual]

Implements nsIMdbStore.

Definition at line 2063 of file morkStore.cpp.

{
  NS_ASSERTION(PR_FALSE, " not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP morkStore::SessionCommit ( nsIMdbEnv ev,
nsIMdbThumb **  acqThumb 
) [virtual]

Implements nsIMdbStore.

Definition at line 2257 of file morkStore.cpp.

{
  nsresult outErr = NS_OK;
  nsIMdbThumb* outThumb = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    
    morkThumb* thumb = 0;
    if ( DoPreferLargeOverCompressCommit(ev) )
    {
      thumb = morkThumb::Make_LargeCommit(ev, mPort_Heap, this);
    }
    else
    {
      mork_bool doCollect = morkBool_kFalse;
      thumb = morkThumb::Make_CompressCommit(ev, mPort_Heap, this, doCollect);
    }
    
    if ( thumb )
    {
      outThumb = thumb;
      thumb->AddRef();
    }
    outErr = ev->AsErr();
  }
  if ( acqThumb )
    *acqThumb = outThumb;
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::SessionMemoryPurge ( nsIMdbEnv ev,
mdb_size  inDesiredBytesFreed,
mdb_size outEstimatedBytesFreed 
) [virtual]

Implements nsIMdbPort.

Definition at line 1497 of file morkStore.cpp.

{
  MORK_USED_1(inDesiredBytesFreed);
  mdb_err outErr = 0;
  mdb_size estimate = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing?
    outErr = ev->AsErr();
  }
  if ( outEstimatedBytesFreed )
    *outEstimatedBytesFreed = estimate;
  return outErr;
}

Here is the call graph for this function:

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

Definition at line 138 of file morkNode.h.

NS_IMETHODIMP morkStore::SetCallerAssignedIds ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_bool outCallerAssigned,
mdb_bool outStoreAssigned 
) [virtual]

Implements nsIMdbStore.

Definition at line 2073 of file morkStore.cpp.

{
  NS_ASSERTION(PR_FALSE, " not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}
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 331 of file morkStore.cpp.

{
  mStore_CanDirty = inCanDirty;
  
  mork_change* c = 0;
  mork_scope* key = 0; // ignore keys in maps

  if ( ev->Good() )
  {
    morkAtomSpaceMapIter asi(ev, &mStore_AtomSpaces);

    morkAtomSpace* atomSpace = 0; // old val node in the map
    
    for ( c = asi.FirstAtomSpace(ev, key, &atomSpace); c && ev->Good();
          c = asi.NextAtomSpace(ev, key, &atomSpace) )
    {
      if ( atomSpace )
      {
        if ( atomSpace->IsAtomSpace() )
          atomSpace->mSpace_CanDirty = inCanDirty;
        else
          atomSpace->NonAtomSpaceTypeError(ev);
      }
      else
        ev->NilPointerError();
    }
  }

  if ( ev->Good() )
  {
    morkRowSpaceMapIter rsi(ev, &mStore_RowSpaces);
    morkRowSpace* rowSpace = 0; // old val node in the map
    
    for ( c = rsi.FirstRowSpace(ev, key, &rowSpace); c && ev->Good();
          c = rsi.NextRowSpace(ev, key, &rowSpace) )
    {
      if ( rowSpace )
      {
        if ( rowSpace->IsRowSpace() )
          rowSpace->mSpace_CanDirty = inCanDirty;
        else
          rowSpace->NonRowSpaceTypeError(ev);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::SetStoreAssignedIds ( nsIMdbEnv ev,
mdb_scope  inRowScope,
mdb_bool outCallerAssigned,
mdb_bool outStoreAssigned 
) [virtual]

Implements nsIMdbStore.

Definition at line 2083 of file morkStore.cpp.

{
  NS_ASSERTION(PR_FALSE, " not implemented");
  return NS_ERROR_NOT_IMPLEMENTED;
}

Definition at line 597 of file morkStore.h.

{ this->SetNodeClean(); }

Here is the call graph for this function:

Definition at line 596 of file morkStore.h.

{ this->SetNodeDirty(); }

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::SetUsagePolicy ( nsIMdbEnv ev,
const mdbUsagePolicy inUsagePolicy 
) [virtual]

Implements nsIMdbPort.

Definition at line 1462 of file morkStore.cpp.

{
  MORK_USED_1(inUsagePolicy);
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing?
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::ShareAtomColumnsHint ( nsIMdbEnv ev,
mdb_scope  inScopeHint,
const mdbColumnSet inColumnSet 
) [virtual]

Implements nsIMdbStore.

Definition at line 2168 of file morkStore.cpp.

{
  MORK_USED_2(inColumnSet,inScopeHint);
  mdb_err outErr = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // okay to do nothing for a hint method
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

NS_IMETHODIMP morkStore::ShouldCompress ( nsIMdbEnv ev,
mdb_percent  inPercentWaste,
mdb_percent outActualWaste,
mdb_bool outShould 
) [virtual]

Implements nsIMdbPort.

Definition at line 1977 of file morkStore.cpp.

{
  mdb_percent actualWaste = 0;
  mdb_bool shouldCompress = morkBool_kFalse;
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    actualWaste = PercentOfStoreWasted(ev);
    if ( inPercentWaste > 100 )
      inPercentWaste = 100;
    shouldCompress = ( actualWaste >= inPercentWaste );
    outErr = ev->AsErr();
  }
  if ( outActualWaste )
    *outActualWaste = actualWaste;
  if ( outShould )
    *outShould = shouldCompress;
  return outErr;
}

Here is the call graph for this function:

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 morkObject::SlotStrongObject ( morkObject me,
morkEnv ev,
morkObject **  ioSlot 
) [inline, static, inherited]

Definition at line 160 of file morkObject.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 morkStore::SlotStrongPort ( morkPort *  me,
morkEnv ev,
morkPort **  ioSlot 
) [inline, static]

Definition at line 511 of file morkStore.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 morkStore::SlotStrongStore ( morkStore me,
morkEnv ev,
morkStore **  ioSlot 
) [inline, static]

Definition at line 772 of file morkStore.h.

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

Here is the caller 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 morkObject::SlotWeakObject ( morkObject me,
morkEnv ev,
morkObject **  ioSlot 
) [inline, static, inherited]

Definition at line 156 of file morkObject.h.

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

Here is the call graph for this function:

static void morkStore::SlotWeakPort ( morkPort *  me,
morkEnv ev,
morkPort **  ioSlot 
) [inline, static]

Definition at line 507 of file morkStore.h.

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

Here is the call graph for this function:

static void morkStore::SlotWeakStore ( morkStore me,
morkEnv ev,
morkStore **  ioSlot 
) [inline, static]

Definition at line 768 of file morkStore.h.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsIMdbStore.

Definition at line 2203 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  morkEnv* ev = CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    // ev->StubMethodOnlyError(); // it's okay to do nothing for small commit
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

void morkStore::SmallTokenToOneByteYarn ( morkEnv ev,
mdb_token  inToken,
mdbYarn outYarn 
) [static]

Definition at line 843 of file morkStore.cpp.

{
  MORK_USED_1(ev);
  if ( outYarn->mYarn_Buf && outYarn->mYarn_Size ) // any space in yarn at all?
  {
    mork_u1* buf = (mork_u1*) outYarn->mYarn_Buf; // for byte arithmetic
    buf[ 0 ] = (mork_u1) inToken; // write the single byte
    outYarn->mYarn_Fill = 1;
    outYarn->mYarn_More = 0;
  }
  else // just record we could not write the single byte
  {
    outYarn->mYarn_More = 1;
    outYarn->mYarn_Fill = 0;
  }
}

Here is the caller graph for this function:

Definition at line 393 of file morkStore.cpp.

{
  if ( inMid && inMid->mMid_Buf )
  {
    const morkBuf* buf = inMid->mMid_Buf;
    mork_size length = buf->mBuf_Fill;
    if ( length <= morkBookAtom_kMaxBodySize )
    {
      mork_aid dummyAid = 1;
      //mStore_BookAtom.InitMaxBookAtom(ev, *buf, 
      //  inForm, ioSpace, dummyAid);
       
      mStore_FarBookAtom.InitFarBookAtom(ev, *buf, 
        inForm, ioSpace, dummyAid);
      return &mStore_FarBookAtom;
    }
  }
  else
    ev->NilPointerError();
    
  return (morkFarBookAtom*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkFarBookAtom * morkStore::StageStringAsFarBookAtom ( morkEnv ev,
const char *  inString,
mork_cscode  inForm,
morkAtomSpace ioSpace 
)

Definition at line 442 of file morkStore.cpp.

{
  if ( inString )
  {
    mork_size length = MORK_STRLEN(inString);
    if ( length <= morkBookAtom_kMaxBodySize )
    {
      morkBuf buf(inString, length);
      mork_aid dummyAid = 1;
      //mStore_BookAtom.InitMaxBookAtom(ev, buf, inForm, ioSpace, dummyAid);
      mStore_FarBookAtom.InitFarBookAtom(ev, buf, inForm, ioSpace, dummyAid);
      return &mStore_FarBookAtom;
    }
  }
  else
    ev->NilPointerError();
    
  return (morkFarBookAtom*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 418 of file morkStore.cpp.

{
  if ( inYarn && inYarn->mYarn_Buf )
  {
    mork_size length = inYarn->mYarn_Fill;
    if ( length <= morkBookAtom_kMaxBodySize )
    {
      morkBuf buf(inYarn->mYarn_Buf, length);
      mork_aid dummyAid = 1;
      //mStore_BookAtom.InitMaxBookAtom(ev, buf, 
      //  inYarn->mYarn_Form, ioSpace, dummyAid);
      mStore_FarBookAtom.InitFarBookAtom(ev, buf, 
        inYarn->mYarn_Form, ioSpace, dummyAid);
      return &mStore_FarBookAtom;
    }
  }
  else
    ev->NilPointerError();
    
  return (morkFarBookAtom*) 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 686 of file morkStore.h.

{ return &mStore_Pool; }

Here is the caller graph for this function:

NS_IMETHODIMP morkStore::StringToToken ( nsIMdbEnv ev,
const char *  inTokenName,
mdb_token outToken 
) [virtual]

Implements nsIMdbPort.

Definition at line 1678 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  mdb_token token = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    token = StringToToken(ev, inTokenName);
    outErr = ev->AsErr();
  }
  if ( outToken )
    *outToken = token;
  return outErr;
}

Here is the call graph for this function:

mork_token morkStore::StringToToken ( morkEnv ev,
const char *  inTokenName 
)

Definition at line 1063 of file morkStore.cpp.

{
  mork_token outToken = 0;
  if ( ev->Good() )
  {
    const mork_u1* s = (const mork_u1*) inTokenName;
    mork_bool nonAscii = ( *s > 0x7F );
    if ( nonAscii || ( *s && s[ 1 ] ) ) // more than one byte?
    {
      mork_cscode form = 0; // default charset
      morkAtomSpace* groundSpace = this->LazyGetGroundColumnSpace(ev);
      if ( groundSpace )
      {
        morkFarBookAtom* keyAtom =
          this->StageStringAsFarBookAtom(ev, inTokenName, form, groundSpace);
        if ( keyAtom )
        {
          morkAtomBodyMap* map = &groundSpace->mAtomSpace_AtomBodies;
          morkBookAtom* bookAtom = map->GetAtom(ev, keyAtom);
          if ( bookAtom )
            outToken = bookAtom->mBookAtom_Id;
          else
          {
            this->MaybeDirtyStore();
            bookAtom = groundSpace->MakeBookAtomCopy(ev, *keyAtom);
            if ( bookAtom )
            {
              outToken = bookAtom->mBookAtom_Id;
              bookAtom->MakeCellUseForever(ev);
            }
          }
        }
      }
    }
    else // only a single byte in inTokenName string:
      outToken = *s;
  }
  
  return outToken;
}

Here is the call 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:

NS_IMETHODIMP morkStore::TokenToString ( nsIMdbEnv ev,
mdb_token  inToken,
mdbYarn outTokenName 
) [virtual]

Implements nsIMdbPort.

Definition at line 1662 of file morkStore.cpp.

{
  mdb_err outErr = 0;
  morkEnv* ev = this->CanUseStore(mev, /*inMutable*/ morkBool_kFalse, &outErr);
  if ( ev )
  {
    TokenToString(ev, inToken, outTokenName);
    outErr = ev->AsErr();
  }
  return outErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkStore::TokenToString ( morkEnv ev,
mdb_token  inToken,
mdbYarn outTokenName 
)

Definition at line 862 of file morkStore.cpp.

{
  if ( inToken > morkAtomSpace_kMaxSevenBitAid )
  {
    morkBookAtom* atom = 0;
    morkAtomSpace* space = mStore_GroundColumnSpace;
    if ( space )
      atom = space->mAtomSpace_AtomAids.GetAid(ev, (mork_aid) inToken);
      
    atom->GetYarn(outTokenName); // note this is safe even when atom==nil
  }
  else // token is an "immediate" single byte string representation?
    this->SmallTokenToOneByteYarn(ev, inToken, outTokenName);
}

Here is the call 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: