Changes after replacement of GetMicroSeconds with GetNanoseconds in PlatformAbstraction
[platform/core/uifw/dali-adaptor.git] / adaptors / base / thread-controller.h
1 #ifndef __DALI_INTERNAL_THREAD_CONTROLLER_H__
2 #define __DALI_INTERNAL_THREAD_CONTROLLER_H__
3
4 /*
5  * Copyright (c) 2015 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 namespace Dali
22 {
23
24 class RenderSurface;
25
26 namespace Internal
27 {
28
29 namespace Adaptor
30 {
31
32 class AdaptorInternalServices;
33 class EnvironmentOptions;
34 class ThreadControllerInterface;
35
36 /**
37  * Class to control all the threads.
38  */
39 class ThreadController
40 {
41 public:
42
43   /**
44    * Constructor
45    */
46   ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
47
48   /**
49    * Non virtual destructor. Not intended as base class.
50    */
51   ~ThreadController();
52
53   /**
54    * Initializes the thread controller
55    */
56   void Initialize();
57
58   /**
59    * @copydoc Dali::Adaptor::Start()
60    */
61   void Start();
62
63   /**
64    * @copydoc Dali::Adaptor::Pause()
65    */
66   void Pause();
67
68   /**
69    * @copydoc Dali::Adaptor::Resume()
70    */
71   void Resume();
72
73   /**
74    * @copydoc Dali::Adaptor::Stop()
75    */
76   void Stop();
77
78   /**
79    * Called by the adaptor when core requires another update
80    */
81   void RequestUpdate();
82
83   /**
84    * Called by the adaptor when core requires one update
85    * If Adaptor is paused, we do one update and return to pause
86    */
87   void RequestUpdateOnce();
88
89   /**
90    * Replaces the surface.
91    * @param surface new surface
92    */
93   void ReplaceSurface( RenderSurface* surface );
94
95   /**
96    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
97    */
98   void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
99
100 private:
101
102   // Undefined copy constructor.
103   ThreadController( const ThreadController& );
104
105   // Undefined assignment operator.
106   ThreadController& operator=( const ThreadController& );
107
108 private:
109
110   ThreadControllerInterface* mThreadControllerInterface;
111 };
112
113 } // namespace Adaptor
114
115 } // namespace Internal
116
117 } // namespace Dali
118
119 #endif // __DALI_INTERNAL_THREAD_CONTROLLER_H__