2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FScl_RelationshipImpl.cpp
18 * @brief This is the implementation for _RelationshipImpl class.
20 * This file contains definitions of @e _RelationshipImpl class.
23 #include <FBaseSysLog.h>
24 #include <FSclRelationship.h>
25 #include "FScl_RelationshipImpl.h"
27 using namespace Tizen::Base;
29 namespace Tizen { namespace Social
32 _RelationshipImpl::_RelationshipImpl(void)
33 : __type(CONTACT_RELATIONSHIP_TYPE_ASSISTANT)
37 _RelationshipImpl::_RelationshipImpl(const _RelationshipImpl& rhs)
41 __label = rhs.__label;
44 _RelationshipImpl::~_RelationshipImpl(void)
50 _RelationshipImpl::operator =(const _RelationshipImpl& rhs)
59 __label = rhs.__label;
65 _RelationshipImpl::operator ==(const _RelationshipImpl& rhs) const
67 if (__name != rhs.__name)
72 if (__type != rhs.__type)
77 if (__label != rhs.__label)
86 _RelationshipImpl::operator !=(const _RelationshipImpl& rhs) const
88 return !(*this == rhs);
92 _RelationshipImpl::Equals(const Object& rhs) const
94 const _RelationshipImpl* pRelationship= dynamic_cast<const _RelationshipImpl*>(&rhs);
95 if (pRelationship == null)
100 return *this == *pRelationship;
104 _RelationshipImpl::GetHashCode(void) const
106 int hash = __name.GetHashCode() + __label.GetHashCode() + __type;
112 _RelationshipImpl::GetType(void) const
118 _RelationshipImpl::GetRelativeName(void) const
124 _RelationshipImpl::GetLabel(void) const
130 _RelationshipImpl::SetType(RelationshipType type)
136 _RelationshipImpl::SetRelativeName(const String& name)
142 _RelationshipImpl::SetLabel(const String& label)
147 const _RelationshipImpl*
148 _RelationshipImpl::GetInstance(const Relationship& relationship)
150 return relationship.__pRelationshipImpl;
154 _RelationshipImpl::GetInstance(Relationship& relationship)
156 return relationship.__pRelationshipImpl;