xref: /aosp_15_r20/external/armnn/profiling/common/src/CommandHandlerKey.cpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
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() const14 uint32_t CommandHandlerKey::GetFamilyId() const
15 {
16     return m_FamilyId;
17 }
18 
GetPacketId() const19 uint32_t CommandHandlerKey::GetPacketId() const
20 {
21     return m_PacketId;
22 }
23 
GetVersion() const24 uint32_t CommandHandlerKey::GetVersion() const
25 {
26     return m_Version;
27 }
28 
operator <(const CommandHandlerKey & rhs) const29 bool 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) const50 bool CommandHandlerKey::operator>(const CommandHandlerKey& rhs) const
51 {
52     return rhs < *this;
53 }
54 
operator <=(const CommandHandlerKey & rhs) const55 bool CommandHandlerKey::operator<=(const CommandHandlerKey& rhs) const
56 {
57     return !(*this > rhs);
58 }
59 
operator >=(const CommandHandlerKey & rhs) const60 bool CommandHandlerKey::operator>=(const CommandHandlerKey& rhs) const
61 {
62     return !(*this < rhs);
63 }
64 
operator ==(const CommandHandlerKey & rhs) const65 bool 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) const70 bool CommandHandlerKey::operator!=(const CommandHandlerKey& rhs) const
71 {
72     return !(*this == rhs);
73 }
74 
75 } // namespace pipe
76 
77 } // namespace arm
78