#include <InstancePool.h>
Inheritance diagram for green::InstancePool:
Public Member Functions | |
ID | AddInstance (VariableTableInstancePtr inst) |
bool | HasInstance (ID id) const |
VariableTableInstancePtr | GetInstance (ID id) const |
void | RemoveInstance (ID id) |
Protected Types | |
typedef std::map< ID, VariableTableInstancePtr > | _idMap |
Protected Member Functions | |
ID | _getUnusedID () |
Protected Attributes | |
_idMap | mIDMap |
std::stack< ID > | mReusedIDs |
typedef std::map<ID, VariableTableInstancePtr> green::InstancePool::_idMap [protected] |
A std::map type that associates IDs with Instances
ID green::InstancePool::AddInstance | ( | VariableTableInstancePtr | inst | ) | [inline] |
Add a new instance to the pool.
inst | The instance to add to the pool |
bool green::InstancePool::HasInstance | ( | ID | id | ) | const [inline] |
Check if an instance is in the pool
id | The VariableTableInstance::ID of the instance to check for. |
VariableTableInstancePtr green::InstancePool::GetInstance | ( | ID | id | ) | const [inline] |
Get an instance from the pool, if it exists
id | The VariableTableInstance::ID of the instance to get. |
void green::InstancePool::RemoveInstance | ( | ID | id | ) | [inline] |
Remove an instance from the pool, if it exists.
id | The VariableTableInstance::ID of the instance to remove. |
ID green::InstancePool::_getUnusedID | ( | ) | [inline, protected] |
Get an unused ID to assign to an added instance.
_idMap green::InstancePool::mIDMap [protected] |
A std::map that associates IDs with Instances
std::stack<ID> green::InstancePool::mReusedIDs [protected] |
a stack used to keep track of reused IDs