2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/public-api/object/property-array.h>
22 #include <dali/public-api/common/vector-wrapper.h>
29 }; // unnamed namespace
31 struct Property::Array::Impl
33 typedef std::vector<Value> Array;
38 Property::Array::Array()
43 Property::Array::Array( const Property::Array& other )
46 mImpl->mArray = other.mImpl->mArray;
49 Property::Array::~Array()
54 Property::Array::SizeType Property::Array::Count() const
56 return mImpl->mArray.size();
59 void Property::Array::PushBack( const Value& value )
61 mImpl->mArray.push_back( value );
64 void Property::Array::Clear()
66 mImpl->mArray.clear();
69 void Property::Array::Reserve( SizeType size )
71 mImpl->mArray.reserve(size);
74 void Property::Array::Resize( SizeType size )
76 mImpl->mArray.resize(size);
79 Property::Array::SizeType Property::Array::Capacity()
81 return mImpl->mArray.capacity();
84 const Property::Value& Property::Array::operator[]( SizeType index ) const
86 return mImpl->mArray[ index ];
89 Property::Value& Property::Array::operator[]( SizeType index )
91 return mImpl->mArray[ index ];
94 Property::Array& Property::Array::operator=( const Property::Array& other )
100 mImpl->mArray = other.mImpl->mArray;
105 std::ostream& operator<<( std::ostream& stream, const Property::Array& array )
107 stream << "Array(" << array.Count() << ") = [";
108 for( unsigned int i=0; i<array.Count(); ++i )
114 stream << array.GetElementAt(i);