#include <include/EDoc/StackRef.h>
This is primarily used to ensure that pointers are pop'ed off the stack when a function call goes out of scope.
Definition at line 32 of file StackRef.h.
Public Member Functions | |
operator safe_bool_t () const | |
Returns true if the pointer was successfully pushed onto the stack during construction. | |
StackRef (PStack &stack_in, const void *item_in) | |
Pushes the given pointer onto the stack. | |
~StackRef () | |
Pops the pointer from the stack upon destruction. | |
Private Types | |
typedef void(StackRef::*) | safe_bool_t () const |
Private Member Functions | |
void | this_type_does_not_support_comparison () const |
(BRIEF DESC NOT PROVIDED). | |
Private Attributes | |
bool | valid |
True if pointer was successfully pushed onto stack. | |
PStack & | stack |
Stack pointer was pushed onto. | |
const void * | item |
Pointer value that was pushed onto the stack. |
typedef void(StackRef::*) EDoc::StackRef::safe_bool_t() const [private] |
Definition at line 34 of file StackRef.h.
EDoc::StackRef::StackRef | ( | EDoc::PStack & | stack_in, | |
const void * | item_in | |||
) |
Pushes the given pointer onto the stack.
Definition at line 26 of file StackRef.cpp.
References item, EDoc::PStack::Push(), stack, and valid.
EDoc::StackRef::~StackRef | ( | ) |
Pops the pointer from the stack upon destruction.
Definition at line 34 of file StackRef.cpp.
References EDOC_ASSERT, item, EDoc::PStack::Pop(), stack, and valid.
EDoc::StackRef::this_type_does_not_support_comparison | ( | ) | const [inline, private] |
(BRIEF DESC NOT PROVIDED).
Definition at line 35 of file StackRef.h.
Referenced by operator safe_bool_t().
EDoc::StackRef::operator safe_bool_t | ( | ) | const [inline] |
Returns true if the pointer was successfully pushed onto the stack during construction.
Definition at line 42 of file StackRef.h.
References this_type_does_not_support_comparison(), and valid.
bool EDoc::StackRef::valid [private] |
True if pointer was successfully pushed onto stack.
Definition at line 66 of file StackRef.h.
Referenced by operator safe_bool_t(), StackRef(), and ~StackRef().
PStack& EDoc::StackRef::stack [private] |
Stack pointer was pushed onto.
Definition at line 71 of file StackRef.h.
Referenced by StackRef(), and ~StackRef().
const void* EDoc::StackRef::item [private] |
Pointer value that was pushed onto the stack.
Definition at line 76 of file StackRef.h.
Referenced by StackRef(), and ~StackRef().