summaryrefslogtreecommitdiff
path: root/src/T2DLL/CPluginInfoArray.cpp
blob: ec38e3d3f8f0042e1b4cd1317c012a336cf10105 (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
33
#include "CPluginInfo.h"
#include "CPluginInfoArray.h"
#include "CPluginInfoComparator.h"

CPluginInfoArray::CPluginInfoArray(BOOL ownsPluginInfo)
	: LArray(sizeof(CPluginInfo *), CPluginInfoComparator::GetComparator(), true)
{
	mOwnsComparator = false;
	mOwnsPluginInfo = ownsPluginInfo;
}

/*virtual*/ CPluginInfoArray::~CPluginInfoArray() {
	if (mOwnsPluginInfo) {
		CPluginInfo *info;
		LArrayIterator iter(*this);

		while (iter.Next(&info))
			delete info;
	}
}

int CPluginInfoArray::GetUsedCount() {
	CPluginInfo *info;
	int numPlugins = 0;
	LArrayIterator iter(*this);

	while (iter.Next(&info)) {
		if (info->IsUsed())
			numPlugins++;
	}

	return numPlugins;
}