/*
- * 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.
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)
{
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
GetImplementation(*this).SetProperty(index, std::move(propertyValue));
}
-Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue)
+void Handle::ReserveCustomProperties(int propertyCount)
{
- return GetImplementation(*this).RegisterProperty(std::move(name), std::move(propertyValue));
+ GetImplementation(*this).ReserveCustomProperties(propertyCount);
}
-Property::Index Handle::RegisterProperty(Property::Index key, std::string name, Property::Value propertyValue)
+Property::Index Handle::RegisterProperty(std::string_view name, Property::Value propertyValue)
{
- return GetImplementation(*this).RegisterProperty(std::move(name), key, std::move(propertyValue));
+ return GetImplementation(*this).RegisterProperty(name, std::move(propertyValue));
}
-Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
+Property::Index Handle::RegisterProperty(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), true);
+}
+
+Property::Index Handle::RegisterProperty(std::string_view name, Property::Value propertyValue, Property::AccessMode accessMode)
+{
+ return GetImplementation(*this).RegisterProperty(name, std::move(propertyValue), accessMode);
+}
+
+Property::Index Handle::RegisterUniqueProperty(std::string_view name, Property::Value propertyValue)
+{
+ return GetImplementation(*this).RegisterProperty(name, Property::INVALID_KEY, std::move(propertyValue), false);
+}
+
+Property::Index Handle::RegisterUniqueProperty(Property::Index key, std::string_view name, Property::Value propertyValue)
+{
+ return GetImplementation(*this).RegisterProperty(name, key, std::move(propertyValue), false);
}
Property::Value Handle::GetProperty(Property::Index index) const