1 // 2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #include "CommandHandlerKey.hpp" 7 8 namespace arm 9 { 10 11 namespace pipe 12 { 13 GetFamilyId() const14uint32_t CommandHandlerKey::GetFamilyId() const 15 { 16 return m_FamilyId; 17 } 18 GetPacketId() const19uint32_t CommandHandlerKey::GetPacketId() const 20 { 21 return m_PacketId; 22 } 23 GetVersion() const24uint32_t CommandHandlerKey::GetVersion() const 25 { 26 return m_Version; 27 } 28 operator <(const CommandHandlerKey & rhs) const29bool CommandHandlerKey::operator<(const CommandHandlerKey& rhs) const 30 { 31 bool result = true; 32 if (m_FamilyId == rhs.m_FamilyId) 33 { 34 if (m_PacketId == rhs.m_PacketId) 35 { 36 result = m_Version < rhs.m_Version; 37 } 38 else if (m_PacketId > rhs.m_PacketId) 39 { 40 result = false; 41 } 42 } 43 else if (m_FamilyId > rhs.m_FamilyId) 44 { 45 result = false; 46 } 47 return result; 48 } 49 operator >(const CommandHandlerKey & rhs) const50bool CommandHandlerKey::operator>(const CommandHandlerKey& rhs) const 51 { 52 return rhs < *this; 53 } 54 operator <=(const CommandHandlerKey & rhs) const55bool CommandHandlerKey::operator<=(const CommandHandlerKey& rhs) const 56 { 57 return !(*this > rhs); 58 } 59 operator >=(const CommandHandlerKey & rhs) const60bool CommandHandlerKey::operator>=(const CommandHandlerKey& rhs) const 61 { 62 return !(*this < rhs); 63 } 64 operator ==(const CommandHandlerKey & rhs) const65bool CommandHandlerKey::operator==(const CommandHandlerKey& rhs) const 66 { 67 return m_FamilyId == rhs.m_FamilyId && m_PacketId == rhs.m_PacketId && m_Version == rhs.m_Version; 68 } 69 operator !=(const CommandHandlerKey & rhs) const70bool CommandHandlerKey::operator!=(const CommandHandlerKey& rhs) const 71 { 72 return !(*this == rhs); 73 } 74 75 } // namespace pipe 76 77 } // namespace arm 78