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 FSclRelationship.cpp
19 * @brief This is the implementation for Relationship class.
21 * This file contains definitions of @e Relationship 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 Relationship::Relationship(void)
35 __pRelationshipImpl = new (std::nothrow) _RelationshipImpl();
36 SysTryReturnVoidResult(NID_SCL, __pRelationshipImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
39 Relationship::Relationship(const Relationship& rhs)
41 __pRelationshipImpl = new (std::nothrow) _RelationshipImpl(*rhs.__pRelationshipImpl);
42 SysTryReturnVoidResult(NID_SCL, __pRelationshipImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
45 Relationship::~Relationship(void)
47 delete __pRelationshipImpl;
51 Relationship::operator =(const Relationship& rhs)
58 *__pRelationshipImpl = *rhs.__pRelationshipImpl;
64 Relationship::operator ==(const Relationship& rhs) const
66 if (__name != rhs.__name)
71 return *__pRelationshipImpl == *rhs.__pRelationshipImpl;;
75 Relationship::operator !=(const Relationship& rhs) const
77 return !(*this == rhs);
81 Relationship::Equals(const Object& rhs) const
83 const Relationship* pRelationship = dynamic_cast<const Relationship*>(&rhs);
84 if (pRelationship == null)
89 return *this == *pRelationship;
93 Relationship::GetHashCode(void) const
95 return __pRelationshipImpl->GetHashCode();
99 Relationship::GetType(void) const
101 return __pRelationshipImpl->GetType();
105 Relationship::GetRelativeName(void) const
107 return __pRelationshipImpl->GetRelativeName();
111 Relationship::GetLabel(void) const
113 return __pRelationshipImpl->GetLabel();
117 Relationship::SetType(RelationshipType type)
119 __pRelationshipImpl->SetType(type);
123 Relationship::SetRelativeName(const String& name)
125 __pRelationshipImpl->SetRelativeName(name);
129 Relationship::SetLabel(const String& label)
131 __pRelationshipImpl->SetLabel(label);