[dali_2.3.25] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / trace / common / trace-manager-impl.h
1 #ifndef DALI_INTERNAL_TRACE_MANAGER_IMPL_H
2 #define DALI_INTERNAL_TRACE_MANAGER_IMPL_H
3
4 /*
5  * Copyright (c) 2021 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/integration-api/trace.h>
23
24 // INTERNAL INCLUDES
25
26 namespace Dali
27 {
28 namespace Internal
29 {
30 namespace Adaptor
31 {
32 class PerformanceInterface;
33
34 class TraceManager
35 {
36 public:
37   /**
38    * Explicit Constructor
39    */
40   explicit TraceManager(PerformanceInterface* performanceInterface);
41
42   /**
43    * Constructor
44    */
45   TraceManager() = default;
46
47   /**
48    * Virtual Destructor
49    */
50   virtual ~TraceManager() = default;
51
52   /**
53    * Second phase initialisation of TraceManager
54    */
55   bool Initialise();
56
57   /**
58    * Used for network server logging on Ubuntu
59    */
60   PerformanceInterface* mPerformanceInterface;
61
62 protected:
63   /**
64    * Obtain the platform dependent LogContextFunction method used for tracing
65    */
66   virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction()
67   {
68     return nullptr;
69   };
70
71 private:
72   /**
73    * Set / Install the platform dependent trace function
74    * @param logContextFunction - Platform dependent trace function
75    */
76   void SetTraceLogContextFunction(const Dali::Integration::Trace::LogContextFunction& logContextFunction);
77
78   TraceManager(const TraceManager&) = delete;
79   TraceManager& operator=(TraceManager&) = delete;
80 };
81
82 } // namespace Adaptor
83
84 } // namespace Internal
85
86 } // namespace Dali
87
88 #endif // DALI_INTERNAL_TRACE_MANAGER_IMPL_H