![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
#include <ManagedVector.h>
Inheritance diagram for ManagedVector< Value >:Public Member Functions | |
| __inline bool | getManaged () const |
| ManagedVector () | |
| ManagedVector (bool manageMemory) | |
| __inline void | setManaged (bool val) |
| virtual | ~ManagedVector () |
Protected Attributes | |
| bool | _manageMemory |
An extension of the vector class that deletes all items in its destructor It manages a vector's memory by deleting in the destructor as long as "Managed" is true By default, managed equals zero
Definition at line 13 of file ManagedVector.h.
| ManagedVector< Value >::ManagedVector | ( | ) | [inline] |
| ManagedVector< Value >::ManagedVector | ( | bool | manageMemory | ) | [inline] |
Constructor Sets whether or not memory is managed by this dictionary
Definition at line 30 of file ManagedVector.h.
: _manageMemory(manageMemory) { }
| virtual ManagedVector< Value >::~ManagedVector | ( | ) | [inline, virtual] |
Destructor If "managed" is true, then this will delete all values in this dictionary
Definition at line 38 of file ManagedVector.h.
References ManagedVector< Value >::_manageMemory.
{
//if we are not managing memory, then abort
if(!_manageMemory)
return;
std::vector<Value*>::const_iterator iter = begin();
std::vector<Value*>::const_iterator endIter = end();
while(iter != endIter)
{
delete (*iter);
++iter;
}
}
| __inline bool ManagedVector< Value >::getManaged | ( | ) | const [inline] |
Definition at line 54 of file ManagedVector.h.
| __inline void ManagedVector< Value >::setManaged | ( | bool | val | ) | [inline] |
Definition at line 55 of file ManagedVector.h.
bool ManagedVector< Value >::_manageMemory [protected] |
Definition at line 16 of file ManagedVector.h.
Referenced by ManagedVector< Value >::~ManagedVector().
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.