Back to index

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

#include <morkEnv.h>

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

List of all members.

Public Member Functions

virtual void CloseMorkNode (morkEnv *ev)
virtual ~morkEnv ()
NS_IMETHOD GetErrorCount (mdb_count *outCount, mdb_bool *outShouldAbort)
NS_IMETHOD GetWarningCount (mdb_count *outCount, mdb_bool *outShouldAbort)
NS_IMETHOD GetEnvBeVerbose (mdb_bool *outBeVerbose)
NS_IMETHOD SetEnvBeVerbose (mdb_bool inBeVerbose)
NS_IMETHOD GetDoTrace (mdb_bool *outDoTrace)
NS_IMETHOD SetDoTrace (mdb_bool inDoTrace)
NS_IMETHOD GetAutoClear (mdb_bool *outAutoClear)
NS_IMETHOD SetAutoClear (mdb_bool inAutoClear)
NS_IMETHOD GetErrorHook (nsIMdbErrorHook **acqErrorHook)
NS_IMETHOD SetErrorHook (nsIMdbErrorHook *ioErrorHook)
NS_IMETHOD GetHeap (nsIMdbHeap **acqHeap)
NS_IMETHOD SetHeap (nsIMdbHeap *ioHeap)
NS_IMETHOD ClearErrors ()
NS_IMETHOD ClearWarnings ()
NS_IMETHOD ClearErrorsAndWarnings ()
 morkEnv (const morkUsage &inUsage, nsIMdbHeap *ioHeap, morkFactory *ioFactory, nsIMdbHeap *ioSlotHeap)
 morkEnv (morkEnv *ev, const morkUsage &inUsage, nsIMdbHeap *ioHeap, nsIMdbEnv *inSelfAsMdbEnv, morkFactory *ioFactory, nsIMdbHeap *ioSlotHeap)
