EDoc::PStack Class Reference

#include <include/EDoc/PStack.h>


Detailed Description

Stores a stack of pointers that provides "set" like capabilities.

This is primarily used to store a stack of pointers to ensure that while processing data (Especially in Dictionary::CalculatePropogatingExceptions()) that the code does not enter a state of infinite recursion.

Definition at line 38 of file PStack.h.

Public Member Functions

size_t Size () const
 Returns the number of items in the stack.
bool Contains (const void *item) const
 Returns true if the stack already contains the given pointer.
ssize_t Location (const void *item) const
 Returns the index/location within the stack that the given pointer is located if it is in the stack or -1 if it is not in the stack.
bool Push (const void *item)
 Push a pointer onto the stack returning false if it already exists on the stack.
bool Pop (const void *item)
 Pop a pointer from the top of the stack.
std::ostream & Print (std::ostream &out, std::string prefix="") const
 Print a list of items currently on the stack.
std::string ToString (std::string prefix="") const
 Returns a string with the contents that would be displayed by Print().
const std::list< const void * > & GetInternal () const
 Returns a reference to the internal list that is used to implement the stack.

Private Attributes

std::list< const void * > stack
 The list of pointers that comprises the stack.


Member Function Documentation

EDoc::PStack::Size (  )  const [inline]

Returns the number of items in the stack.

Note:
EDoc++ data included.

Definition at line 45 of file PStack.h.

References stack.

EDoc::PStack::Contains ( const void *  item  )  const

Returns true if the stack already contains the given pointer.

Note:
EDoc++ data included.

Definition at line 26 of file PStack.cpp.

References stack.

EDoc::PStack::Location ( const void *  item  )  const

Returns the index/location within the stack that the given pointer is located if it is in the stack or -1 if it is not in the stack.

Note:
EDoc++ data included.

Definition at line 39 of file PStack.cpp.

References stack.

EDoc::PStack::Push ( const void *  item  ) 

Push a pointer onto the stack returning false if it already exists on the stack.

Note:
EDoc++ data included.

Definition at line 53 of file PStack.cpp.

References stack.

Referenced by EDoc::TypeLoc::ReplaceReferences(), EDoc::Type::ReplaceReferences(), EDoc::TryBlock::ReplaceReferences(), EDoc::PropogatingException::ReplaceReferences(), EDoc::Location::ReplaceReferences(), EDoc::FunctionTypeLoc::ReplaceReferences(), EDoc::FunctionType::ReplaceReferences(), EDoc::FunctionLoc::ReplaceReferences(), EDoc::Function::ReplaceReferences(), EDoc::Exception::ReplaceReferences(), EDoc::Dictionary::ReplaceReferences(), EDoc::CodeBlock::ReplaceReferences(), EDoc::CatchBlock::ReplaceReferences(), and EDoc::StackRef::StackRef().

EDoc::PStack::Pop ( const void *  item  ) 

Pop a pointer from the top of the stack.

Parameters:
item This is used for validation to ensure that we are popping of the item we expect.
Returns:
Returns false if the top item in the stack does not have the same value as the parameter item. If it returns false then it will NOT pop anything off the stack.

Definition at line 68 of file PStack.cpp.

References stack.

Referenced by EDoc::StackRef::~StackRef().

EDoc::PStack::Print ( std::ostream &  out,
std::string  prefix = "" 
) const

Print a list of items currently on the stack.

Used for debugging purposes.

Definition at line 79 of file PStack.cpp.

References stack.

Referenced by std::operator<<(), and ToString().

EDoc::PStack::ToString ( std::string  prefix = ""  )  const

Returns a string with the contents that would be displayed by Print().

Note:
EDoc++ data included.

Definition at line 92 of file PStack.cpp.

References Print().

EDoc::PStack::GetInternal (  )  const [inline]

Returns a reference to the internal list that is used to implement the stack.

Note:
EDoc++ data included.

Definition at line 97 of file PStack.h.

References stack.


Field Documentation

std::list<const void*> EDoc::PStack::stack [private]

The list of pointers that comprises the stack.

Definition at line 109 of file PStack.h.

Referenced by Contains(), GetInternal(), Location(), Pop(), Print(), Push(), and Size().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:09 2009 for EDoc-0.2.1 by  doxygen 1.5.1