2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "toolkit-timer.h"
21 #include <dali/public-api/common/dali-common.h>
22 #include <dali/public-api/object/base-object.h>
23 #include <dali/public-api/signals/dali-signal-v2.h>
34 * This is a global signal that all users of this stub will connect to.
35 * If we were to use a timer stub with real ticks we may wish to have this as a member variable created with each New Timer.
36 * Currently unable to get the boost singal connect to work with the stub timer when using a member hence this global.
38 Dali::Timer::TimerSignalV2 gTimerTick;
45 Timer Timer::New( unsigned int milliSec )
47 DALI_ASSERT_ALWAYS( gTimer );
52 Timer::TimerSignalV2& Timer::TickSignal()
57 bool Timer::IsRunning() const
62 Timer::Timer( const Timer& timer )
87 * Stub for the Internal Timer
89 class Timer : public BaseObject
91 public: // Creation & Destruction
94 Timer(ToolkitTimer *timer);
101 bool IsRunning() const;
107 ToolkitTimer* mToolkitTimer;
112 : mToolkitTimer(NULL),
117 Timer::Timer(ToolkitTimer *timer)
118 : mToolkitTimer(timer),
129 DALI_ASSERT_ALWAYS( gTimer );
134 DALI_ASSERT_ALWAYS( gTimer );
137 bool Timer::IsRunning() const
139 DALI_ASSERT_ALWAYS( gTimer );
143 } // namespace Adaptor
145 } // namespace Internal
147 ////////////////////////////////////////////////////////////////////////////////////////////////////
149 ToolkitTimer::ToolkitTimer()
150 : mTimerStub(new Internal::Adaptor::Timer(this)),
159 ToolkitTimer::~ToolkitTimer()
164 Timer ToolkitTimer::GetTimer()