projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git]
/
dali
/
public-api
/
object
/
weak-handle.cpp
diff --git
a/dali/public-api/object/weak-handle.cpp
b/dali/public-api/object/weak-handle.cpp
index
bec255d
..
4f5a3f1
100644
(file)
--- a/
dali/public-api/object/weak-handle.cpp
+++ b/
dali/public-api/object/weak-handle.cpp
@@
-23,25
+23,24
@@
namespace Dali
{
namespace Dali
{
-
struct WeakHandleBase::Impl : public BaseObject::Impl::Observer
{
// Construction
Impl()
struct WeakHandleBase::Impl : public BaseObject::Impl::Observer
{
// Construction
Impl()
- : mObject(
nullptr
)
+ : mObject(
nullptr
)
{
}
// Construction
{
}
// Construction
- Impl(
BaseHandle& handle
)
- : mObject(
nullptr
)
+ Impl(
BaseHandle& handle
)
+ : mObject(
nullptr
)
{
{
- if(
handle
)
+ if(
handle
)
{
{
- mObject = static_cast<Dali::BaseObject*>(
handle.GetObjectPtr()
);
- if(
mObject
)
+ mObject = static_cast<Dali::BaseObject*>(
handle.GetObjectPtr()
);
+ if(
mObject
)
{
{
- BaseObject::Impl::Get(
*mObject ).AddObserver( *this
);
+ BaseObject::Impl::Get(
*mObject).AddObserver(*this
);
}
}
}
}
}
}
@@
-54,9
+53,9
@@
struct WeakHandleBase::Impl : public BaseObject::Impl::Observer
void Reset()
{
void Reset()
{
- if(
mObject
)
+ if(
mObject
)
{
{
- BaseObject::Impl::Get(
*mObject ).RemoveObserver( *this
);
+ BaseObject::Impl::Get(
*mObject).RemoveObserver(*this
);
mObject = nullptr;
}
}
mObject = nullptr;
}
}
@@
-64,7
+63,7
@@
struct WeakHandleBase::Impl : public BaseObject::Impl::Observer
/**
* From BaseObject::Impl::Observer
*/
/**
* From BaseObject::Impl::Observer
*/
- void ObjectDestroyed(
BaseObject& object
) override
+ void ObjectDestroyed(
BaseObject& object
) override
{
mObject = nullptr;
}
{
mObject = nullptr;
}
@@
-74,12
+73,12
@@
struct WeakHandleBase::Impl : public BaseObject::Impl::Observer
};
WeakHandleBase::WeakHandleBase()
};
WeakHandleBase::WeakHandleBase()
-: mImpl(
new Impl()
)
+: mImpl(
new Impl()
)
{
}
{
}
-WeakHandleBase::WeakHandleBase(
BaseHandle& handle
)
-: mImpl(
new Impl( handle )
)
+WeakHandleBase::WeakHandleBase(
BaseHandle& handle
)
+: mImpl(
new Impl(handle)
)
{
}
{
}
@@
-90,57
+89,57
@@
WeakHandleBase::~WeakHandleBase()
}
WeakHandleBase::WeakHandleBase(const WeakHandleBase& handle)
}
WeakHandleBase::WeakHandleBase(const WeakHandleBase& handle)
-: mImpl(
nullptr
)
+: mImpl(
nullptr
)
{
BaseHandle object = handle.GetBaseHandle();
{
BaseHandle object = handle.GetBaseHandle();
- mImpl = new Impl(object);
+ mImpl
= new Impl(object);
}
}
-WeakHandleBase& WeakHandleBase::operator=(
const WeakHandleBase& rhs
)
+WeakHandleBase& WeakHandleBase::operator=(
const WeakHandleBase& rhs
)
{
{
- if(
this != &rhs
)
+ if(
this != &rhs
)
{
delete mImpl;
BaseHandle handle = rhs.GetBaseHandle();
{
delete mImpl;
BaseHandle handle = rhs.GetBaseHandle();
- mImpl = new Impl(handle);
+ mImpl
= new Impl(handle);
}
return *this;
}
}
return *this;
}
-WeakHandleBase::WeakHandleBase(
WeakHandleBase&& rhs )
-: mImpl(
rhs.mImpl
)
+WeakHandleBase::WeakHandleBase(
WeakHandleBase&& rhs) noexcept
+: mImpl(
rhs.mImpl
)
{
rhs.mImpl = nullptr;
}
{
rhs.mImpl = nullptr;
}
-WeakHandleBase& WeakHandleBase::operator=(
WeakHandleBase&& rhs )
+WeakHandleBase& WeakHandleBase::operator=(
WeakHandleBase&& rhs) noexcept
{
{
- if
(this != &rhs)
+ if(this != &rhs)
{
delete mImpl;
{
delete mImpl;
- mImpl = rhs.mImpl;
+ mImpl
= rhs.mImpl;
rhs.mImpl = nullptr;
}
return *this;
}
rhs.mImpl = nullptr;
}
return *this;
}
-bool WeakHandleBase::operator==(
const WeakHandleBase& rhs
) const
+bool WeakHandleBase::operator==(
const WeakHandleBase& rhs
) const
{
return this->mImpl->mObject == rhs.mImpl->mObject;
}
{
return this->mImpl->mObject == rhs.mImpl->mObject;
}
-bool WeakHandleBase::operator!=(
const WeakHandleBase& rhs
) const
+bool WeakHandleBase::operator!=(
const WeakHandleBase& rhs
) const
{
{
- return !(
*this == rhs
);
+ return !(
*this == rhs
);
}
BaseHandle WeakHandleBase::GetBaseHandle() const
{
}
BaseHandle WeakHandleBase::GetBaseHandle() const
{
- return mImpl ? BaseHandle(
mImpl->mObject
) : BaseHandle();
+ return mImpl ? BaseHandle(
mImpl->mObject
) : BaseHandle();
}
void WeakHandleBase::Reset()
}
void WeakHandleBase::Reset()
@@
-148,5
+147,4
@@
void WeakHandleBase::Reset()
mImpl->Reset();
}
mImpl->Reset();
}
-
-} // Dali
+} // namespace Dali