Fix code for TDIS-5396
[framework/osp/social.git] / src / FSclCategoryChangeInfo.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                FSclCategoryChangeInfo.cpp
19  * @brief               This is the implementation for CategoryChangeInfo class.
20  *
21  * This file contains definitions of @e CategoryChangeInfo class.
22  */
23
24 #include <new>
25 #include <FBaseResult.h>
26 #include <FSclCategoryChangeInfo.h>
27 #include <FBaseSysLog.h>
28 #include "FScl_CategoryChangeInfoImpl.h"
29
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32
33 namespace Tizen { namespace Social
34 {
35
36 CategoryChangeInfo::CategoryChangeInfo(void)
37 {
38         __pCategoryChangeInfoImpl = new (std::nothrow) _CategoryChangeInfoImpl();
39         SysTryReturnVoidResult(NID_SCL, __pCategoryChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
40 }
41
42 CategoryChangeInfo::CategoryChangeInfo(const CategoryChangeInfo& rhs)
43 {
44         __pCategoryChangeInfoImpl = new (std::nothrow) _CategoryChangeInfoImpl(*rhs.__pCategoryChangeInfoImpl);
45         SysTryReturnVoidResult(NID_SCL, __pCategoryChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
46 }
47
48 CategoryChangeInfo::~CategoryChangeInfo(void)
49 {
50         delete __pCategoryChangeInfoImpl;
51 }
52
53 CategoryChangeInfo&
54 CategoryChangeInfo::operator =(const CategoryChangeInfo& rhs)
55 {
56         if (this == &rhs)
57         {
58                 return *this;
59         }
60
61         *__pCategoryChangeInfoImpl = *rhs.__pCategoryChangeInfoImpl;
62
63         return *this;
64 }
65
66 bool
67 CategoryChangeInfo::Equals(const Object& rhs) const
68 {
69         const CategoryChangeInfo* pCategoryChangeInfo = dynamic_cast<const CategoryChangeInfo*>(&rhs);
70         if (pCategoryChangeInfo == null)
71         {
72                 return false;
73         }
74
75         return *__pCategoryChangeInfoImpl == *pCategoryChangeInfo->__pCategoryChangeInfoImpl;
76 }
77
78 int
79 CategoryChangeInfo::GetHashCode(void) const
80 {
81         return __pCategoryChangeInfoImpl->GetHashCode();
82 }
83
84 AddressbookId
85 CategoryChangeInfo::GetAddressbookId(void) const
86 {
87         return __pCategoryChangeInfoImpl->GetAddressbookId();
88 }
89
90 RecordId
91 CategoryChangeInfo::GetCategoryId(void) const
92 {
93         return __pCategoryChangeInfoImpl->GetCategoryId();
94 }
95
96 int
97 CategoryChangeInfo::GetVersion(void) const
98 {
99         return __pCategoryChangeInfoImpl->GetVersion();
100 }
101
102 RecordChangeType
103 CategoryChangeInfo::GetChangeType(void) const
104 {
105         return __pCategoryChangeInfoImpl->GetChangeType();
106 }
107
108 }} // Tizen::Social