Modify the spec file for secure log
[framework/osp/social.git] / src / FSclCategoryChangeInfo.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  * @file                FSclCategoryChangeInfo.cpp
18  * @brief               This is the implementation for CategoryChangeInfo class.
19  *
20  * This file contains definitions of @e CategoryChangeInfo class.
21  */
22
23 #include <new>
24 #include <FBaseResult.h>
25 #include <FSclCategoryChangeInfo.h>
26 #include <FBaseSysLog.h>
27 #include "FScl_CategoryChangeInfoImpl.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31
32 namespace Tizen { namespace Social
33 {
34
35 CategoryChangeInfo::CategoryChangeInfo(void)
36 {
37         __pCategoryChangeInfoImpl = new (std::nothrow) _CategoryChangeInfoImpl();
38         SysTryReturnVoidResult(NID_SCL, __pCategoryChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
39 }
40
41 CategoryChangeInfo::CategoryChangeInfo(const CategoryChangeInfo& rhs)
42 {
43         __pCategoryChangeInfoImpl = new (std::nothrow) _CategoryChangeInfoImpl(*rhs.__pCategoryChangeInfoImpl);
44         SysTryReturnVoidResult(NID_SCL, __pCategoryChangeInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 }
46
47 CategoryChangeInfo::~CategoryChangeInfo(void)
48 {
49         delete __pCategoryChangeInfoImpl;
50 }
51
52 CategoryChangeInfo&
53 CategoryChangeInfo::operator =(const CategoryChangeInfo& rhs)
54 {
55         if (this == &rhs)
56         {
57                 return *this;
58         }
59
60         *__pCategoryChangeInfoImpl = *rhs.__pCategoryChangeInfoImpl;
61
62         return *this;
63 }
64
65 bool
66 CategoryChangeInfo::Equals(const Object& rhs) const
67 {
68         const CategoryChangeInfo* pCategoryChangeInfo = dynamic_cast<const CategoryChangeInfo*>(&rhs);
69         if (pCategoryChangeInfo == null)
70         {
71                 return false;
72         }
73
74         return *__pCategoryChangeInfoImpl == *pCategoryChangeInfo->__pCategoryChangeInfoImpl;
75 }
76
77 int
78 CategoryChangeInfo::GetHashCode(void) const
79 {
80         return __pCategoryChangeInfoImpl->GetHashCode();
81 }
82
83 AddressbookId
84 CategoryChangeInfo::GetAddressbookId(void) const
85 {
86         return __pCategoryChangeInfoImpl->GetAddressbookId();
87 }
88
89 RecordId
90 CategoryChangeInfo::GetCategoryId(void) const
91 {
92         return __pCategoryChangeInfoImpl->GetCategoryId();
93 }
94
95 int
96 CategoryChangeInfo::GetVersion(void) const
97 {
98         return __pCategoryChangeInfoImpl->GetVersion();
99 }
100
101 RecordChangeType
102 CategoryChangeInfo::GetChangeType(void) const
103 {
104         return __pCategoryChangeInfoImpl->GetChangeType();
105 }
106
107 }} // Tizen::Social