1#include "MemoryContainer.h"
5MemoryContainer::MemoryContainer() =
default;
8MemoryContainer::~MemoryContainer() =
default;
10void MemoryContainer::Register(
SObject*
object) {
11 const auto& prevSize = m_hashContainer.size();
12 m_hashContainer.insert(object->GetHash());
13 if(prevSize - m_hashContainer.size() == 0)
throw -1;
14 SContainerList::Register(
object);
17void MemoryContainer::Remove(
SObject*
object) {
18 m_hashContainer.erase(object->GetHash());
19 SContainerList::Remove(
object);
22bool MemoryContainer::HasHash(
const std::string& hash)
const {
23 return m_hashContainer.count(hash) > 0;
26void MemoryContainer::ChangeHash(
const std::string& srcHash,
const std::string& dstHash) {
27 m_hashContainer.erase(srcHash);
28 const auto& prevSize = m_hashContainer.size();
29 m_hashContainer.insert(dstHash);