Fix the boiler plate codes
[platform/framework/native/appfw.git] / src / base / runtime / FBaseRt_EventPendingOperationManager.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        FBaseRt_EventPendingOperationManager.cpp
19  * @brief       This is the implementation file for the _EventPendingOperationManager class.
20  *
21  */
22
23 #include <new>
24
25 #include <FBaseObject.h>
26
27 #include "FBaseRtEvent.h"
28 #include <FBaseSysLog.h>
29 #include "FBaseRt_EventPendingOperationManager.h"
30
31
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Runtime;
34 using namespace Tizen::Base::Collection;
35
36 namespace Tizen { namespace Base { namespace Runtime
37 {
38
39 _EventPendingOperationManager::_EventPendingOperationManager(void)
40 {
41
42 }
43
44 result
45 _EventPendingOperationManager::AddFilter(const IEventFilter& filter)
46 {
47         result r = E_SUCCESS;
48
49         _EventPendingOperation* pPendingOperation = new (std::nothrow) _EventPendingOperation;
50
51         pPendingOperation->opType = EVENT_OPERATION_ADD_FILTER;
52         pPendingOperation->pFilter = &filter;
53
54         r = __operations.Add(*pPendingOperation);
55
56         return r;
57 }
58
59 result
60 _EventPendingOperationManager::RemoveFilter(const IEventFilter& filter)
61 {
62         result r = E_SUCCESS;
63
64         _EventPendingOperation* pPendingOperation = new (std::nothrow) _EventPendingOperation;
65
66         pPendingOperation->opType = EVENT_OPERATION_REMOVE_FILTER;
67         pPendingOperation->pFilter = &filter;
68
69         r = __operations.Add(*pPendingOperation);
70
71         return r;
72 }
73
74 result
75 _EventPendingOperationManager::AddListener(const IEventListener& listener)
76 {
77         _EventPendingOperation* pPendingOperation = new (std::nothrow) _EventPendingOperation;
78
79         pPendingOperation->opType = EVENT_OPERATION_ADD_LISTENER;
80         pPendingOperation->pListener = &listener;
81
82         result r = __operations.Add(*pPendingOperation);
83
84         return r;
85 }
86
87 result
88 _EventPendingOperationManager::RemoveListener(const IEventListener& listener)
89 {
90         result r = E_SUCCESS;
91
92         _EventPendingOperation* pPendingOperation = new (std::nothrow) _EventPendingOperation;
93
94         pPendingOperation->opType = EVENT_OPERATION_REMOVE_LISTENER;
95         pPendingOperation->pListener = &listener;
96
97         r = __operations.Add(*pPendingOperation);
98
99         return r;
100 }
101
102 } } } // Tizen::Runtime