X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fobject%2Fhandle.cpp;h=45f8fcd9adff1e9bb77fae7dfdbe720be871af89;hb=0b501ba800a263b97d99adf224fc42d0c2aa8b37;hp=d765582d5cb6adaccac935fc3cd33c6b0e06679f;hpb=454a2ddbed8d022e32a31dcd225a7ac32903b282;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/object/handle.cpp b/dali/public-api/object/handle.cpp index d765582..45f8fcd 100644 --- a/dali/public-api/object/handle.cpp +++ b/dali/public-api/object/handle.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -33,26 +33,22 @@ Handle::Handle(Dali::Internal::Object* handle) { } -Handle::Handle() -{ -} +Handle::Handle() = default; Handle Handle::New() { return Handle(Internal::Object::New().Get()); } -Handle::~Handle() -{ -} +Handle::~Handle() = default; Handle::Handle(const Handle& handle) = default; Handle& Handle::operator=(const Handle& rhs) = default; -Handle::Handle(Handle&& rhs) = default; +Handle::Handle(Handle&& rhs) noexcept = default; -Handle& Handle::operator=(Handle&& rhs) = default; +Handle& Handle::operator=(Handle&& rhs) noexcept = default; Handle Handle::DownCast(BaseHandle handle) { @@ -71,7 +67,7 @@ uint32_t Handle::GetPropertyCount() const std::string Handle::GetPropertyName(Property::Index index) const { - return GetImplementation(*this).GetPropertyName(index); + return std::string(GetImplementation(*this).GetPropertyName(index)); } Property::Index Handle::GetPropertyIndex(Property::Key key) const @@ -104,19 +100,34 @@ void Handle::SetProperty(Property::Index index, Property::Value propertyValue) GetImplementation(*this).SetProperty(index, std::move(propertyValue)); } -Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue) +void Handle::ReserveCustomProperties(int propertyCount) +{ + GetImplementation(*this).ReserveCustomProperties(propertyCount); +} + +Property::Index Handle::RegisterProperty(std::string_view name, Property::Value propertyValue) +{ + return GetImplementation(*this).RegisterProperty(name, std::move(propertyValue)); +} + +Property::Index Handle::RegisterProperty(Property::Index key, std::string_view name, Property::Value propertyValue) +{ + return GetImplementation(*this).RegisterProperty(name, key, std::move(propertyValue), true); +} + +Property::Index Handle::RegisterProperty(std::string_view name, Property::Value propertyValue, Property::AccessMode accessMode) { - return GetImplementation(*this).RegisterProperty(std::move(name), std::move(propertyValue)); + return GetImplementation(*this).RegisterProperty(name, std::move(propertyValue), accessMode); } -Property::Index Handle::RegisterProperty(Property::Index key, std::string name, Property::Value propertyValue) +Property::Index Handle::RegisterUniqueProperty(std::string_view name, Property::Value propertyValue) { - return GetImplementation(*this).RegisterProperty(std::move(name), key, std::move(propertyValue)); + return GetImplementation(*this).RegisterProperty(name, Property::INVALID_KEY, std::move(propertyValue), false); } -Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode) +Property::Index Handle::RegisterUniqueProperty(Property::Index key, std::string_view name, Property::Value propertyValue) { - return GetImplementation(*this).RegisterProperty(std::move(name), std::move(propertyValue), accessMode); + return GetImplementation(*this).RegisterProperty(name, key, std::move(propertyValue), false); } Property::Value Handle::GetProperty(Property::Index index) const