PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/metaproperty.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 56 lines | 21 code | 7 blank | 28 comment | 1 complexity | 42da13bb427475a96a490d169ae90acb MD5 | raw file
 1/** 
 2 * @file metaproperty.cpp
 3 * @author Babbage
 4 * @date 2006-05-15
 5 * @brief Implementation of LLMetaProperty.
 6 *
 7 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
 8 * Second Life Viewer Source Code
 9 * Copyright (C) 2010, Linden Research, Inc.
10 * 
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation;
14 * version 2.1 of the License only.
15 * 
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 * Lesser General Public License for more details.
20 * 
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 * 
25 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
26 * $/LicenseInfo$
27 */
28
29#include "linden_common.h" 
30
31#include "metaproperty.h"
32
33#include "metaclass.h"
34
35LLMetaProperty::LLMetaProperty(const std::string& name, const LLMetaClass& object_class) : 
36	mName(name), mObjectClass(object_class) 
37{
38}
39
40//virtual 
41LLMetaProperty::~LLMetaProperty()
42{
43}
44
45const LLMetaClass& LLMetaProperty::getObjectMetaClass() const
46{
47	return mObjectClass;
48}
49
50void LLMetaProperty::checkObjectClass(const LLReflective* object) const
51{
52	if(! mObjectClass.isInstance(object))
53	{
54		throw "class cast exception";
55	}
56}