// // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /** * @file FScl_RelationshipImpl.cpp * @brief This is the implementation for _RelationshipImpl class. * * This file contains definitions of @e _RelationshipImpl class. */ #include #include #include "FScl_RelationshipImpl.h" using namespace Tizen::Base; namespace Tizen { namespace Social { _RelationshipImpl::_RelationshipImpl(void) : __type(CONTACT_RELATIONSHIP_TYPE_ASSISTANT) { } _RelationshipImpl::_RelationshipImpl(const _RelationshipImpl& rhs) { __name = rhs.__name; __type = rhs.__type; __label = rhs.__label; } _RelationshipImpl::~_RelationshipImpl(void) { } _RelationshipImpl& _RelationshipImpl::operator =(const _RelationshipImpl& rhs) { if (this == &rhs) { return *this; } __name = rhs.__name; __type = rhs.__type; __label = rhs.__label; return *this; } bool _RelationshipImpl::operator ==(const _RelationshipImpl& rhs) const { if (__name != rhs.__name) { return false; } if (__type != rhs.__type) { return false; } if (__label != rhs.__label) { return false; } return true; } bool _RelationshipImpl::operator !=(const _RelationshipImpl& rhs) const { return !(*this == rhs); } bool _RelationshipImpl::Equals(const Object& rhs) const { const _RelationshipImpl* pRelationship= dynamic_cast(&rhs); if (pRelationship == null) { return false; } return *this == *pRelationship; } int _RelationshipImpl::GetHashCode(void) const { int hash = __name.GetHashCode() + __label.GetHashCode() + __type; return hash; } RelationshipType _RelationshipImpl::GetType(void) const { return __type; } String _RelationshipImpl::GetRelativeName(void) const { return __name; } String _RelationshipImpl::GetLabel(void) const { return __label; } void _RelationshipImpl::SetType(RelationshipType type) { __type = type; } void _RelationshipImpl::SetRelativeName(const String& name) { __name = name; } void _RelationshipImpl::SetLabel(const String& label) { __label = label; } const _RelationshipImpl* _RelationshipImpl::GetInstance(const Relationship& relationship) { return relationship.__pRelationshipImpl; } _RelationshipImpl* _RelationshipImpl::GetInstance(Relationship& relationship) { return relationship.__pRelationshipImpl; } }} // Tizen::Social