/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
END_TEST;
}
+int UtcDaliVectorMoveConstructor(void)
+{
+ Vector<Vector3> movedFrom;
+ movedFrom.PushBack(Vector3::ONE);
+ movedFrom.PushBack(Vector3::NEGATIVE_YAXIS);
+ movedFrom.PushBack(Vector3::NEGATIVE_ZAXIS);
+
+ Vector<Vector3> movedTo(std::move(movedFrom));
+ DALI_TEST_EQUALS( movedTo.Size(), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS( movedFrom.Size(), 0u, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliVectorMoveAssignment(void)
+{
+ Vector<Vector3> movedFrom;
+ movedFrom.PushBack(Vector3::ONE);
+ movedFrom.PushBack(Vector3::NEGATIVE_YAXIS);
+ movedFrom.PushBack(Vector3::NEGATIVE_ZAXIS);
+
+ Vector<Vector3> movedTo;
+ DALI_TEST_EQUALS(movedTo.Size(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(movedFrom.Size(), 3u, TEST_LOCATION);
+
+ movedTo = std::move(movedFrom);
+ DALI_TEST_EQUALS(movedTo.Size(), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS(movedFrom.Size(), 0u, TEST_LOCATION);
+
+ END_TEST;
+}
/*
* this does not compile at the moment
#define DALI_OWNER_CONTAINER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
VectorBase::Release();
}
+ // Not copyable or movable
+ OwnerContainer( const OwnerContainer& ) = delete; ///< Deleted copy constructor
+ OwnerContainer( OwnerContainer&& ) = delete; ///< Deleted move constructor
+ OwnerContainer& operator=( const OwnerContainer& ) = delete; ///< Deleted copy assignment operator
+ OwnerContainer& operator=( OwnerContainer&& ) = delete; ///< Deleted move assignment operator
+
/**
* Test whether the container is empty.
* @return True if the container is empty
private:
- // Undefined copy constructor.
- OwnerContainer( const OwnerContainer& );
- // Undefined assignment operator.
- OwnerContainer& operator=( const OwnerContainer& );
-
/**
* @brief delete the contents of the pointer
* Function provided to allow classes to provide a custom destructor through template specialisation
#define REF_COUNTED_DALI_VECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
return mVector;
}
+ // Not copyable or movable
+ RefCountedVector( const RefCountedVector& ) = delete; ///< Deleted copy constructor
+ RefCountedVector( RefCountedVector&& ) = delete; ///< Deleted move constructor
+ RefCountedVector& operator=( const RefCountedVector& ) = delete; ///< Deleted copy assignment operator
+ RefCountedVector& operator=( RefCountedVector&& ) = delete; ///< Deleted move assignment operator
+
protected:
virtual ~RefCountedVector()
{
}
private:
- // Disable copy-constructing and copying:
- RefCountedVector(const RefCountedVector &); ///< Undefined
- RefCountedVector & operator = (const RefCountedVector &); ///< Undefined
Vector< T > mVector; ///< The vector of data
};
#define DALI_THREAD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
static void InternalThreadEntryFunc( Thread& This );
- // Undefined
- Thread( const Thread& );
- // Undefined
- const Thread& operator=( const Thread& );
+ // Not copyable or movable
+ Thread( const Thread& ) = delete; ///< Deleted copy constructor
+ Thread( Thread&& ) = delete; ///< Deleted move constructor
+ Thread& operator=( const Thread& ) = delete; ///< Deleted copy assignment operator
+ Thread& operator=( Thread&& ) = delete; ///< Deleted move assignment operator
private:
}
};
- /**
- * @brief Undefined copy constructor.
- * @SINCE_1_0.0
- */
- Function( const Function& );
-
- /**
- * @brief Undefined assignment operator.
- * @SINCE_1_0.0
- */
- Function& operator=( const Function& );
+ Function( const Function& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ Function( Function&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ Function& operator=( const Function& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ Function& operator=( Function&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
/**
* @brief Constructor used when copying the stored object.
#define DALI_VECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
// not copyable as it does not know the size of elements
- VectorBase( const VectorBase& ); ///< Undefined @SINCE_1_0.0
- VectorBase& operator=( const VectorBase& ); ///< Undefined @SINCE_1_0.0
+ VectorBase( const VectorBase& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ VectorBase& operator=( const VectorBase& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+
+ // not movable as this is handled by deriving classes
+ VectorBase( VectorBase&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ VectorBase& operator=( VectorBase&& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_9.25
protected: // Data
*/
Vector( const Vector& vector )
{
- // reuse assignment
+ // reuse copy assignment
operator=( vector );
}
/**
+ * @brief Default move constructor.
+ *
+ * @SINCE_1_9.25
+ * @param[in] vector Vector to move
+ */
+ Vector( Vector&& vector )
+ {
+ // reuse move assignment
+ operator=( std::move( vector ) );
+ }
+
+ /**
* @brief Assignment operator.
*
* @SINCE_1_0.0
}
/**
+ * @brief Default move assignment operator.
+ *
+ * @SINCE_1_9.25
+ * @param[in] vector Vector to move
+ */
+ Vector& operator=( Vector&& vector )
+ {
+ if( this != &vector )
+ {
+ if( VectorBase::mData )
+ {
+ Release();
+ }
+ VectorBase::mData = vector.mData;
+ vector.mData = nullptr;
+ }
+ return *this;
+ }
+
+ /**
* @brief Iterator to the beginning of the data.
* @SINCE_1_0.0
* @return Iterator to the beginning of the data
*/
void UnregisterObject();
-private:
-
- // Not implemented
- DALI_INTERNAL BaseObject(const BaseObject& rhs);
+ // Not copyable or movable
- // Not implemented
- DALI_INTERNAL BaseObject& operator=(const BaseObject& rhs);
+ BaseObject(const BaseObject& rhs) = delete; ///< Deleted copy constructor
+ BaseObject(BaseObject&& rhs) = delete; ///< Deleted move constructor
+ BaseObject& operator=(const BaseObject& rhs) = delete; ///< Deleted copy assignment operator
+ BaseObject& operator=(BaseObject&& rhs) = delete; ///< Deleted move assignment operator
public:
#define DALI_BASE_SIGNAL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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 CleanupConnections();
- BaseSignal( const BaseSignal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- BaseSignal& operator=( const BaseSignal& ); ///< undefined assignment operator @SINCE_1_0.0
+ BaseSignal( const BaseSignal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ BaseSignal( BaseSignal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ BaseSignal& operator=( const BaseSignal& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ BaseSignal& operator=( BaseSignal&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
private:
#define DALI_CONNECTION_TRACKER_INTERFACE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
- ConnectionTrackerInterface( const ConnectionTrackerInterface& ); ///< undefined copy constructor @SINCE_1_0.0
- ConnectionTrackerInterface& operator=( const ConnectionTrackerInterface& ); ///< undefined assignment operator @SINCE_1_0.0
+ ConnectionTrackerInterface( const ConnectionTrackerInterface& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ ConnectionTrackerInterface( ConnectionTrackerInterface&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ ConnectionTrackerInterface& operator=( const ConnectionTrackerInterface& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ ConnectionTrackerInterface& operator=( ConnectionTrackerInterface&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
};
/**
#define DALI_CONNECTION_TRACKER_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
- ConnectionTracker( const ConnectionTracker& ); ///< undefined copy constructor @SINCE_1_0.0
- ConnectionTracker& operator=( const ConnectionTracker& ); ///< undefined assignment operator @SINCE_1_0.0
+ ConnectionTracker( const ConnectionTracker& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ ConnectionTracker( ConnectionTracker&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ ConnectionTracker& operator=( const ConnectionTracker& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ ConnectionTracker& operator=( ConnectionTracker&& ) = delete;///< Deleted move assignment operator. @SINCE_1_9.25
private:
#define DALI_SIGNAL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
private:
- Signal( const Signal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0
- Signal& operator=( const Signal& ); ///< undefined assignment operator @SINCE_1_0.0
+ Signal( const Signal& ) = delete; ///< Deleted copy constructor, signals don't support copying. @SINCE_1_0.0
+ Signal( Signal&& ) = delete; ///< Deleted move constructor, signals don't support moving. @SINCE_1_9.25
+ Signal& operator=( const Signal& ) = delete; ///< Deleted copy assignment operator @SINCE_1_0.0
+ Signal& operator=( Signal&& ) = delete; ///< Deleted move assignment operator @SINCE_1_9.25
private:
#define DALI_SIGNAL_SLOT_CONNECTIONS_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
- SlotConnection( const SlotConnection& ); ///< undefined copy constructor @SINCE_1_0.0
- SlotConnection& operator=( const SlotConnection& ); ///< undefined assignment operator @SINCE_1_0.0
+ SlotConnection( const SlotConnection& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ SlotConnection( SlotConnection&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ SlotConnection& operator=( const SlotConnection& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ SlotConnection& operator=( SlotConnection&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
private:
private:
- SignalConnection( const SignalConnection& ); ///< undefined copy constructor @SINCE_1_0.0
- SignalConnection& operator=( const SignalConnection& ); ///< undefined assignment operator @SINCE_1_0.0
+ SignalConnection( const SignalConnection& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ SignalConnection( SignalConnection&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ SignalConnection& operator=( const SignalConnection& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ SignalConnection& operator=( SignalConnection&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
private:
#define DALI_SLOT_DELEGATE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
private:
- SlotDelegate( const SlotDelegate& ); ///< undefined copy constructor @SINCE_1_0.0
- SlotDelegate& operator=( const SlotDelegate& ); ///< undefined assignment operator @SINCE_1_0.0
+ SlotDelegate( const SlotDelegate& ) = delete; ///< Deleted copy constructor. @SINCE_1_0.0
+ SlotDelegate( SlotDelegate&& ) = delete; ///< Deleted move constructor. @SINCE_1_9.25
+ SlotDelegate& operator=( const SlotDelegate& ) = delete; ///< Deleted copy assignment operator. @SINCE_1_0.0
+ SlotDelegate& operator=( SlotDelegate&& ) = delete; ///< Deleted move assignment operator. @SINCE_1_9.25
private: