Revert "[Tizen] Add DALi Autofill implementation"
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / performance-logger.h
1 #ifndef DALI_PERFORMANCE_LOGGER_H
2 #define DALI_PERFORMANCE_LOGGER_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 <dali/public-api/object/base-handle.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/dali-adaptor-common.h>
26
27 namespace Dali
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 namespace Adaptor
33 {
34 class PerformanceLogger;
35 }
36 }
37
38 /**
39  * @brief Performance logger class
40  */
41 class DALI_ADAPTOR_API PerformanceLogger : public BaseHandle
42 {
43 public:
44
45   /**
46    * Enum for events that can be logged
47    */
48   enum Marker
49   {
50     START_EVENT,      ///< The start of timing
51     END_EVENT         ///< The end of timing
52   };
53
54   /**
55    * @brief Constructor, creates an uninitialized logger.
56    *
57    * Call New to fully construct a logger.
58    */
59   PerformanceLogger();
60
61   /**
62    * @brief Create a new logger
63    *
64    * @param[in] name The name of the logger. This needs to be a compile-time literal and alive for the whole lifetime of the performance logger.
65    * @return a new logger
66    */
67   static PerformanceLogger New( const char* name );
68
69   /**
70    * @brief Copy constructor.
71    *
72    * @param[in] logger The handle to copy. The copied handle will point at the same implementation
73    */
74   PerformanceLogger( const PerformanceLogger& logger );
75
76   /**
77    * @brief Assignment operator.
78    *
79    * @param[in] logger The handle to copy. This handle will point at the same implementation
80    * as the copied handle.
81    * @return Reference to this logger handle
82    */
83   PerformanceLogger& operator=( const PerformanceLogger& logger );
84
85   /**
86    * @brief Destructor
87    *
88    * This is non-virtual since derived Handle types must not contain data or virtual methods.
89    */
90   ~PerformanceLogger();
91
92   /**
93    * @brief Downcast an Object handle to PerformanceLogger handle.
94    *
95    * If handle points to a PerformanceLogger object the downcast produces a valid
96    * handle. If not the returned handle is left uninitialized.
97    *
98    * @param[in] handle to An object
99    * @return handle to a PerformanceLogger object or an uninitialized handle
100    */
101   static PerformanceLogger DownCast( BaseHandle handle );
102
103   /**
104    * Add a performance marker
105    *
106    * @param markerType Performance marker type
107    */
108   void AddMarker( Marker markerType );
109
110   /**
111    * Set the logging frequency
112    *
113    * @param logFrequency how often to log out in seconds
114    */
115   void SetLoggingFrequency( unsigned int logFrequency);
116
117   /**
118    * Set logging on or off for this logger
119    *
120    * @param[in] enable Enable logging or not
121    */
122   void EnableLogging( bool enable );
123
124   // Not intended for application developers
125
126   /**
127    * Creates a new handle from the implementation.
128    * @param[in] impl A pointer to the object.
129    */
130   explicit DALI_INTERNAL PerformanceLogger( Internal::Adaptor::PerformanceLogger* impl );
131
132 };
133
134 } // namespace Dali
135
136 #endif // DALI_PERFORMANCE_LOGGER_H