Add move semantics to commonly used classes in dali-core
[platform/core/uifw/dali-core.git] / dali / public-api / object / type-info.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/object/type-info.h>
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/event/common/type-info-impl.h>
25
26 namespace Dali
27 {
28
29 TypeInfo::TypeInfo()
30 {
31 }
32
33 TypeInfo::~TypeInfo()
34 {
35 }
36
37 TypeInfo::TypeInfo(const TypeInfo& copy)
38 : BaseHandle(copy)
39 {
40 }
41
42 TypeInfo& TypeInfo::operator=(const TypeInfo& rhs)
43 {
44   BaseHandle::operator=(rhs);
45   return *this;
46 }
47
48 TypeInfo::TypeInfo( TypeInfo&& rhs ) = default;
49
50 TypeInfo& TypeInfo::operator=( TypeInfo&& rhs ) = default;
51
52 const std::string& TypeInfo::GetName() const
53 {
54   return GetImplementation(*this).GetName();
55 }
56
57 const std::string& TypeInfo::GetBaseName() const
58 {
59   return GetImplementation(*this).GetBaseName();
60 }
61
62 BaseHandle TypeInfo::CreateInstance() const
63 {
64   return GetImplementation(*this).CreateInstance();
65 }
66
67 TypeInfo::CreateFunction TypeInfo::GetCreator() const
68 {
69   return GetImplementation(*this).GetCreator();
70 }
71
72 size_t TypeInfo::GetActionCount() const
73 {
74   return GetImplementation(*this).GetActionCount();
75 }
76
77 std::string TypeInfo::GetActionName(size_t index)
78 {
79   return GetImplementation(*this).GetActionName( static_cast<uint32_t>( index ) );
80 }
81
82 size_t TypeInfo::GetSignalCount() const
83 {
84   return GetImplementation(*this).GetSignalCount();
85 }
86
87 std::string TypeInfo::GetSignalName(size_t index)
88 {
89   return GetImplementation(*this).GetSignalName( static_cast<uint32_t>( index ) );
90 }
91
92 size_t TypeInfo::GetPropertyCount() const
93 {
94   return GetImplementation(*this).GetPropertyCount();
95 }
96
97 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
98 {
99   indices.Clear(); // We do not want to clear the container if called internally, so only clear here
100   GetImplementation(*this).GetPropertyIndices( indices );
101 }
102
103 const std::string& TypeInfo::GetPropertyName( Property::Index index ) const
104 {
105   return GetImplementation(*this).GetRegisteredPropertyName( index );
106 }
107
108 Property::Index TypeInfo::GetChildPropertyIndex( const std::string& name ) const
109 {
110   return GetImplementation(*this).GetChildPropertyIndex( name );
111 }
112
113 const std::string& TypeInfo::GetChildPropertyName( Property::Index index ) const
114 {
115   return GetImplementation(*this).GetChildPropertyName( index );
116 }
117
118 Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
119 {
120   return GetImplementation(*this).GetChildPropertyType( index );
121 }
122
123 void TypeInfo::GetChildPropertyIndices( Property::IndexContainer& indices ) const
124 {
125   indices.Clear(); // We do not want to clear the container if called internally, so only clear here
126   GetImplementation(*this).GetChildPropertyIndices( indices );
127 }
128
129 TypeInfo::TypeInfo(Internal::TypeInfo* internal)
130 : BaseHandle(internal)
131 {
132 }
133
134 } // namespace Dali