42 lines
675 B
C++
42 lines
675 B
C++
/**
|
|
* @file PaiObjectRecycler.cpp
|
|
*/
|
|
|
|
#include "PaiObjectRecycler.h"
|
|
#include "PaiObject.h"
|
|
|
|
using namespace pai::objectmodel;
|
|
|
|
PaiObjectRecycler::PaiObjectRecycler()
|
|
{
|
|
}
|
|
|
|
PaiObjectRecycler::~PaiObjectRecycler()
|
|
{
|
|
Clear();
|
|
}
|
|
|
|
void PaiObjectRecycler::Push(PaiObject *pChild)
|
|
{
|
|
if(!m_DeletedObjects.contains(pChild))
|
|
{
|
|
m_DeletedObjects.append(pChild);
|
|
}
|
|
}
|
|
|
|
bool PaiObjectRecycler::IsExist(PaiObject *pChild)
|
|
{
|
|
return m_DeletedObjects.contains(pChild);
|
|
}
|
|
|
|
void PaiObjectRecycler::Clear()
|
|
{
|
|
qDeleteAll(m_DeletedObjects);
|
|
m_DeletedObjects.clear();
|
|
}
|
|
|
|
int PaiObjectRecycler::GetObjectsCount() const
|
|
{
|
|
return m_DeletedObjects.count();
|
|
}
|