1 #ifndef DALI_PROPERTY_INPUT_INDEXER_H
2 #define DALI_PROPERTY_INPUT_INDEXER_H
5 * Copyright (c) 2019 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 )
66 mBufferIndex = other.mBufferIndex;
67 mInput = other.mInput;
76 virtual ~PropertyInputIndexer()
81 * @copydoc Dali::Internal::PropertyInput::GetType()
83 virtual Property::Type GetType() const
85 return mInput->GetType();
89 * @copydoc Dali::Internal::PropertyInput::GetBoolean()
91 virtual const bool& GetBoolean() const
93 return mInput->GetConstraintInputBoolean( mBufferIndex );
97 * @copydoc Dali::Internal::PropertyInput::GetInteger()
99 virtual const int& GetInteger() const
101 return mInput->GetConstraintInputInteger( mBufferIndex );
105 * @copydoc Dali::Internal::PropertyInput::GetFloat()
107 virtual const float& GetFloat() const
109 return mInput->GetConstraintInputFloat( mBufferIndex );
113 * @copydoc Dali::Internal::PropertyInput::GetVector2()
115 virtual const Vector2& GetVector2() const
117 return mInput->GetConstraintInputVector2( mBufferIndex );
121 * @copydoc Dali::Internal::PropertyInput::GetVector3()
123 virtual const Vector3& GetVector3() const
125 return mInput->GetConstraintInputVector3( mBufferIndex );
129 * @copydoc Dali::Internal::PropertyInput::GetVector4()
131 virtual const Vector4& GetVector4() const
133 return mInput->GetConstraintInputVector4( mBufferIndex );
137 * @copydoc Dali::Internal::PropertyInput::GetMatrix3()
139 virtual const Matrix3& GetMatrix3() const
141 return mInput->GetConstraintInputMatrix3( mBufferIndex );
145 * @copydoc Dali::Internal::PropertyInput::GetMatrix()
147 virtual const Matrix& GetMatrix() const
149 return mInput->GetConstraintInputMatrix( mBufferIndex );
153 * @copydoc Dali::Internal::PropertyInput::Quaternion()
155 virtual const Quaternion& GetQuaternion() const
157 return mInput->GetConstraintInputQuaternion( mBufferIndex );
162 BufferIndex mBufferIndex;
163 const AccessorType* mInput;
166 } // namespace Internal
170 #endif // DALI_PROPERTY_INPUT_INDEXER_H