summaryrefslogtreecommitdiff
path: root/src/base.cpp
blob: 82c9ae8b468a51efdcbad4e94a9c045628bd0047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "services.h"
#include "modules.h"

Base::Base()
{
}

Base::~Base()
{
	for (std::set<dynamic_reference_base *>::iterator it = this->References.begin(), it_end = this->References.end(); it != it_end; ++it)
	{
		(*it)->Invalidate();
	}
}

void Base::AddReference(dynamic_reference_base *r)
{
	this->References.insert(r);
}

void Base::DelReference(dynamic_reference_base *r)
{
	this->References.erase(r);
}

void Base::operator delete(void *ptr)
{
	Base *b = static_cast<Base *>(ptr);
	FOREACH_MOD(I_OnDeleteObject, OnDeleteObject(b));
	::operator delete(b);
}