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_RelationshipImpl.cpp
19 * @brief This is the implementation for _RelationshipImpl class.
21 * This file contains definitions of @e _RelationshipImpl class.
24 #include <FBaseSysLog.h>
25 #include <FSclRelationship.h>
26 #include "FScl_RelationshipImpl.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Social
33 _RelationshipImpl::_RelationshipImpl(void)
34 : __type(CONTACT_RELATIONSHIP_TYPE_ASSISTANT)
38 _RelationshipImpl::_RelationshipImpl(const _RelationshipImpl& rhs)
42 __label = rhs.__label;
45 _RelationshipImpl::~_RelationshipImpl(void)
51 _RelationshipImpl::operator =(const _RelationshipImpl& rhs)
60 __label = rhs.__label;
66 _RelationshipImpl::operator ==(const _RelationshipImpl& rhs) const
68 if (__name != rhs.__name)
73 if (__type != rhs.__type)
78 if (__label != rhs.__label)
87 _RelationshipImpl::operator !=(const _RelationshipImpl& rhs) const
89 return !(*this == rhs);
93 _RelationshipImpl::Equals(const Object& rhs) const
95 const _RelationshipImpl* pRelationship= dynamic_cast<const _RelationshipImpl*>(&rhs);
96 if (pRelationship == null)
101 return *this == *pRelationship;
105 _RelationshipImpl::GetHashCode(void) const
107 int hash = __name.GetHashCode() + __label.GetHashCode() + __type;
113 _RelationshipImpl::GetType(void) const
119 _RelationshipImpl::GetRelativeName(void) const
125 _RelationshipImpl::GetLabel(void) const
131 _RelationshipImpl::SetType(RelationshipType type)
137 _RelationshipImpl::SetRelativeName(const String& name)
143 _RelationshipImpl::SetLabel(const String& label)
148 const _RelationshipImpl*
149 _RelationshipImpl::GetInstance(const Relationship& relationship)
151 return relationship.__pRelationshipImpl;
155 _RelationshipImpl::GetInstance(Relationship& relationship)
157 return relationship.__pRelationshipImpl;