use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / update / common / property-base.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BASE_H
2 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BASE_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <cstddef>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/object/property.h>
26 #include <dali/internal/common/type-abstraction.h>
27 #include <dali/internal/event/common/property-input-impl.h>
28 #include <dali/internal/update/common/scene-graph-buffers.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 namespace SceneGraph
37 {
38
39 /**
40  * Polymorphic base class for scene-graph properties, held by Nodes etc.
41  */
42 class PropertyBase : public PropertyInputImpl
43 {
44 public:
45
46   /**
47    * Default constructor.
48    */
49   PropertyBase();
50
51   /**
52    * Virtual destructor.
53    */
54   ~PropertyBase() override;
55
56   /**
57    * Reset the property to a base value; only required if the property is animated.
58    * @param [in] currentBufferIndex The current buffer index.
59    */
60   virtual void ResetToBaseValue(BufferIndex updateBufferIndex) = 0;
61
62   /**
63    * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
64    */
65   bool InputChanged() const override
66   {
67     return !IsClean();
68   }
69
70   /**
71    * Query whether the property has changed.
72    * @return True if the property has not changed.
73    */
74   virtual bool IsClean() const = 0;
75
76 private:
77
78   // Undefined
79   PropertyBase(const PropertyBase& property);
80
81   // Undefined
82   PropertyBase& operator=(const PropertyBase& rhs);
83 };
84
85 } // namespace SceneGraph
86
87 } // namespace Internal
88
89 } // namespace Dali
90
91 #endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BASE_H