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/public-api/object/property-types.h>
23 #include <dali/internal/event/common/property-input-impl.h>
32 * Helper object to map public-api PropertyInput methods to internal
33 * PropertyInputImpl methods (which require the current buffer index).
35 template < typename AccessorType >
36 class PropertyInputIndexer : public PropertyInput
41 * Create an indexer object.
42 * @param[in] bufferIndex The current buffer index.
43 * @param[in] input The internal property input.
45 PropertyInputIndexer( BufferIndex bufferIndex, const AccessorType* input )
46 : mBufferIndex( bufferIndex ),
52 * @copydoc Dali::Internal::PropertyInput::GetType()
54 virtual Property::Type GetType() const
56 return mInput->GetType();
60 * @copydoc Dali::Internal::PropertyInput::GetBoolean()
62 virtual const bool& GetBoolean() const
64 return mInput->GetConstraintInputBoolean( mBufferIndex );
68 * @copydoc Dali::Internal::PropertyInput::GetFloat()
70 virtual const float& GetFloat() const
72 return mInput->GetConstraintInputFloat( mBufferIndex );
76 * @copydoc Dali::Internal::PropertyInput::GetInteger()
78 virtual const int& GetInteger() const
80 return mInput->GetConstraintInputInteger( mBufferIndex );
84 * @copydoc Dali::Internal::PropertyInput::GetVector2()
86 virtual const Vector2& GetVector2() const
88 return mInput->GetConstraintInputVector2( mBufferIndex );
92 * @copydoc Dali::Internal::PropertyInput::GetVector3()
94 virtual const Vector3& GetVector3() const
96 return mInput->GetConstraintInputVector3( mBufferIndex );
100 * @copydoc Dali::Internal::PropertyInput::GetVector4()
102 virtual const Vector4& GetVector4() const
104 return mInput->GetConstraintInputVector4( mBufferIndex );
108 * @copydoc Dali::Internal::PropertyInput::GetMatrix3()
110 virtual const Matrix3& GetMatrix3() const
112 return mInput->GetConstraintInputMatrix3( mBufferIndex );
116 * @copydoc Dali::Internal::PropertyInput::GetMatrix()
118 virtual const Matrix& GetMatrix() const
120 return mInput->GetConstraintInputMatrix( mBufferIndex );
124 * @copydoc Dali::Internal::PropertyInput::Quaternion()
126 virtual const Quaternion& GetQuaternion() const
128 return mInput->GetConstraintInputQuaternion( mBufferIndex );
133 unsigned int mBufferIndex;
134 const AccessorType* mInput;
137 } // namespace Internal
141 #endif // __DALI_PROPERTY_INPUT_INDEXER_H__