void CloseEnv (morkEnv *ev)
mork_bool IsEnv () const
mork_u1 HexToByte (mork_ch inFirstHex, mork_ch inSecondHex)
mork_size TokenAsHex (void *outBuf, mork_token inToken)
mork_size OidAsHex (void *outBuf, const mdbOid &inOid)
char * CopyString (nsIMdbHeap *ioHeap, const char *inString)
void FreeString (nsIMdbHeap *ioHeap, char *ioString)
void StringToYarn (const char *inString, mdbYarn *outYarn)
morkHandleFace * NewHandle (mork_size inSize)
void ZapHandle (morkHandleFace *ioHandle)
void EnableAutoClear ()
void DisableAutoClear ()
mork_bool DoAutoClear () const
void NewErrorAndCode (const char *inString, mork_u2 inCode)
void NewError (const char *inString)
void NewWarning (const char *inString)
void ClearMorkErrorsAndWarnings ()
void AutoClearMorkErrorsAndWarnings ()
void StubMethodOnlyError ()
void OutOfMemoryError ()
void NilPointerError ()
void NilPointerWarning ()
void CantMakeWhenBadError ()
void NewNonEnvError ()
void NilEnvSlotError ()
void NonEnvTypeError (morkEnv *ev)
mork_bool Good () const
mork_bool Bad () const
nsIMdbEnvAsMdbEnv ()
mork_u4 ErrorCode () const
mdb_err AsErr () const
NS_DECL_ISUPPORTS NS_IMETHOD IsFrozenMdbObject (nsIMdbEnv *ev, mdb_bool *outIsReadonly)
NS_IMETHOD GetMdbFactory (nsIMdbEnv *ev, nsIMdbFactory **acqFactory)
NS_IMETHOD GetWeakRefCount (nsIMdbEnv *ev, mdb_count *outCount)
NS_IMETHOD GetStrongRefCount (nsIMdbEnv *ev, mdb_count *outCount)
NS_IMETHOD AddWeakRef (nsIMdbEnv *ev)
mork_refs AddWeakRef (morkEnv *ev)
NS_IMETHOD AddStrongRef (nsIMdbEnv *ev)
virtual mork_refs AddStrongRef (morkEnv *ev)
NS_IMETHOD CutWeakRef (nsIMdbEnv *ev)
mork_refs CutWeakRef (morkEnv *ev)
NS_IMETHOD CutStrongRef (nsIMdbEnv *ev)
virtual mork_refs CutStrongRef (morkEnv *ev)
NS_IMETHOD CloseMdbObject (nsIMdbEnv *ev)
mdb_err CloseMdbObject (morkEnv *ev)
NS_IMETHOD IsOpenMdbObject (nsIMdbEnv *ev, mdb_bool *outOpen)
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 morkEnvFromMdbEnv (nsIMdbEnv *ioEnv)
static void SlotWeakEnv (morkEnv *me, morkEnv *ev, morkEnv **ioSlot)
static void SlotStrongEnv (morkEnv *me, morkEnv *ev, morkEnv **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

morkFactorymEnv_Factory
nsIMdbHeapmEnv_Heap
nsIMdbEnvmEnv_SelfAsMdbEnv
nsIMdbErrorHookmEnv_ErrorHook
morkPoolmEnv_HandlePool
mork_u2 mEnv_ErrorCount
mork_u2 mEnv_WarningCount
mork_u4 mEnv_ErrorCode
mork_bool mEnv_DoTrace
mork_able mEnv_AutoClear
mork_bool mEnv_ShouldAbort
mork_bool mEnv_BeVerbose
mork_bool mEnv_OwnsHeap
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

 morkEnv (const morkEnv &other)
morkEnvoperator= (const morkEnv &other)

Friends

class morkHandleFrame

Detailed Description

Definition at line 83 of file morkEnv.h.


Constructor & Destructor Documentation

morkEnv::~morkEnv ( ) [virtual]

Definition at line 79 of file morkEnv.cpp.

{
  CloseMorkNode(mMorkEnv);
  if (mEnv_Heap)
  {
    mork_bool ownsHeap = mEnv_OwnsHeap;
    nsIMdbHeap*saveHeap = mEnv_Heap;

    if (ownsHeap)
    {
#ifdef MORK_DEBUG_HEAP_STATS
      printf("%d blocks remaining \n", ((orkinHeap *) saveHeap)->HeapBlockCount());
      mork_u4* array = (mork_u4*) this;
      array -= 3;
      // null out heap ptr in mem block so we won't crash trying to use it to
      // delete the env.
      *array = nsnull;
#endif // MORK_DEBUG_HEAP_STATS
      // whoops, this is our heap - hmm. Can't delete it, or not allocate env's from
      // an orkinHeap.
      delete saveHeap;
    }

  }
//  MORK_ASSERT(mEnv_SelfAsMdbEnv==0);
  MORK_ASSERT(mEnv_ErrorHook==0);
}

Here is the call graph for this function:

morkEnv::morkEnv ( const morkUsage inUsage,
nsIMdbHeap ioHeap,
morkFactory ioFactory,
nsIMdbHeap ioSlotHeap 
)

Definition at line 111 of file morkEnv.cpp.

: morkObject(inUsage, ioHeap, morkColor_kNone)
, mEnv_Factory( ioFactory )
, mEnv_Heap( ioSlotHeap )

, mEnv_SelfAsMdbEnv( 0 )
, mEnv_ErrorHook( 0 )
, mEnv_HandlePool( 0 )
  
, mEnv_ErrorCount( 0 ) 
, mEnv_WarningCount( 0 ) 

, mEnv_ErrorCode( 0 )
  
, mEnv_DoTrace( morkBool_kFalse )
, mEnv_AutoClear( morkAble_kDisabled )
, mEnv_ShouldAbort( morkBool_kFalse )
, mEnv_BeVerbose( morkEnv_kBeVerbose )
, mEnv_OwnsHeap ( morkBool_kFalse )
{
  MORK_ASSERT(ioSlotHeap && ioFactory );
  if ( ioSlotHeap )
  {
    // mEnv_Heap is NOT refcounted:
    // nsIMdbHeap_SlotStrongHeap(ioSlotHeap, this, &mEnv_Heap);
    
    mEnv_HandlePool = new morkPool(morkUsage::kGlobal,
      (nsIMdbHeap*) 0, ioSlotHeap);
      
    MORK_ASSERT(mEnv_HandlePool);
    if ( mEnv_HandlePool && this->Good() )
    {
      mNode_Derived = morkDerived_kEnv;
      mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
    }
  }
}

Here is the call graph for this function:

morkEnv::morkEnv ( morkEnv ev,
const morkUsage inUsage,
nsIMdbHeap ioHeap,
nsIMdbEnv inSelfAsMdbEnv,
morkFactory ioFactory,
nsIMdbHeap ioSlotHeap 
)

Definition at line 151 of file morkEnv.cpp.

: morkObject(ev, inUsage, ioHeap, morkColor_kNone, (morkHandle*) 0)
, mEnv_Factory( ioFactory )
, mEnv_Heap( ioSlotHeap )

, mEnv_SelfAsMdbEnv( inSelfAsMdbEnv )
, mEnv_ErrorHook( 0 )
, mEnv_HandlePool( 0 )
  
, mEnv_ErrorCount( 0 ) 
, mEnv_WarningCount( 0 ) 

, mEnv_ErrorCode( 0 )
  
, mEnv_DoTrace( morkBool_kFalse )
, mEnv_AutoClear( morkAble_kDisabled )
, mEnv_ShouldAbort( morkBool_kFalse )
, mEnv_BeVerbose( morkEnv_kBeVerbose )
, mEnv_OwnsHeap ( morkBool_kFalse )
{
  // $$$ do we need to refcount the inSelfAsMdbEnv nsIMdbEnv??
  
  if ( ioFactory && inSelfAsMdbEnv && ioSlotHeap)
  {
    // mEnv_Heap is NOT refcounted:
    // nsIMdbHeap_SlotStrongHeap(ioSlotHeap, ev, &mEnv_Heap);

    mEnv_HandlePool = new(*ioSlotHeap, ev) morkPool(ev, 
      morkUsage::kHeap, ioSlotHeap, ioSlotHeap);
      
    MORK_ASSERT(mEnv_HandlePool);
    if ( mEnv_HandlePool && ev->Good() )
    {
      mNode_Derived = morkDerived_kEnv;
      mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
    }
  }
  else
    ev->NilPointerError();
}

Here is the call graph for this function:

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

Member Function Documentation

NS_IMETHODIMP morkObject::AddStrongRef ( nsIMdbEnv ev) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 181 of file morkObject.cpp.

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

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

NS_IMETHODIMP morkObject::AddWeakRef ( nsIMdbEnv ev) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 176 of file morkObject.cpp.

{
  return morkNode::AddWeakRef((morkEnv *) mev);
}
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:

mdb_err morkEnv::AsErr ( ) const [inline]

Definition at line 228 of file morkEnv.h.

{ return (mdb_err) mEnv_ErrorCode; }

Definition at line 223 of file morkEnv.h.

{ return (nsIMdbEnv *) this; }

Definition at line 491 of file morkEnv.cpp.

Here is the call graph for this function:

mork_bool morkEnv::Bad ( ) const [inline]

Definition at line 221 of file morkEnv.h.

{ return ( mEnv_ErrorCount != 0 ); }

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:

Definition at line 436 of file morkEnv.cpp.

{
  this->NewError("can't make an object when ev->Bad()");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsIMdbEnv.

Definition at line 642 of file morkEnv.cpp.

Implements nsIMdbEnv.

Definition at line 659 of file morkEnv.cpp.

Here is the call graph for this function:

Definition at line 482 of file morkEnv.cpp.

Here is the caller graph for this function:

Implements nsIMdbEnv.

Definition at line 652 of file morkEnv.cpp.

{
  mEnv_WarningCount = 0;
  return NS_OK;
}
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:

Definition at line 196 of file morkEnv.cpp.

{
  if ( this )
  {
    if ( this->IsNode() )
    {
      // $$$ release mEnv_SelfAsMdbEnv??
      // $$$ release mEnv_ErrorHook??
      
      mEnv_SelfAsMdbEnv = 0;
      mEnv_ErrorHook = 0;
      
      morkPool* savePool = mEnv_HandlePool;
      morkPool::SlotStrongPool((morkPool*) 0, ev, &mEnv_HandlePool);
      // free the pool
      if (mEnv_SelfAsMdbEnv)
      {
        if (savePool && mEnv_Heap)
          mEnv_Heap->Free(this->AsMdbEnv(), savePool);
      }
      else
      {
        if (savePool)
        {
          if (savePool->IsOpenNode())
            savePool->CloseMorkNode(ev);
          delete savePool;
        }
        // how do we free this? might need to get rid of asserts.
      }
      // mEnv_Factory is NOT refcounted
      
      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:

NS_IMETHODIMP morkObject::CloseMdbObject ( nsIMdbEnv ev) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 199 of file morkObject.cpp.

{
  return morkNode::CloseMdbObject((morkEnv *) mev);
}
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 morkEnv::CloseMorkNode ( morkEnv ev) [virtual]

Reimplemented from morkObject.

Definition at line 68 of file morkEnv.cpp.

{
  if ( this->IsOpenNode() )
  {
    this->MarkClosing();
    this->CloseEnv(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:

char * morkEnv::CopyString ( nsIMdbHeap ioHeap,
const char *  inString 
)

Definition at line 362 of file morkEnv.cpp.

{
  char* outString = 0;
  if ( ioHeap && inString )
  {
    mork_size size = MORK_STRLEN(inString) + 1;
    ioHeap->Alloc(this->AsMdbEnv(), size, (void**) &outString);
    if ( outString )
      MORK_STRCPY(outString, inString);
  }
  else
    this->NilPointerError();
  return outString;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP morkObject::CutStrongRef ( nsIMdbEnv ev) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 192 of file morkObject.cpp.

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

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:

NS_IMETHODIMP morkObject::CutWeakRef ( nsIMdbEnv ev) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 187 of file morkObject.cpp.

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

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 197 of file morkEnv.h.

Here is the caller graph for this function:

mork_bool morkEnv::DoAutoClear ( ) const [inline]

Definition at line 199 of file morkEnv.h.

Here is the caller graph for this function:

Definition at line 196 of file morkEnv.h.

Here is the caller graph for this function:

mork_u4 morkEnv::ErrorCode ( ) const [inline]

Definition at line 226 of file morkEnv.h.

{ return mEnv_ErrorCode; }
void morkEnv::FreeString ( nsIMdbHeap ioHeap,
char *  ioString 
)

Definition at line 378 of file morkEnv.cpp.

{
  if ( ioHeap )
  {
    if ( ioString )
      ioHeap->Free(this->AsMdbEnv(), ioString);
  }
  else
    this->NilPointerError();
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkEnv * morkEnv::FromMdbEnv ( nsIMdbEnv ioEnv) [static]

Definition at line 503 of file morkEnv.cpp.

{
  morkEnv* outEnv = 0;
  if ( ioEnv )
  {
    // Note this cast is expected to perform some address adjustment of the
    // pointer, so oenv likely does not equal ioEnv.  Do not cast to void*
    // first to force an exactly equal pointer (we tried it and it's wrong).
    morkEnv* ev = (morkEnv*) ioEnv;
    if ( ev && ev->IsEnv() )
    {
      if ( ev->DoAutoClear() )
      {
        ev->mEnv_ErrorCount = 0;
        ev->mEnv_WarningCount = 0;
        ev->mEnv_ErrorCode = 0;
      }
      outEnv = ev;
    }
    else
      MORK_ASSERT(outEnv);
  }
  else
    MORK_ASSERT(outEnv);
  return outEnv;
}

Here is the call graph for this function:

NS_IMETHODIMP morkEnv::GetAutoClear ( mdb_bool outAutoClear) [virtual]

Implements nsIMdbEnv.

Definition at line 584 of file morkEnv.cpp.

{
  NS_ENSURE_ARG_POINTER(outAutoClear);
  *outAutoClear = DoAutoClear();
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP morkEnv::GetDoTrace ( mdb_bool outDoTrace) [virtual]

Implements nsIMdbEnv.

Definition at line 569 of file morkEnv.cpp.

{
  NS_ENSURE_ARG_POINTER(outDoTrace);
  *outDoTrace = mEnv_DoTrace;
  return NS_OK;
}
NS_IMETHODIMP morkEnv::GetEnvBeVerbose ( mdb_bool outBeVerbose) [virtual]

Implements nsIMdbEnv.

Definition at line 554 of file morkEnv.cpp.

{
  NS_ENSURE_ARG_POINTER(outBeVerbose);
  *outBeVerbose = mEnv_BeVerbose;
  return NS_OK;
}
NS_IMETHODIMP morkEnv::GetErrorCount ( mdb_count outCount,
mdb_bool outShouldAbort 
) [virtual]

Implements nsIMdbEnv.

Definition at line 532 of file morkEnv.cpp.

{
  if ( outCount )
    *outCount = mEnv_ErrorCount;
  if ( outShouldAbort )
    *outShouldAbort = mEnv_ShouldAbort;
  return NS_OK;
}
NS_IMETHODIMP morkEnv::GetErrorHook ( nsIMdbErrorHook **  acqErrorHook) [virtual]

Implements nsIMdbEnv.

Definition at line 602 of file morkEnv.cpp.

{
  NS_ENSURE_ARG_POINTER(acqErrorHook);
  *acqErrorHook = mEnv_ErrorHook;
  NS_IF_ADDREF(mEnv_ErrorHook);
  return NS_OK;
}
NS_IMETHODIMP morkEnv::GetHeap ( nsIMdbHeap **  acqHeap) [virtual]

Implements nsIMdbEnv.

Definition at line 619 of file morkEnv.cpp.

{
  NS_ENSURE_ARG_POINTER(acqHeap);
  nsIMdbHeap* outHeap = 0;
  nsIMdbHeap* heap = mEnv_Heap;
  if ( heap && heap->HeapAddStrongRef(this) == 0 )
    outHeap = heap;

  if ( acqHeap )
    *acqHeap = outHeap;
  return NS_OK;
}

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 morkObject::GetStrongRefCount ( nsIMdbEnv ev,
mdb_count outCount 
) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 168 of file morkObject.cpp.

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

Here is the call graph for this function:

NS_IMETHODIMP morkEnv::GetWarningCount ( mdb_count outCount,
mdb_bool outShouldAbort 
) [virtual]

Implements nsIMdbEnv.

Definition at line 543 of file morkEnv.cpp.

{
  if ( outCount )
    *outCount = mEnv_WarningCount;
  if ( outShouldAbort )
    *outShouldAbort = mEnv_ShouldAbort;
  return NS_OK;
}
NS_IMETHODIMP morkObject::GetWeakRefCount ( nsIMdbEnv ev,
mdb_count outCount 
) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 161 of file morkObject.cpp.

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

Here is the call graph for this function:

mork_bool morkEnv::Good ( ) const [inline]

Definition at line 220 of file morkEnv.h.

{ return ( mEnv_ErrorCount == 0 ); }
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_u1 morkEnv::HexToByte ( mork_ch  inFirstHex,
mork_ch  inSecondHex 
)

Definition at line 267 of file morkEnv.cpp.

{
  mork_u1 hi = 0; // high four hex bits
  mork_flags f = morkCh_GetFlags(inFirstHex);
  if ( morkFlags_IsDigit(f) )
    hi = (mork_u1) (inFirstHex - (mork_ch) '0');
  else if ( morkFlags_IsUpper(f) )
    hi = (mork_u1) ((inFirstHex - (mork_ch) 'A') + 10);
  else if ( morkFlags_IsLower(f) )
    hi = (mork_u1) ((inFirstHex - (mork_ch) 'a') + 10);
  
  mork_u1 lo = 0; // low four hex bits
  f = morkCh_GetFlags(inSecondHex);
  if ( morkFlags_IsDigit(f) )
    lo = (mork_u1) (inSecondHex - (mork_ch) '0');
  else if ( morkFlags_IsUpper(f) )
    lo = (mork_u1) ((inSecondHex - (mork_ch) 'A') + 10);
  else if ( morkFlags_IsLower(f) )
    lo = (mork_u1) ((inSecondHex - (mork_ch) 'a') + 10);
    
  return (mork_u1) ((hi << 4) | lo);
}

Here is the caller 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 morkEnv::IsEnv ( ) const [inline]

Definition at line 170 of file morkEnv.h.

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

Here is the call graph for this function:

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 morkObject::IsOpenMdbObject ( nsIMdbEnv ev,
mdb_bool outOpen 
) [virtual, inherited]

Implements nsIMdbObject.

Reimplemented in morkStore, and morkCursor.

Definition at line 205 of file morkObject.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 morkNode::IsShutNode ( ) const [inline, inherited]

Definition at line 239 of file morkNode.h.

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.

void morkEnv::NewError ( const char *  inString)

Definition at line 402 of file morkEnv.cpp.

Here is the call graph for this function:

void morkEnv::NewErrorAndCode ( const char *  inString,
mork_u2  inCode 
)

Definition at line 390 of file morkEnv.cpp.

{
  MORK_ASSERT(morkBool_kFalse); // get developer's attention

  ++mEnv_ErrorCount;
  mEnv_ErrorCode = (mork_u4) ((inCode)? inCode: morkEnv_kGenericError);
  
  if ( mEnv_ErrorHook )
    mEnv_ErrorHook->OnErrorString(this->AsMdbEnv(), inString);
}

Here is the call graph for this function:

morkHandleFace* morkEnv::NewHandle ( mork_size  inSize) [inline]

Definition at line 190 of file morkEnv.h.

  { return mEnv_HandlePool->NewHandle(this, inSize, (morkZone*) 0); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 456 of file morkEnv.cpp.

{
  this->NewError("non-env instance");
}

Here is the call graph for this function:

void morkEnv::NewWarning ( const char *  inString)

Definition at line 414 of file morkEnv.cpp.

{
  MORK_ASSERT(morkBool_kFalse); // get developer's attention
  
  ++mEnv_WarningCount;
  if ( mEnv_ErrorHook )
    mEnv_ErrorHook->OnWarningString(this->AsMdbEnv(), inString);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 462 of file morkEnv.cpp.

{
  if ( !mEnv_HandlePool || !mEnv_Factory )
  {
    if ( !mEnv_HandlePool )
      this->NewError("nil mEnv_HandlePool");
    if ( !mEnv_Factory )
      this->NewError("nil mEnv_Factory");
  }
  else
    this->NewError("unknown nil env slot");
}

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 444 of file morkEnv.cpp.

Here is the call graph for this function:

Definition at line 450 of file morkEnv.cpp.

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; }

Definition at line 476 of file morkEnv.cpp.

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

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

mork_size morkEnv::OidAsHex ( void outBuf,
const mdbOid inOid 
)

Definition at line 241 of file morkEnv.cpp.

{
  mork_u1* p = (mork_u1*) outBuf;
  mork_size outSize = this->TokenAsHex(p, inOid.mOid_Id);
  p += outSize;
  *p++ = ':';
  
  mork_scope scope = inOid.mOid_Scope;
  if ( scope < 0x80 && morkCh_IsName((mork_ch) scope) )
  {
    *p++ = (mork_u1) scope;
    *p = 0; // null termination
    outSize += 2;
  }
  else
  {
    *p++ = '^';
    mork_size scopeSize = this->TokenAsHex(p, scope);
    outSize += scopeSize + 2;
  }
  return outSize;
}

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:

morkEnv& morkEnv::operator= ( const morkEnv other) [private]

Definition at line 430 of file morkEnv.cpp.

{
  this->NewError("out of memory");
}

Here is the call graph for this function:

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

NS_IMETHODIMP morkEnv::SetAutoClear ( mdb_bool  inAutoClear) [virtual]

Implements nsIMdbEnv.

Definition at line 592 of file morkEnv.cpp.

{
  if ( inAutoClear )
    EnableAutoClear();
  else
    DisableAutoClear();
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP morkEnv::SetDoTrace ( mdb_bool  inDoTrace) [virtual]

Implements nsIMdbEnv.

Definition at line 577 of file morkEnv.cpp.

{
  mEnv_DoTrace = inDoTrace;
  return NS_OK;
}
NS_IMETHODIMP morkEnv::SetEnvBeVerbose ( mdb_bool  inBeVerbose) [virtual]

Implements nsIMdbEnv.

Definition at line 562 of file morkEnv.cpp.

{
  mEnv_BeVerbose = inBeVerbose;
  return NS_OK;
}
NS_IMETHODIMP morkEnv::SetErrorHook ( nsIMdbErrorHook ioErrorHook) [virtual]

Implements nsIMdbEnv.

Definition at line 611 of file morkEnv.cpp.

{
  mEnv_ErrorHook = ioErrorHook;
  return NS_OK;
}
void morkNode::SetFrozen ( ) [inline, inherited]

Definition at line 136 of file morkNode.h.

NS_IMETHODIMP morkEnv::SetHeap ( nsIMdbHeap ioHeap) [virtual]

Implements nsIMdbEnv.

Definition at line 633 of file morkEnv.cpp.

{
  nsIMdbHeap_SlotStrongHeap(ioHeap, this, &mEnv_Heap);
  return NS_OK;
}

Here is the call graph for this function:

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:

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:

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

Definition at line 236 of file morkEnv.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 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:

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

Definition at line 232 of file morkEnv.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:

void morkEnv::StringToYarn ( const char *  inString,
mdbYarn outYarn 
)

Definition at line 328 of file morkEnv.cpp.

{
  if ( outYarn )
  {
    mdb_fill fill = ( inString )? (mdb_fill) MORK_STRLEN(inString) : 0; 
      
    if ( fill ) // have nonempty content?
    {
      mdb_size size = outYarn->mYarn_Size; // max dest size
      if ( fill > size ) // too much string content?
      {
        outYarn->mYarn_More = fill - size; // extra string bytes omitted
        fill = size; // copy no more bytes than size of yarn buffer
      }
      void* dest = outYarn->mYarn_Buf; // where bytes are going
      if ( !dest ) // nil destination address buffer?
        fill = 0; // we can't write any content at all
        
      if ( fill ) // anything to copy?
        MORK_MEMCPY(dest, inString, fill); // copy fill bytes to yarn
        
      outYarn->mYarn_Fill = fill; // tell yarn size of copied content
    }
    else // no content to put into the yarn
    {
      outYarn->mYarn_Fill = 0; // tell yarn that string has no bytes
    }
    outYarn->mYarn_Form = 0; // always update the form slot
  }
  else
    this->NilPointerError();
}

Here is the call graph for this function:

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:

Definition at line 424 of file morkEnv.cpp.

{
  this->NewError("method is stub only");
}

Here is the call graph for this function:

mork_size morkEnv::TokenAsHex ( void outBuf,
mork_token  inToken 
)

Definition at line 291 of file morkEnv.cpp.

{
  static const char morkEnv_kHexDigits[] = "0123456789ABCDEF";
  char* p = (char*) outBuf;
  char* end = p + 32; // write no more than 32 digits for safety
  if ( inToken )
  {
    // first write all the hex digits in backwards order:
    while ( p < end && inToken ) // more digits to write?
    {
      *p++ = morkEnv_kHexDigits[ inToken & 0x0F ]; // low four bits
      inToken >>= 4; // we fervently hope this does not sign extend
    }
    *p = 0; // end the string with a null byte
    char* s = (char*) outBuf; // first byte in string
    mork_size size = (mork_size) (p - s); // distance from start

    // now reverse the string in place:
    // note that p starts on the null byte, so we need predecrement:
    while ( --p > s ) // need to swap another byte in the string?
    {
      char c = *p; // temp for swap
      *p = *s;
      *s++ = c; // move s forward here, and p backward in the test
    }
    return size;
  }
  else // special case for zero integer
  {
    *p++ = '0'; // write a zero digit
    *p = 0; // end with a null byte
    return 1; // one digit in hex representation
  }
}

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 morkEnv::ZapHandle ( morkHandleFace *  ioHandle) [inline]

Definition at line 193 of file morkEnv.h.

  { mEnv_HandlePool->ZapHandle(this, ioHandle); }

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


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 119 of file morkEnv.h.

Definition at line 121 of file morkEnv.h.

Definition at line 118 of file morkEnv.h.

Definition at line 116 of file morkEnv.h.

Definition at line 113 of file morkEnv.h.

Definition at line 109 of file morkEnv.h.

Definition at line 105 of file morkEnv.h.

Definition at line 111 of file morkEnv.h.

Definition at line 106 of file morkEnv.h.

Definition at line 122 of file morkEnv.h.

Definition at line 108 of file morkEnv.h.

Definition at line 120 of file morkEnv.h.

Definition at line 114 of file morkEnv.h.

Definition at line 91 of file morkObject.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 89 of file morkObject.h.


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