Add InstanceCounter.

This commit is contained in:
JoelKatz
2012-10-31 15:48:17 -07:00
parent 74629254a5
commit 1bdc4914f5
3 changed files with 92 additions and 0 deletions

15
src/InstanceCounter.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "InstanceCounter.h"
InstanceType* InstanceType::sHeadInstance = NULL;
std::vector<InstanceType::InstanceCount> InstanceType::getInstanceCounts(int min)
{
std::vector<InstanceCount> ret;
for (InstanceType* i = sHeadInstance; i != NULL; i = i->mNextInstance)
{
int c = i->getCount();
if (c >= min)
ret.push_back(InstanceCount(i->getName(), c));
}
return ret;
}