Fix the boiler plate codes
[platform/framework/native/appfw.git] / src / base / runtime / FBaseRtEventDrivenThread.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FBaseRtEventDrivenThread.cpp
19  * @brief       This is the implementation file for the EventDrivenThread class.
20  *
21  */
22
23 #include <new>
24 #include <FBaseRtEventDrivenThread.h>
25 #include <FBaseSysLog.h>
26
27
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Collection;
30
31 namespace Tizen { namespace Base { namespace Runtime
32 {
33
34 EventDrivenThread::EventDrivenThread(void)
35         : __pEventDrivenThreadImpl(null)
36 {
37
38 }
39
40 EventDrivenThread::~EventDrivenThread(void)
41 {
42
43 }
44
45 result
46 EventDrivenThread::Construct(long stackSize, ThreadPriority priority)
47 {
48         SysTryReturnResult(NID_BASE_RT, stackSize > 0, E_INVALID_ARG, "Stack size must be greater than zero.");
49
50         return EventDrivenThread::Construct(L"thread", stackSize, priority);
51 }
52
53 result
54 EventDrivenThread::Construct(const String& name, long stackSize, ThreadPriority priority)
55 {
56         SysTryReturnResult(NID_BASE_RT, !name.IsEmpty(), E_INVALID_ARG, "Thread name is empty string.");
57         SysTryReturnResult(NID_BASE_RT, stackSize > 0, E_INVALID_ARG, "Stack size must be greater than zero.");
58
59         return Thread::Construct(name, THREAD_TYPE_EVENT_DRIVEN, stackSize, priority);
60 }
61
62 result
63 EventDrivenThread::Quit(void)
64 {
65         return Thread::Stop();
66 }
67
68 result
69 EventDrivenThread::SendUserEvent(RequestId requestId, const IList* pArgs)
70 {
71         return Thread::SendUserEvent(requestId, pArgs);
72 }
73
74 Object*
75 EventDrivenThread::Run(void)
76 {
77         return null;
78 }
79
80 bool
81 EventDrivenThread::OnStart(void)
82 {
83
84         return true;
85 }
86
87 void
88 EventDrivenThread::OnStop(void)
89 {
90
91 }
92
93 void
94 EventDrivenThread::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
95 {
96
97 }
98
99 } } } // Tizen::Base::Runtime