Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions
Assertion Class Reference
Collaboration diagram for Assertion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Assertion (nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue)
 Assertion (nsIRDFResource *aSource)
 ~Assertion ()
void AddRef ()
void Release (nsFixedSizeAllocator &aAllocator)
void Mark ()
PRBool IsMarked ()
void Unmark ()

Static Public Member Functions

static AssertionCreate (nsFixedSizeAllocator &aAllocator, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue)
static AssertionCreate (nsFixedSizeAllocator &aAllocator, nsIRDFResource *aSource)
static void Destroy (nsFixedSizeAllocator &aAllocator, Assertion *aAssertion)
static PLDHashOperator PR_CALLBACK DeletePropertyHashEntry (PLDHashTable *aTable, PLDHashEntryHdr *aHdr, PRUint32 aNumber, void *aArg)

Public Attributes

nsIRDFResourcemSource
AssertionmNext
union Assertion.u u
PRUint16 mRefCnt
PRPackedBool mHashEntry

Static Private Member Functions

static voidoperator new (size_t) CPP_THROW_NEW
static void operator delete (void *, size_t)

Detailed Description

Definition at line 117 of file nsInMemoryDataSource.cpp.


Constructor & Destructor Documentation

Assertion::Assertion ( nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue 
)

Definition at line 240 of file nsInMemoryDataSource.cpp.

    : mSource(aSource),
      mNext(nsnull),
      mRefCnt(0),
      mHashEntry(PR_FALSE)
{
    MOZ_COUNT_CTOR(RDF_Assertion);

    u.as.mProperty = aProperty;
    u.as.mTarget = aTarget;

    NS_ADDREF(mSource);
    NS_ADDREF(u.as.mProperty);
    NS_ADDREF(u.as.mTarget);

    u.as.mInvNext = nsnull;
    u.as.mTruthValue = aTruthValue;
    u.as.mMarked = PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file nsInMemoryDataSource.cpp.

    : mSource(aSource),
      mNext(nsnull),
      mRefCnt(0),
      mHashEntry(PR_TRUE)
{
    MOZ_COUNT_CTOR(RDF_Assertion);

    NS_ADDREF(mSource);

    u.hash.mPropertyHash = PL_NewDHashTable(PL_DHashGetStubOps(),
                      nsnull, sizeof(Entry), PL_DHASH_MIN_SIZE);
}

Here is the call graph for this function:

Definition at line 263 of file nsInMemoryDataSource.cpp.

{
    MOZ_COUNT_DTOR(RDF_Assertion);
#ifdef DEBUG_REFS
    --gInstanceCount;
    fprintf(stdout, "%d - RDF: Assertion\n", gInstanceCount);
#endif

    NS_RELEASE(mSource);
    if (!mHashEntry)
    {
        NS_RELEASE(u.as.mProperty);
        NS_RELEASE(u.as.mTarget);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

void Assertion::AddRef ( void  ) [inline]

Definition at line 160 of file nsInMemoryDataSource.cpp.

                  {
        if (mRefCnt == PR_UINT16_MAX) {
            NS_WARNING("refcount overflow, leaking Assertion");
            return;
        }
        ++mRefCnt;
    }

Here is the caller graph for this function:

static Assertion* Assertion::Create ( nsFixedSizeAllocator &  aAllocator,
nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue 
) [inline, static]

Definition at line 121 of file nsInMemoryDataSource.cpp.

                               {
        void* place = aAllocator.Alloc(sizeof(Assertion));
        return place
            ? ::new (place) Assertion(aSource, aProperty, aTarget, aTruthValue)
            : nsnull; }

Here is the call graph for this function:

static Assertion* Assertion::Create ( nsFixedSizeAllocator &  aAllocator,
nsIRDFResource aSource 
) [inline, static]

Definition at line 131 of file nsInMemoryDataSource.cpp.

                                                                      {
        void* place = aAllocator.Alloc(sizeof(Assertion));
        return place
            ? ::new (place) Assertion(aSource)
            : nsnull; }

Here is the call graph for this function:

Definition at line 280 of file nsInMemoryDataSource.cpp.

{
    Entry* entry = NS_REINTERPRET_CAST(Entry*, aHdr);
    nsFixedSizeAllocator* allocator = NS_STATIC_CAST(nsFixedSizeAllocator*, aArg);

    Assertion* as = entry->mAssertions;
    while (as) {
        Assertion* doomed = as;
        as = as->mNext;

        // Unlink, and release the datasource's reference.
        doomed->mNext = doomed->u.as.mInvNext = nsnull;
        doomed->Release(*allocator);
    }
    return PL_DHASH_NEXT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void Assertion::Destroy ( nsFixedSizeAllocator &  aAllocator,
Assertion aAssertion 
) [inline, static]

Definition at line 138 of file nsInMemoryDataSource.cpp.

                                                                     {
        if (aAssertion->mHashEntry && aAssertion->u.hash.mPropertyHash) {
            PL_DHashTableEnumerate(aAssertion->u.hash.mPropertyHash,
                DeletePropertyHashEntry, &aAllocator);
            PL_DHashTableDestroy(aAssertion->u.hash.mPropertyHash);
            aAssertion->u.hash.mPropertyHash = nsnull;
        }
        aAssertion->~Assertion();
        aAllocator.Free(aAssertion, sizeof(*aAssertion)); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 179 of file nsInMemoryDataSource.cpp.

{ return u.as.mMarked; }

Here is the caller graph for this function:

void Assertion::Mark ( void  ) [inline]

Definition at line 178 of file nsInMemoryDataSource.cpp.

{ u.as.mMarked = PR_TRUE; }
static void Assertion::operator delete ( void ,
size_t   
) [inline, static, private]

Definition at line 215 of file nsInMemoryDataSource.cpp.

{}
static void* Assertion::operator new ( size_t  ) [inline, static, private]

Definition at line 214 of file nsInMemoryDataSource.cpp.

{ return 0; }
void Assertion::Release ( nsFixedSizeAllocator &  aAllocator) [inline]

Definition at line 168 of file nsInMemoryDataSource.cpp.

                                                   {
        if (mRefCnt == PR_UINT16_MAX) {
            NS_WARNING("refcount overflow, leaking Assertion");
            return;
        }
        if (--mRefCnt == 0)
            Destroy(aAllocator, this);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void Assertion::Unmark ( ) [inline]

Definition at line 180 of file nsInMemoryDataSource.cpp.

{ u.as.mMarked = PR_FALSE; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 209 of file nsInMemoryDataSource.cpp.

Definition at line 186 of file nsInMemoryDataSource.cpp.

Definition at line 208 of file nsInMemoryDataSource.cpp.

Definition at line 185 of file nsInMemoryDataSource.cpp.

union { ... } Assertion::u

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