2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FScl_OrganizationImpl.cpp
19 * @brief This is the implementation for _OrganizationImpl class.
21 * This file contains definitions of @e _OrganizationImpl class.
24 #include <FBaseSysLog.h>
25 #include <FSclOrganization.h>
26 #include "FScl_OrganizationImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Social
33 _OrganizationImpl::_OrganizationImpl(void)
37 _OrganizationImpl::_OrganizationImpl(const _OrganizationImpl& rhs)
40 __jobTitle = rhs.__jobTitle;
41 __department = rhs.__department;
43 __agent = rhs.__agent;
46 _OrganizationImpl::~_OrganizationImpl(void)
52 _OrganizationImpl::operator =(const _OrganizationImpl& rhs)
60 __jobTitle = rhs.__jobTitle;
61 __department = rhs.__department;
63 __agent = rhs.__agent;
69 _OrganizationImpl::operator ==(const _OrganizationImpl& rhs) const
71 if (__name != rhs.__name)
76 if (__jobTitle != rhs.__jobTitle)
81 if (__department != rhs.__department)
86 if (__role != rhs.__role)
91 if (__agent != rhs.__agent)
100 _OrganizationImpl::operator !=(const _OrganizationImpl& rhs) const
102 return !(*this == rhs);
106 _OrganizationImpl::Equals(const Object& rhs) const
108 const _OrganizationImpl* pOrganization = dynamic_cast<const _OrganizationImpl*>(&rhs);
109 if (pOrganization == null)
114 return *this == *pOrganization;
118 _OrganizationImpl::GetHashCode(void) const
120 int hash = __name.GetHashCode();
121 hash += __jobTitle.GetHashCode();
122 hash += __department.GetHashCode();
123 hash += __role.GetHashCode();
124 hash += __agent.GetHashCode();
130 _OrganizationImpl::GetName(void) const
136 _OrganizationImpl::GetJobTitle(void) const
142 _OrganizationImpl::GetDepartment(void) const
148 _OrganizationImpl::GetRole(void) const
154 _OrganizationImpl::GetAgent(void) const
160 _OrganizationImpl::SetName(const String& name)
166 _OrganizationImpl::SetJobTitle(const String& jobTitle)
168 __jobTitle = jobTitle;
172 _OrganizationImpl::SetDepartment(const String& department)
174 __department = department;
178 _OrganizationImpl::SetRole(const String& role)
184 _OrganizationImpl::SetAgent(const String& agent)
190 _OrganizationImpl::IsEmpty(void) const
192 if (!__name.IsEmpty())
197 if (!__jobTitle.IsEmpty())
202 if (!__role.IsEmpty())
207 if (!__agent.IsEmpty())
212 if (!__department.IsEmpty())
220 const _OrganizationImpl*
221 _OrganizationImpl::GetInstance(const Organization& organization)
223 return organization.__pOrganizationImpl;
227 _OrganizationImpl::GetInstance(Organization& organization)
229 return organization.__pOrganizationImpl;