#include <include/EDoc/PStack.h>
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. |
EDoc::PStack::Size | ( | ) | const [inline] |
EDoc::PStack::Contains | ( | const void * | item | ) | const |
Returns true if the stack already contains the given pointer.
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.
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.
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.
item | This is used for validation to ensure that we are popping of the item we expect. |
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().
Definition at line 92 of file PStack.cpp.
References Print().
EDoc::PStack::GetInternal | ( | ) | const [inline] |
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().