END_TEST;
}
+
+int UtcDaliIndexedConstStringMapMoveTest(void)
+{
+ IndexedConstStringMap<std::string> indexedMap;
+
+ std::string expectString = "wahaha";
+
+ std::string p = expectString; // copy string;
+ DALI_TEST_CHECK(indexedMap.Register(ConstString("111"), p));
+ DALI_TEST_CHECK(!indexedMap.Register(ConstString("111"), p));
+
+ DALI_TEST_EQUALS(p, expectString, TEST_LOCATION);
+ DALI_TEST_EQUALS(indexedMap[ConstString("111")], expectString, TEST_LOCATION);
+
+ // Change expect string
+ expectString = "wehihi";
+ p = expectString;
+
+ DALI_TEST_CHECK(indexedMap.Register(ConstString("222"), std::move(p)));
+
+ DALI_TEST_CHECK(p.empty()); // string moved.
+ DALI_TEST_EQUALS(indexedMap[ConstString("222")], expectString, TEST_LOCATION);
+
+ p = expectString;
+
+ DALI_TEST_CHECK(!indexedMap.Register(ConstString("222"), std::move(p)));
+
+ END_TEST;
+}
END_TEST;
}
+
+int UtcDaliIndexedIntegerMapMoveTest(void)
+{
+ IndexedIntegerMap<std::string> indexedMap;
+
+ std::string expectString = "wahaha";
+
+ std::string p = expectString; // copy string;
+ DALI_TEST_CHECK(indexedMap.Register(111, p));
+ DALI_TEST_CHECK(!indexedMap.Register(111, p));
+
+ DALI_TEST_EQUALS(p, expectString, TEST_LOCATION);
+ DALI_TEST_EQUALS(indexedMap[111], expectString, TEST_LOCATION);
+
+ // Change expect string
+ expectString = "wehihi";
+ p = expectString;
+
+ DALI_TEST_CHECK(indexedMap.Register(222, std::move(p)));
+
+ DALI_TEST_CHECK(p.empty()); // string moved.
+ DALI_TEST_EQUALS(indexedMap[222], expectString, TEST_LOCATION);
+
+ p = expectString;
+
+ DALI_TEST_CHECK(!indexedMap.Register(222, std::move(p)));
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliCameraActorMoveConstructor(void)
+{
+ TestApplication application;
+
+ CameraActor actor = CameraActor::New();
+ DALI_TEST_CHECK(actor);
+
+ int id = actor.GetProperty<int>(Actor::Property::ID);
+
+ CameraActor moved = std::move(actor);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(id, moved.GetProperty<int>(Actor::Property::ID), TEST_LOCATION);
+ DALI_TEST_CHECK(!actor);
+
+ END_TEST;
+}
+
+int UtcDaliCameraActorMoveAssignment(void)
+{
+ TestApplication application;
+
+ CameraActor actor = CameraActor::New();
+ DALI_TEST_CHECK(actor);
+
+ int id = actor.GetProperty<int>(Actor::Property::ID);
+
+ CameraActor moved;
+ moved = std::move(actor);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(id, moved.GetProperty<int>(Actor::Property::ID), TEST_LOCATION);
+ DALI_TEST_CHECK(!actor);
+
+ END_TEST;
+}
+
int UtcDaliCameraActorNewP(void)
{
TestApplication application;
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
DALI_TEST_PRINT_ASSERT(e);
tet_result(TET_FAIL);
}
+
+ GestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+
END_TEST;
}
DALI_TEST_PRINT_ASSERT(e);
tet_result(TET_FAIL);
}
+
+ GestureDetector moved;
+ moved = std::move(detector2);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(detector);
+ DALI_TEST_CHECK(!detector2);
END_TEST;
}
END_TEST;
}
+// test one writes, multiple read
+int UtcDaliLocklessBufferMultipleWrites02(void)
+{
+ Integration::LocklessBuffer buf(10);
+ unsigned char data[10];
+
+ for(unsigned char i = 0; i < 10; ++i)
+ {
+ data[i] = i;
+ }
+
+ // Write to a buffer
+ buf.Write(&data[0], 10);
+
+ if(ReadTest(buf, data, 10))
+ {
+ tet_result(TET_PASS);
+ }
+ else
+ {
+ tet_result(TET_FAIL);
+ }
+
+ // ReadTest one more time. for coverity.
+ if(ReadTest(buf, data, 10))
+ {
+ tet_result(TET_PASS);
+ }
+ else
+ {
+ tet_result(TET_FAIL);
+ }
+
+ for(unsigned char i = 0; i < 10; ++i)
+ {
+ data[i] = i + 4;
+ }
+
+ // No reads from buffer, so will overwrite contents of same buffer
+ buf.Write(&data[0], 10);
+
+ if(ReadTest(buf, data, 10))
+ {
+ tet_result(TET_PASS);
+ }
+ else
+ {
+ tet_result(TET_FAIL);
+ }
+
+ // ReadTest one more time. for coverity.
+ if(ReadTest(buf, data, 10))
+ {
+ tet_result(TET_PASS);
+ }
+ else
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
+
// Simple API test
int UtcDaliLocklessBufferGetSize01(void)
{
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
TestApplication application;
LongPressGestureDetector detector = LongPressGestureDetector::New();
- ;
LongPressGestureDetector copy(detector);
DALI_TEST_CHECK(detector);
LongPressGestureDetector detector;
detector = LongPressGestureDetector::New();
- ;
LongPressGestureDetector copy;
copy = detector;
END_TEST;
}
+int UtcDaliLongPressGestureDetectorMoveConstructorP(void)
+{
+ TestApplication application;
+
+ LongPressGestureDetector detector = LongPressGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ LongPressGestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
+int UtcDaliLongPressGestureDetectorMoveAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ LongPressGestureDetector detector;
+ detector = LongPressGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ LongPressGestureDetector moved;
+ moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
int UtcDaliLongPressGestureDetectorNew(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliPanGestureDetectorMoveConstructorP(void)
+{
+ TestApplication application;
+
+ PanGestureDetector detector = PanGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ PanGestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
+int UtcDaliPanGestureDetectorMoveAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ PanGestureDetector detector;
+ detector = PanGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ PanGestureDetector moved;
+ moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
// Negative test case for a method
int UtcDaliPanGestureDetectorNew(void)
{
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
TestApplication application;
PinchGestureDetector detector = PinchGestureDetector::New();
- ;
PinchGestureDetector copy(detector);
DALI_TEST_CHECK(detector);
TestApplication application;
PinchGestureDetector detector = PinchGestureDetector::New();
- ;
PinchGestureDetector assign;
assign = detector;
END_TEST;
}
+int UtcDaliPinchGestureDetectorMoveConstructorP(void)
+{
+ TestApplication application;
+
+ PinchGestureDetector detector = PinchGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ PinchGestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
+int UtcDaliPinchGestureDetectorMoveAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ PinchGestureDetector detector;
+ detector = PinchGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ PinchGestureDetector moved;
+ moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
int UtcDaliPinchGestureDetectorNew(void)
{
TestApplication application;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
TestApplication application;
RotationGestureDetector detector = RotationGestureDetector::New();
- ;
RotationGestureDetector copy(detector);
DALI_TEST_CHECK(detector);
TestApplication application;
RotationGestureDetector detector = RotationGestureDetector::New();
- ;
RotationGestureDetector assign;
assign = detector;
END_TEST;
}
+int UtcDaliRotationGestureDetectorMoveConstructorP(void)
+{
+ TestApplication application;
+
+ RotationGestureDetector detector = RotationGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ RotationGestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
+int UtcDaliRotationGestureDetectorMoveAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ RotationGestureDetector detector;
+ detector = RotationGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ RotationGestureDetector moved;
+ moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
int UtcDaliRotationGestureDetectorNew(void)
{
TestApplication application;
TestApplication application;
TapGestureDetector detector = TapGestureDetector::New();
- ;
TapGestureDetector assign;
assign = detector;
END_TEST;
}
+int UtcDaliRTapGestureDetectorMoveConstructorP(void)
+{
+ TestApplication application;
+
+ TapGestureDetector detector = TapGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ TapGestureDetector moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
+int UtcDaliTapGestureDetectorMoveAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ TapGestureDetector detector;
+ detector = TapGestureDetector::New();
+ DALI_TEST_CHECK(detector);
+
+ TapGestureDetector moved;
+ moved = std::move(detector);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_CHECK(!detector);
+ END_TEST;
+}
+
int UtcDaliTapGestureDetectorNew(void)
{
TestApplication application;
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
Stage& Stage::operator=(const Stage& rhs) = default;
+Stage::Stage(Stage&& handle) = default;
+
+Stage& Stage::operator=(Stage&& rhs) = default;
+
Stage::Stage(Internal::Stage* internal)
: BaseHandle(internal)
{
#define DALI_STAGE_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
Stage& operator=(const Stage& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @param[in] handle A reference to the moved handle
+ */
+ Stage(Stage&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Stage& operator=(Stage&& rhs);
+
// Containment
/**
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// This will set mState to 1 if readbuffer 0 was updated, 0 if readbuffer 1 was updated and fail if WRITING is set
if(__sync_bool_compare_and_swap(&mState,
static_cast<BufferState>(currentWriteBuf | UPDATED),
- static_cast<BufferState>(!currentWriteBuf)))
+ static_cast<BufferState>((currentWriteBuf == R1W0) ? R0W1 : R1W0)))
{
// swap successful
return mBuffer[currentWriteBuf];
// UPDATE bit wasn't set or WRITING bit was set in other thread
// swap failed, read from current readbuffer
- return mBuffer[!currentWriteBuf];
+ return mBuffer[(currentWriteBuf == R1W0) ? R0W1 : R1W0];
}
uint32_t LocklessBuffer::GetSize() const
Scene::Scene(const Scene& handle) = default;
+Scene& Scene::operator=(const Scene& rhs) = default;
+
+Scene::Scene(Scene&& handle) = default;
+
+Scene& Scene::operator=(Scene&& rhs) = default;
+
Scene::Scene(Internal::Scene* internal)
: BaseHandle(internal)
{
}
-Scene& Scene::operator=(const Scene& rhs) = default;
-
void Scene::Add(Actor actor)
{
GetImplementation(*this).Add(GetImplementation(actor));
Scene& operator=(const Scene& rhs);
/**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @param [in] handle A reference to the moved handle
+ */
+ Scene(Scene&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @param [in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Scene& operator=(Scene&& rhs);
+
+ /**
* @brief Adds a child Actor to the Scene.
*
* The child will be referenced.
}
/**
+ * @brief Register moved element by the ConstString key.
+ *
+ * @param[in] key The ConstString key that this container will hold. Duplicated key doesn't allow.
+ * @param[in] element The element pairwise with key.
+ * @return True if Register success. Otherwise, return false.
+ */
+ bool Register(const ConstString& key, ElementType&& element) override
+ {
+ // Let's make key as compareable type.
+ const char* comparableKey = key.GetCString();
+
+ // Find key with binary search.
+ // We can do binary search cause mCharPtrIndexList is sorted.
+ const auto& iter = std::lower_bound(mCharPtrIndexList.cbegin(), mCharPtrIndexList.cend(), std::pair<const char*, std::uint32_t>(comparableKey, 0u));
+
+ if(iter == mCharPtrIndexList.cend() || iter->first != comparableKey)
+ {
+ // Emplace new element back.
+ std::uint32_t newElementIndex = mKeyElementPool.size();
+ mKeyElementPool.emplace_back(key, std::move(element));
+
+ // Add new index into mCharPtrIndexList.
+ mCharPtrIndexList.insert(iter, std::pair<const char*, std::uint32_t>(comparableKey, newElementIndex));
+
+ // Append element as child
+ return true;
+ }
+ else
+ {
+ // Else, duplicated key!
+ return false;
+ }
+ }
+
+ /**
* @brief Get element by the ConstString key.
*
* @param[in] key The ConstString key that this container will hold.
}
/**
+ * @brief Register moved element by the integer key.
+ *
+ * @param[in] key The integer key that this container will hold. Duplicated key doesn't allow.
+ * @param[in] element The element pairwise with key.
+ * @return True if Register success. Otherwise, return false.
+ */
+ bool Register(const std::uint32_t& key, ElementType&& element) override
+ {
+ // Find key with binary search.
+ // We can do binary search cause mKeyIndexList is sorted.
+ const auto& iter = std::lower_bound(mKeyIndexList.cbegin(), mKeyIndexList.cend(), std::pair<std::uint32_t, std::uint32_t>(key, 0u));
+
+ if(iter == mKeyIndexList.cend() || iter->first != key)
+ {
+ // Emplace new element back.
+ std::uint32_t newElementIndex = mKeyElementPool.size();
+ mKeyElementPool.emplace_back(key, std::move(element));
+
+ // Add new index into mKeyIndexList list.
+ mKeyIndexList.insert(iter, std::pair<std::uint32_t, std::uint32_t>(key, newElementIndex));
+
+ // Append element as child
+ return true;
+ }
+ else
+ {
+ // Else, duplicated key!
+ return false;
+ }
+ }
+
+ /**
* @brief Get element by the integer key.
*
* @param[in] key The integer key that this container will hold.
virtual bool Register(const SearchKeyType& key, const ElementType& element) = 0;
/**
+ * @brief Register moved element by the key.
+ *
+ * @param[in] key The key that this container will hold. Duplicated key doesn't allow.
+ * @param[in] element The element pairwise with key.
+ * @return True if Register success. Otherwise, return false.
+ */
+ virtual bool Register(const SearchKeyType& key, ElementType&& element) = 0;
+
+ /**
* @brief Get element by the key.
*
* @param[in] key The key that this container will hold.
*/
IndexedMapBase()
{
- Clear();
}
/**
*/
virtual ~IndexedMapBase()
{
- mKeyElementPool.clear();
}
/**
}
protected:
- std::vector<KeyElementPairType> mKeyElementPool;
+ std::vector<KeyElementPairType> mKeyElementPool{};
};
} // namespace Internal
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
void RendererContainer::SetBlending(DevelBlendEquation::Type blendEquation)
{
- for(auto renderer : mRenderers)
+ for(const auto& renderer : mRenderers)
{
renderer->SetBlendEquation(static_cast<DevelBlendEquation::Type>(blendEquation));
}
#define DALI_INTERNAL_PROPERTY_METADATA_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* @note The base animatable property MUST be created before the component animatable property.
*/
AnimatablePropertyMetadata(Property::Index propertyIndex,
- const Property::Value& propertyValue,
+ Property::Value propertyValue,
const SceneGraph::PropertyBase* sceneGraphProperty)
- : PropertyMetadata(propertyValue, sceneGraphProperty, true),
+ : PropertyMetadata(std::move(propertyValue), sceneGraphProperty, true),
index(propertyIndex)
{
DALI_ASSERT_DEBUG(sceneGraphProperty && "Uninitialized scene-graph property");
}
else
{
- iter->second.setFunc(object, index, std::move(value));
+ iter->second.setFunc(object, index, value);
}
}
}
}
else
{
- iter->second.setFunc(object, iter->first, std::move(value));
+ iter->second.setFunc(object, iter->first, value);
}
}
else if(GetBaseType(mBaseType, mTypeRegistry, mBaseTypeName))
#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/scene-impl.h>
#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/render-tasks/render-task-list-impl.h>
#include <dali/internal/update/nodes/node.h>
#include <dali/internal/update/render-tasks/scene-graph-render-task.h>
#include <dali/public-api/common/dali-common.h>
#define DALI_INTERNAL_RENDER_TASK_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/internal/event/common/object-impl.h>
#include <dali/internal/event/events/actor-observer.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
#include <dali/internal/event/rendering/frame-buffer-impl.h>
namespace Dali
CameraActor::CameraActor(const CameraActor& copy) = default;
-CameraActor& CameraActor::operator=(const CameraActor& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+CameraActor& CameraActor::operator=(const CameraActor& rhs) = default;
+
+CameraActor::CameraActor(CameraActor&& rhs) = default;
+
+CameraActor& CameraActor::operator=(CameraActor&& rhs) = default;
void CameraActor::SetType(Dali::Camera::Type type)
{
CameraActor& operator=(const CameraActor& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the actor to move
+ */
+ CameraActor(CameraActor&& rhs);
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the actor to move
+ * @return A reference to this
+ */
+ CameraActor& operator=(CameraActor&& rhs);
+
+ /**
* @brief Sets the camera type.
* The default type is Dali::Camera::FREE_LOOK
* @SINCE_1_0.0
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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
{
-using Dali::Layer;
-
Layer::Layer() = default;
Layer Layer::New()
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
GestureDetector::GestureDetector(const GestureDetector& handle) = default;
-GestureDetector& GestureDetector::operator=(const GestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+GestureDetector& GestureDetector::operator=(const GestureDetector& rhs) = default;
+
+GestureDetector::GestureDetector(GestureDetector&& handle) = default;
+
+GestureDetector& GestureDetector::operator=(GestureDetector&& rhs) = default;
void GestureDetector::Attach(Actor actor)
{
#define DALI_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
GestureDetector& operator=(const GestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ GestureDetector(GestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ GestureDetector& operator=(GestureDetector&& rhs);
+
public: // Actor related
/**
* @brief Attaches an actor to the gesture.
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
LongPressGestureDetector::LongPressGestureDetector(const LongPressGestureDetector& handle) = default;
-LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGestureDetector& rhs) = default;
+
+LongPressGestureDetector::LongPressGestureDetector(LongPressGestureDetector&& handle) = default;
+
+LongPressGestureDetector& LongPressGestureDetector::operator=(LongPressGestureDetector&& rhs) = default;
void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
{
#define DALI_LONG_PRESS_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
LongPressGestureDetector& operator=(const LongPressGestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ LongPressGestureDetector(LongPressGestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ LongPressGestureDetector& operator=(LongPressGestureDetector&& rhs);
+
public: // Setters
/**
* @brief Sets the number of touches required.
PanGestureDetector::PanGestureDetector(const PanGestureDetector& handle) = default;
-PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs) = default;
+
+PanGestureDetector::PanGestureDetector(PanGestureDetector&& handle) = default;
+
+PanGestureDetector& PanGestureDetector::operator=(PanGestureDetector&& rhs) = default;
void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
{
*/
PanGestureDetector& operator=(const PanGestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ PanGestureDetector(PanGestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ PanGestureDetector& operator=(PanGestureDetector&& rhs);
+
public: // Setters
/**
* @brief This is the minimum number of touches required for the pan gesture to be detected.
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
PinchGestureDetector::PinchGestureDetector(const PinchGestureDetector& handle) = default;
-PinchGestureDetector& PinchGestureDetector::operator=(const PinchGestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+PinchGestureDetector& PinchGestureDetector::operator=(const PinchGestureDetector& rhs) = default;
+
+PinchGestureDetector::PinchGestureDetector(PinchGestureDetector&& handle) = default;
+
+PinchGestureDetector& PinchGestureDetector::operator=(PinchGestureDetector&& rhs) = default;
PinchGestureDetector::DetectedSignalType& PinchGestureDetector::DetectedSignal()
{
#define DALI_PINCH_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
PinchGestureDetector& operator=(const PinchGestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ PinchGestureDetector(PinchGestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ PinchGestureDetector& operator=(PinchGestureDetector&& rhs);
+
public: // Signals
/**
* @brief This signal is emitted when the pinch gesture is detected on the attached actor.
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
RotationGestureDetector::RotationGestureDetector(const RotationGestureDetector& handle) = default;
-RotationGestureDetector& RotationGestureDetector::operator=(const RotationGestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+RotationGestureDetector& RotationGestureDetector::operator=(const RotationGestureDetector& rhs) = default;
+
+RotationGestureDetector::RotationGestureDetector(RotationGestureDetector&& handle) = default;
+
+RotationGestureDetector& RotationGestureDetector::operator=(RotationGestureDetector&& rhs) = default;
RotationGestureDetector::DetectedSignalType& RotationGestureDetector::DetectedSignal()
{
#define DALI_ROTATION_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
RotationGestureDetector& operator=(const RotationGestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ RotationGestureDetector(RotationGestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ RotationGestureDetector& operator=(RotationGestureDetector&& rhs);
+
public: // Signals
/**
* @brief This signal is emitted when the rotation gesture is detected on the attached actor.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
TapGestureDetector::TapGestureDetector(const TapGestureDetector& handle) = default;
-TapGestureDetector& TapGestureDetector::operator=(const TapGestureDetector& rhs)
-{
- BaseHandle::operator=(rhs);
- return *this;
-}
+TapGestureDetector& TapGestureDetector::operator=(const TapGestureDetector& rhs) = default;
+
+TapGestureDetector::TapGestureDetector(TapGestureDetector&& handle) = default;
+
+TapGestureDetector& TapGestureDetector::operator=(TapGestureDetector&& rhs) = default;
void TapGestureDetector::SetMinimumTapsRequired(uint32_t taps)
{
#define DALI_TAP_GESTURE_DETECTOR_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
TapGestureDetector& operator=(const TapGestureDetector& rhs);
+ /**
+ * @brief This move constructor is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] handle A reference to the moved handle
+ */
+ TapGestureDetector(TapGestureDetector&& handle);
+
+ /**
+ * @brief This move assignment operator is required for (smart) pointer semantics.
+ *
+ * @SINCE_2_2.4
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ TapGestureDetector& operator=(TapGestureDetector&& rhs);
+
public: // Setters
/**
* @brief Sets the minimum number of taps required.
{
DALI_ASSERT_ALWAYS((index >= CHILD_PROPERTY_REGISTRATION_START_INDEX) && (index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX));
- Internal::TypeRegistry::Get()->RegisterChildProperty(std::move(registered), std::move(name), index, type);
+ Internal::TypeRegistry::Get()->RegisterChildProperty(registered, std::move(name), index, type);
}
} // namespace Dali