Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes
PermanentAtomImpl Class Reference

A non-refcounted implementation of nsIAtom. More...

#include <nsAtomTable.h>

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

List of all members.

Public Types

enum  { REFCNT_PERMANENT_SENTINEL = PR_UINT32_MAX }

Public Member Functions

 PermanentAtomImpl ()
 ~PermanentAtomImpl ()
 NS_IMETHOD_ (nsrefcnt) AddRef()
 NS_IMETHOD_ (nsrefcnt) Release()
virtual PRBool IsPermanent ()
voidoperator new (size_t size, const nsACString &aString) CPP_THROW_NEW
voidoperator new (size_t size, AtomImpl *aAtom) CPP_THROW_NEW
PRBool IsPermanentInDestructor ()
void operator delete (void *ptr)
nsrefcnt GetRefCount ()
AString toString ()
 Get the Unicode or UTF8 value for the string.
AUTF8String toUTF8String ()
void getUTF8String ([shared, retval] out string aResult)
 Return a pointer to a zero terminated UTF8 string.
boolean equals (in AString aString)
 Compare the atom to a specific string value Note that this will NEVER return/throw an error condition.
boolean equalsUTF8 (in AUTF8String aString)
PRBool Equals (const nsAString &s)
PRBool EqualsUTF8 (const nsACString &s)

Public Attributes

char mString [1]

Detailed Description

A non-refcounted implementation of nsIAtom.

Definition at line 89 of file nsAtomTable.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
REFCNT_PERMANENT_SENTINEL 

Definition at line 62 of file nsAtomTable.h.


Constructor & Destructor Documentation

Definition at line 309 of file nsAtomTable.cpp.

  : AtomImpl()
{
}

Definition at line 314 of file nsAtomTable.cpp.

{
  // So we can tell if we were permanent while running the base class dtor.
  mRefCnt = REFCNT_PERMANENT_SENTINEL;
}

Member Function Documentation

boolean nsIAtom::equals ( in AString  aString) [inherited]

Compare the atom to a specific string value Note that this will NEVER return/throw an error condition.

PRBool nsIAtom::Equals ( const nsAString &  s) [inline, inherited]

Definition at line 75 of file nsIAtom.idl.

                                           {
    PRBool result;
    Equals(s, &result);
    return result;
  }

Here is the caller graph for this function:

boolean nsIAtom::equalsUTF8 ( in AUTF8String  aString) [inherited]
PRBool nsIAtom::EqualsUTF8 ( const nsACString &  s) [inline, inherited]

Definition at line 81 of file nsIAtom.idl.

                                                {
    PRBool result;
    EqualsUTF8(s, &result);
    return result;
  }

Here is the caller graph for this function:

nsrefcnt AtomImpl::GetRefCount ( ) [inline, inherited]

Definition at line 78 of file nsAtomTable.h.

{ return mRefCnt; }

Here is the caller graph for this function:

void nsIAtom::getUTF8String ( [shared, retval] out string  aResult) [inherited]

Return a pointer to a zero terminated UTF8 string.

Reimplemented from AtomImpl.

Definition at line 337 of file nsAtomTable.cpp.

{
  return PR_TRUE;
}
PRBool AtomImpl::IsPermanentInDestructor ( ) [inline, inherited]

Definition at line 67 of file nsAtomTable.h.

                                   {
    return mRefCnt == REFCNT_PERMANENT_SENTINEL;
  }

Here is the caller graph for this function:

void AtomImpl::operator delete ( void ptr) [inline, inherited]

Definition at line 73 of file nsAtomTable.h.

                                  {
    ::operator delete(ptr);
  }
void* PermanentAtomImpl::operator new ( size_t  size,
const nsACString &  aString 
) [inline]

Reimplemented from AtomImpl.

Definition at line 98 of file nsAtomTable.h.

                                                                           {
    return AtomImpl::operator new(size, aString);
  }
void * PermanentAtomImpl::operator new ( size_t  size,
AtomImpl aAtom 
)

Definition at line 362 of file nsAtomTable.cpp.

                                                                                   {
  NS_ASSERTION(!aAtom->IsPermanent(),
               "converting atom that's already permanent");

  // Just let the constructor overwrite the vtable pointer.
  return aAtom;
}
AString nsIAtom::toString ( ) [inherited]

Get the Unicode or UTF8 value for the string.

AUTF8String nsIAtom::toUTF8String ( ) [inherited]

Member Data Documentation

char AtomImpl::mString[1] [inherited]

Definition at line 82 of file nsAtomTable.h.


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