summaryrefslogtreecommitdiff
path: root/src/T2DLL/CPluginInfoArray.cpp
blob: a22a76a5c6598b7000baa54ef508fbfd832adb37 (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
34
#include "StdAfx.h"
#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;
}