// // Open Service Platform // 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 FSclRelationship.cpp * @brief This is the implementation for Relationship class. * * This file contains definitions of @e Relationship class. */ #include #include #include "FScl_RelationshipImpl.h" using namespace Tizen::Base; namespace Tizen { namespace Social { Relationship::Relationship(void) { __pRelationshipImpl = new (std::nothrow) _RelationshipImpl(); SysTryReturnVoidResult(NID_SCL, __pRelationshipImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); } Relationship::Relationship(const Relationship& rhs) { __pRelationshipImpl = new (std::nothrow) _RelationshipImpl(*rhs.__pRelationshipImpl); SysTryReturnVoidResult(NID_SCL, __pRelationshipImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); } Relationship::~Relationship(void) { delete __pRelationshipImpl; } Relationship& Relationship::operator =(const Relationship& rhs) { if (this == &rhs) { return *this; } *__pRelationshipImpl = *rhs.__pRelationshipImpl; return *this; } bool Relationship::operator ==(const Relationship& rhs) const { if (__name != rhs.__name) { return false; } return *__pRelationshipImpl == *rhs.__pRelationshipImpl;; } bool Relationship::operator !=(const Relationship& rhs) const { return !(*this == rhs); } bool Relationship::Equals(const Object& rhs) const { const Relationship* pRelationship = dynamic_cast(&rhs); if (pRelationship == null) { return false; } return *this == *pRelationship; } int Relationship::GetHashCode(void) const { return __pRelationshipImpl->GetHashCode(); } RelationshipType Relationship::GetType(void) const { return __pRelationshipImpl->GetType(); } String Relationship::GetRelativeName(void) const { return __pRelationshipImpl->GetRelativeName(); } String Relationship::GetLabel(void) const { return __pRelationshipImpl->GetLabel(); } void Relationship::SetType(RelationshipType type) { __pRelationshipImpl->SetType(type); } void Relationship::SetRelativeName(const String& name) { __pRelationshipImpl->SetRelativeName(name); } void Relationship::SetLabel(const String& label) { __pRelationshipImpl->SetLabel(label); } }} // Tizen::Social