Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsTransactionRedoStack Class Reference

#include <nsTransactionStack.h>

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

List of all members.

Public Member Functions

virtual ~nsTransactionRedoStack ()
virtual nsresult Clear (void)
virtual nsresult Push (nsTransactionItem *aTransactionItem)
virtual nsresult Pop (nsTransactionItem **aTransactionItem)
virtual nsresult PopBottom (nsTransactionItem **aTransactionItem)
virtual nsresult Peek (nsTransactionItem **aTransactionItem)
virtual nsresult GetItem (PRInt32 aIndex, nsTransactionItem **aTransactionItem)
virtual nsresult GetSize (PRInt32 *aStackSize)

Detailed Description

Definition at line 72 of file nsTransactionStack.h.


Constructor & Destructor Documentation

Definition at line 163 of file nsTransactionStack.cpp.

{
  Clear();
}

Here is the call graph for this function:


Member Function Documentation

Reimplemented from nsTransactionStack.

Definition at line 169 of file nsTransactionStack.cpp.

{
  nsTransactionItem *tx = 0;
  nsresult result       = NS_OK;

  /* When clearing a Redo stack, we have to clear from the
   * bottom of the stack towards the top!
   */

  result = PopBottom(&tx);

  if (NS_FAILED(result))
    return result;

  while (tx) {
    delete tx;

    result = PopBottom(&tx);

    if (NS_FAILED(result))
      return result;
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsTransactionStack::GetItem ( PRInt32  aIndex,
nsTransactionItem **  aTransactionItem 
) [virtual, inherited]

Definition at line 114 of file nsTransactionStack.cpp.

{
  if (!aTransaction)
    return NS_ERROR_NULL_POINTER;

  if (aIndex < 0 || aIndex >= mQue.GetSize())
    return NS_ERROR_FAILURE;

  *aTransaction = (nsTransactionItem *)(mQue.ObjectAt(aIndex));

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsTransactionStack::GetSize ( PRInt32 aStackSize) [virtual, inherited]

Definition at line 153 of file nsTransactionStack.cpp.

{
  if (!aStackSize)
    return NS_ERROR_NULL_POINTER;

  *aStackSize = mQue.GetSize();

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsTransactionStack::Peek ( nsTransactionItem **  aTransactionItem) [virtual, inherited]

Definition at line 98 of file nsTransactionStack.cpp.

{
  if (!aTransaction)
    return NS_ERROR_NULL_POINTER;

  if (!mQue.GetSize()) {
    *aTransaction = 0;
    return NS_OK;
  }

  *aTransaction = (nsTransactionItem *)(mQue.Last());

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsTransactionStack::Pop ( nsTransactionItem **  aTransactionItem) [virtual, inherited]

Definition at line 70 of file nsTransactionStack.cpp.

{
  if (!aTransaction)
    return NS_ERROR_NULL_POINTER;

  /* nsDeque is a FIFO, so the top of our stack is actually
   * the back of the deque.
   */
  *aTransaction = (nsTransactionItem *)mQue.Pop();

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsTransactionStack::PopBottom ( nsTransactionItem **  aTransactionItem) [virtual, inherited]

Definition at line 84 of file nsTransactionStack.cpp.

{
  if (!aTransaction)
    return NS_ERROR_NULL_POINTER;

  /* nsDeque is a FIFO, so the bottom of our stack is actually
   * the front of the deque.
   */
  *aTransaction = (nsTransactionItem *)mQue.PopFront();

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsTransactionStack::Push ( nsTransactionItem aTransactionItem) [virtual, inherited]

Definition at line 56 of file nsTransactionStack.cpp.

{
  if (!aTransaction)
    return NS_ERROR_NULL_POINTER;

  /* nsDeque's Push() method adds new items at the back
   * of the deque.
   */
  mQue.Push(aTransaction);

  return NS_OK;
}

Here is the caller graph for this function:


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