2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiEffects_RendererEngineModelPropertyHolderMaterial.cpp
20 * @brief This file contains implementation of PropertyHolderMaterial class
24 #include <renderer/engine-model/FUiEffects_RendererEngineModelPropertyHolderMaterial.h>
25 #include <FUiEffects_RendererLog.h>
27 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
30 PropertyHolderMaterial::PropertyHolderMaterial(void)
34 PropertyHolderMaterial::~PropertyHolderMaterial(void)
39 PropertyHolderMaterial::GetProperty(const std::string& name)
41 const PropertyListSizeType len = _properties.size();
42 for (PropertyListSizeType i = 0; len > i; ++i)
44 if (name == _properties[i].first)
46 return _properties[i].second;
53 PropertyHolderMaterial::GetProperty(PropertyListSizeType index)
55 if (_properties.size() > index)
57 return _properties[index].second;
63 PropertyHolderMaterial::GetNumProperties(void)
65 return _properties.size();
69 PropertyHolderMaterial::AddProperty(const std::string& name, PropertyPtr pProperty)
71 const PropertyListSizeType len = _properties.size();
72 for (PropertyListSizeType i = 0; len > i; ++i)
74 if (name == _properties[i].first)
76 _properties[i].second = pProperty;
80 _properties.push_back(std::make_pair(name, pProperty));
85 PropertyHolderMaterial::RemoveProperty(const std::string& name)
87 const PropertyListSizeType len = _properties.size();
88 for (PropertyListSizeType i = 0; len > i; ++i)
90 if (name == _properties[i].first)
92 _properties[i] = _properties[len - 1];
93 _properties.resize(len - 1);
101 PropertyHolderMaterial::RemoveProperty(PropertyListSizeType index)
103 const PropertyListSizeType len = _properties.size();
108 _properties[index] = _properties[len - 1];
109 _properties.resize(len - 1);
113 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel