summaryrefslogtreecommitdiff
path: root/indra/llcommon/metaclass.cpp
blob: 29ad20e6b6474eb7c7817d11156776afaa291d73 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/** 
 * @file metaclass.cpp
 * @author Babbage
 * @date 2006-05-15
 * @brief Implementation of LLMetaClass
 *
 * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#include "metaclass.h"
#include "metaproperty.h"
#include "reflective.h"

LLMetaClass::LLMetaClass()
{
}

//virtual 
LLMetaClass::~LLMetaClass()
{
}

const LLMetaProperty* LLMetaClass::findProperty(const std::string& name) const
{
	PropertyIterator iter = mProperties.find(name);
	if(iter == mProperties.end())
	{
		return NULL;
	}
	return (*iter).second;
}

void LLMetaClass::addProperty(const LLMetaProperty* property)
{
	mProperties.insert(std::make_pair(property->getName(), property));
}

U32 LLMetaClass::getPropertyCount() const
{
	return mProperties.size();
}

LLMetaClass::PropertyIterator LLMetaClass::beginProperties() const
{
	return mProperties.begin();
}

LLMetaClass::PropertyIterator LLMetaClass::endProperties() const
{
	return mProperties.end();
}

bool LLMetaClass::isInstance(const LLReflective* object) const
{
	// TODO: Babbage: Search through super classes of objects MetaClass.
	const LLMetaClass* object_meta_class = &(object->getMetaClass());
	return (object_meta_class == this);
}