15164be21112a157c06fc84aff9768492e3376f5
[platform/core/uifw/dali-adaptor.git] / adaptors / integration-api / thread-synchronization-interface.h
1 #ifndef __DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H__
2 #define __DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_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
22 namespace Dali
23 {
24
25 /**
26  * @brief Interface for the ThreadSyncrhonization handler.
27  *
28  * This handler ensure the threads are synchronized properly.
29  */
30 class ThreadSynchronizationInterface
31 {
32 public:
33
34   /////////////////////////////////////////////////////////////////////////////////////////////////
35   // Called by the Event Thread if post-rendering is required
36   /////////////////////////////////////////////////////////////////////////////////////////////////
37
38   /**
39    * @brief Surface informs that the post-render has been completed.
40    *
41    * @note Should only be called by the Event Thread if post-rendering is required.
42    */
43   virtual void PostRenderComplete() = 0;
44
45   /////////////////////////////////////////////////////////////////////////////////////////////////
46   // Called by the Render Thread if post-rendering is required
47   /////////////////////////////////////////////////////////////////////////////////////////////////
48
49   /**
50    * @brief Called just before the post rendering is done by the surface.
51    *
52    * @note Should only be called by the Render Thread if post-rendering is required.
53    */
54   virtual void PostRenderStarted() = 0;
55
56   /**
57    * @brief Blocks the render thread until the post rendering has been completed by the surface.
58    *
59    * @note Should only be called by the Render Thread if post-rendering is required.
60    */
61   virtual void PostRenderWaitForCompletion() = 0;
62
63 protected:
64
65   /**
66    * @brief Protected constructor, no creation through this interface
67    */
68   ThreadSynchronizationInterface( ) { }
69
70   /**
71    * Virtual protected destructor, no deletion through this interface
72    */
73   virtual ~ThreadSynchronizationInterface() { }
74
75 private:
76
77   // Undefined copy constructor.
78   ThreadSynchronizationInterface( const ThreadSynchronizationInterface& );
79
80   // Undefined assignment operator.
81   ThreadSynchronizationInterface& operator=( const ThreadSynchronizationInterface& );
82 };
83
84 } // namespace Dali
85
86 #endif // __DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H__