1 #ifndef __DALI_PERFORMANCE_LOGGER_H__
2 #define __DALI_PERFORMANCE_LOGGER_H__
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/object/base-handle.h>
25 #include <dali/public-api/dali-adaptor-common.h>
30 namespace Internal DALI_INTERNAL
34 class PerformanceLogger;
39 * @brief Performance logger class
41 class DALI_ADAPTOR_API PerformanceLogger : public BaseHandle
46 * Enum for events that can be logged
50 START_EVENT, ///< The start of timing
51 END_EVENT ///< The end of timing
55 * @brief Constructor, creates an uninitialized logger.
57 * Call New to fully construct a logger.
62 * @brief Create a new logger
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
67 static PerformanceLogger New( const char* name );
70 * @brief Copy constructor.
72 * @param[in] logger The handle to copy. The copied handle will point at the same implementation
74 PerformanceLogger( const PerformanceLogger& logger );
77 * @brief Assignment operator.
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
83 PerformanceLogger& operator=( const PerformanceLogger& logger );
88 * This is non-virtual since derived Handle types must not contain data or virtual methods.
93 * @brief Downcast an Object handle to PerformanceLogger handle.
95 * If handle points to a PerformanceLogger object the downcast produces a valid
96 * handle. If not the returned handle is left uninitialized.
98 * @param[in] handle to An object
99 * @return handle to a PerformanceLogger object or an uninitialized handle
101 static PerformanceLogger DownCast( BaseHandle handle );
104 * Add a performance marker
106 * @param markerType Performance marker type
108 void AddMarker( Marker markerType );
111 * Set the logging frequency
113 * @param logFrequency how often to log out in seconds
115 void SetLoggingFrequency( unsigned int logFrequency);
118 * Set logging on or off for this logger
120 * @param[in] enable Enable logging or not
122 void EnableLogging( bool enable );
124 // Not intended for application developers
127 * Creates a new handle from the implementation.
128 * @param[in] impl A pointer to the object.
130 explicit DALI_INTERNAL PerformanceLogger( Internal::Adaptor::PerformanceLogger* impl );
136 #endif // __DALI_PERFORMANCE_LOGGER_H__