Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / actors / custom-actor.cpp
index e5be79f..99cf536 100644 (file)
@@ -1,33 +1,31 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/public-api/actors/custom-actor.h>
 
-#include <dali/public-api/object/type-registry.h>
-
 // INTERNAL INCLUDES
 #include <dali/internal/event/actors/custom-actor-internal.h>
+#include <dali/public-api/object/type-registry.h>
 
 namespace Dali
 {
-
 namespace
 {
-
 using namespace Dali;
 
 BaseHandle Create()
@@ -36,22 +34,26 @@ BaseHandle Create()
   return BaseHandle();
 }
 
-TypeRegistration mType( typeid(Dali::CustomActor), typeid(Dali::Actor), Create );
+TypeRegistration mType(typeid(Dali::CustomActor), typeid(Dali::Actor), Create);
 
-}
+} // namespace
 
-CustomActor::CustomActor()
-{
-}
+CustomActor::CustomActor() = default;
 
-CustomActor CustomActor::DownCast( BaseHandle handle )
+CustomActor CustomActor::DownCast(BaseHandle handle)
 {
-  return CustomActor( dynamic_cast<Dali::Internal::CustomActor*>(handle.GetObjectPtr()) );
+  return CustomActor(dynamic_cast<Dali::Internal::CustomActor*>(handle.GetObjectPtr()));
 }
 
-CustomActor::~CustomActor()
-{
-}
+CustomActor::~CustomActor() = default;
+
+CustomActor::CustomActor(const CustomActor& copy) = default;
+
+CustomActor& CustomActor::operator=(const CustomActor& rhs) = default;
+
+CustomActor::CustomActor(CustomActor&& rhs) noexcept = default;
+
+CustomActor& CustomActor::operator=(CustomActor&& rhs) noexcept = default;
 
 CustomActorImpl& CustomActor::GetImplementation()
 {
@@ -83,7 +85,7 @@ CustomActor::CustomActor(Internal::CustomActor* internal)
   // Without this check, the actor will be deleted a second time, when the handle is disposed of
   // causing a crash.
 
-  if (internal)
+  if(internal)
   {
     DALI_ASSERT_ALWAYS(internal->ReferenceCount() != 1 && "Are you trying to use CustomActorImpl::Self() inside a CustomActorImpl destructor?");
   }