1 #ifndef __DALI_PERFORMANCE_LOGGER_H__
2 #define __DALI_PERFORMANCE_LOGGER_H__
5 * Copyright (c) 2015 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>
27 namespace Internal DALI_INTERNAL
31 class PerformanceLogger;
36 * @brief Performance logger class
38 class DALI_IMPORT_API PerformanceLogger : public BaseHandle
43 * Enum for events that can be logged
47 START_EVENT, ///< The start of timing
48 END_EVENT ///< The end of timing
52 * @brief Constructor, creates an uninitialized logger.
54 * Call New to fully construct a logger.
59 * @brief Create a new logger
61 * @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.
62 * @return a new logger
64 static PerformanceLogger New( const char* name );
67 * @brief Copy constructor.
69 * @param[in] logger The handle to copy. The copied handle will point at the same implementation
71 PerformanceLogger( const PerformanceLogger& logger );
74 * @brief Assignment operator.
76 * @param[in] logger The handle to copy. This handle will point at the same implementation
77 * as the copied handle.
78 * @return Reference to this logger handle
80 PerformanceLogger& operator=( const PerformanceLogger& logger );
85 * This is non-virtual since derived Handle types must not contain data or virtual methods.
90 * @brief Downcast an Object handle to PerformanceLogger handle.
92 * If handle points to a PerformanceLogger object the downcast produces a valid
93 * handle. If not the returned handle is left uninitialized.
95 * @param[in] handle to An object
96 * @return handle to a PerformanceLogger object or an uninitialized handle
98 static PerformanceLogger DownCast( BaseHandle handle );
101 * Add a performance marker
103 * @param markerType Performance marker type
105 void AddMarker( Marker markerType );
108 * Set the logging frequency
110 * @param logFrequency how often to log out in seconds
112 void SetLoggingFrequency( unsigned int logFrequency);
115 * Set logging on or off for this logger
117 * @param[in] enable Enable logging or not
119 void EnableLogging( bool enable );
121 // Not intended for application developers
124 * Creates a new handle from the implementation.
125 * @param[in] impl A pointer to the object.
127 explicit DALI_INTERNAL PerformanceLogger( Internal::Adaptor::PerformanceLogger* impl );
133 #endif // __DALI_PERFORMANCE_LOGGER_H__