1 #ifndef __DALI_PROPERTY_INPUT_INDEXER_H__
2 #define __DALI_PROPERTY_INPUT_INDEXER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/event/common/property-input-impl.h>
31 * Helper object to map public-api PropertyInput methods to internal
32 * PropertyInputImpl methods (which require the current buffer index).
34 template < typename AccessorType >
35 class PropertyInputIndexer : public PropertyInput
40 * Create an indexer object.
41 * @param[in] bufferIndex The current buffer index.
42 * @param[in] input The internal property input.
44 PropertyInputIndexer( BufferIndex bufferIndex, const AccessorType* input )
45 : mBufferIndex( bufferIndex ),
53 PropertyInputIndexer( const PropertyInputIndexer& other )
54 : mBufferIndex( other.mBufferIndex ),
55 mInput( other.mInput )
62 PropertyInputIndexer& operator=( const PropertyInputIndexer& other )
64 mBufferIndex = other.mBufferIndex;
65 mInput = other.mInput;
73 virtual ~PropertyInputIndexer()
78 * @copydoc Dali::Internal::PropertyInput::GetType()
80 virtual Property::Type GetType() const
82 return mInput->GetType();
86 * @copydoc Dali::Internal::PropertyInput::GetBoolean()
88 virtual const bool& GetBoolean() const
90 return mInput->GetConstraintInputBoolean( mBufferIndex );
94 * @copydoc Dali::Internal::PropertyInput::GetInteger()
96 virtual const int& GetInteger() const
98 return mInput->GetConstraintInputInteger( mBufferIndex );
102 * @copydoc Dali::Internal::PropertyInput::GetUnsignedInteger()
104 virtual const unsigned int& GetUnsignedInteger() const
106 return mInput->GetConstraintInputUnsignedInteger( mBufferIndex );
110 * @copydoc Dali::Internal::PropertyInput::GetFloat()
112 virtual const float& GetFloat() const
114 return mInput->GetConstraintInputFloat( mBufferIndex );
118 * @copydoc Dali::Internal::PropertyInput::GetVector2()
120 virtual const Vector2& GetVector2() const
122 return mInput->GetConstraintInputVector2( mBufferIndex );
126 * @copydoc Dali::Internal::PropertyInput::GetVector3()
128 virtual const Vector3& GetVector3() const
130 return mInput->GetConstraintInputVector3( mBufferIndex );
134 * @copydoc Dali::Internal::PropertyInput::GetVector4()
136 virtual const Vector4& GetVector4() const
138 return mInput->GetConstraintInputVector4( mBufferIndex );
142 * @copydoc Dali::Internal::PropertyInput::GetMatrix3()
144 virtual const Matrix3& GetMatrix3() const
146 return mInput->GetConstraintInputMatrix3( mBufferIndex );
150 * @copydoc Dali::Internal::PropertyInput::GetMatrix()
152 virtual const Matrix& GetMatrix() const
154 return mInput->GetConstraintInputMatrix( mBufferIndex );
158 * @copydoc Dali::Internal::PropertyInput::Quaternion()
160 virtual const Quaternion& GetQuaternion() const
162 return mInput->GetConstraintInputQuaternion( mBufferIndex );
167 unsigned int mBufferIndex;
168 const AccessorType* mInput;
171 } // namespace Internal
175 #endif // __DALI_PROPERTY_INPUT_INDEXER_H__