-#ifndef __DALI_PROPERTY_INPUT_INDEXER_H__
-#define __DALI_PROPERTY_INPUT_INDEXER_H__
+#ifndef DALI_PROPERTY_INPUT_INDEXER_H
+#define DALI_PROPERTY_INPUT_INDEXER_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-
namespace Internal
{
-
/**
* Helper object to map public-api PropertyInput methods to internal
* PropertyInputImpl methods (which require the current buffer index).
*/
-template < typename AccessorType >
+template<typename AccessorType>
class PropertyInputIndexer : public PropertyInput
{
public:
-
/**
* Create an indexer object.
* @param[in] bufferIndex The current buffer index.
* @param[in] input The internal property input.
*/
- PropertyInputIndexer( BufferIndex bufferIndex, const AccessorType* input )
- : mBufferIndex( bufferIndex ),
- mInput( input )
+ PropertyInputIndexer(BufferIndex bufferIndex, const AccessorType* input)
+ : mBufferIndex(bufferIndex),
+ mInput(input)
{
}
/**
* Copy constructor
*/
- PropertyInputIndexer( const PropertyInputIndexer& other )
- : mBufferIndex( other.mBufferIndex ),
- mInput( other.mInput )
+ PropertyInputIndexer(const PropertyInputIndexer& other)
+ : mBufferIndex(other.mBufferIndex),
+ mInput(other.mInput)
{
}
/**
* Assignment operator
*/
- PropertyInputIndexer& operator=( const PropertyInputIndexer& other )
+ PropertyInputIndexer& operator=(const PropertyInputIndexer& other)
{
- mBufferIndex = other.mBufferIndex;
- mInput = other.mInput;
+ if(this != &other)
+ {
+ mBufferIndex = other.mBufferIndex;
+ mInput = other.mInput;
+ }
return *this;
}
/**
* Virtual Destructor
*/
- virtual ~PropertyInputIndexer()
- {
- }
+ ~PropertyInputIndexer() override = default;
/**
* @copydoc Dali::Internal::PropertyInput::GetType()
*/
- virtual Property::Type GetType() const
+ Property::Type GetType() const override
{
return mInput->GetType();
}
/**
* @copydoc Dali::Internal::PropertyInput::GetBoolean()
*/
- virtual const bool& GetBoolean() const
+ const bool& GetBoolean() const override
{
- return mInput->GetConstraintInputBoolean( mBufferIndex );
+ return mInput->GetConstraintInputBoolean(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetInteger()
*/
- virtual const int& GetInteger() const
+ const int& GetInteger() const override
{
- return mInput->GetConstraintInputInteger( mBufferIndex );
+ return mInput->GetConstraintInputInteger(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetFloat()
*/
- virtual const float& GetFloat() const
+ const float& GetFloat() const override
{
- return mInput->GetConstraintInputFloat( mBufferIndex );
+ return mInput->GetConstraintInputFloat(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetVector2()
*/
- virtual const Vector2& GetVector2() const
+ const Vector2& GetVector2() const override
{
- return mInput->GetConstraintInputVector2( mBufferIndex );
+ return mInput->GetConstraintInputVector2(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetVector3()
*/
- virtual const Vector3& GetVector3() const
+ const Vector3& GetVector3() const override
{
- return mInput->GetConstraintInputVector3( mBufferIndex );
+ return mInput->GetConstraintInputVector3(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetVector4()
*/
- virtual const Vector4& GetVector4() const
+ const Vector4& GetVector4() const override
{
- return mInput->GetConstraintInputVector4( mBufferIndex );
+ return mInput->GetConstraintInputVector4(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetMatrix3()
*/
- virtual const Matrix3& GetMatrix3() const
+ const Matrix3& GetMatrix3() const override
{
- return mInput->GetConstraintInputMatrix3( mBufferIndex );
+ return mInput->GetConstraintInputMatrix3(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::GetMatrix()
*/
- virtual const Matrix& GetMatrix() const
+ const Matrix& GetMatrix() const override
{
- return mInput->GetConstraintInputMatrix( mBufferIndex );
+ return mInput->GetConstraintInputMatrix(mBufferIndex);
}
/**
* @copydoc Dali::Internal::PropertyInput::Quaternion()
*/
- virtual const Quaternion& GetQuaternion() const
+ const Quaternion& GetQuaternion() const override
{
- return mInput->GetConstraintInputQuaternion( mBufferIndex );
+ return mInput->GetConstraintInputQuaternion(mBufferIndex);
}
public:
-
- unsigned int mBufferIndex;
+ BufferIndex mBufferIndex;
const AccessorType* mInput;
};
} // namespace Dali
-#endif // __DALI_PROPERTY_INPUT_INDEXER_H__
+#endif // DALI_PROPERTY_INPUT_INDEXER_H