blob: 66b20c57cc579cd81eb2731d1ed2b8abf577ac12 [file] [log] [blame]
Francis Murtagh1f7db452019-08-14 09:49:34 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "CommandHandlerKey.hpp"
7
Aron Virginas-Tare898db92019-08-22 12:56:34 +01008namespace armnn
9{
10
11namespace profiling
12{
13
Francis Murtagh1f7db452019-08-14 09:49:34 +010014uint32_t CommandHandlerKey::GetPacketId() const
15{
16 return m_PacketId;
17}
18
19uint32_t CommandHandlerKey::GetVersion() const
20{
21 return m_Version;
22}
23
24bool CommandHandlerKey::operator<(const CommandHandlerKey& rhs) const
25{
26 bool result = true;
27
28 if (m_PacketId == rhs.m_PacketId)
29 {
30 result = m_Version < rhs.m_Version;
31 }
32 else if (m_PacketId > rhs.m_PacketId)
33 {
34 result = false;
35 }
36
37 return result;
38}
39
40bool CommandHandlerKey::operator>(const CommandHandlerKey& rhs) const
41{
42 return rhs < *this;
43}
44
45bool CommandHandlerKey::operator<=(const CommandHandlerKey& rhs) const
46{
47 return !(*this > rhs);
48}
49
50bool CommandHandlerKey::operator>=(const CommandHandlerKey& rhs) const
51{
52 return !(*this < rhs);
53}
54
55bool CommandHandlerKey::operator==(const CommandHandlerKey& rhs) const
56{
57 return m_PacketId == rhs.m_PacketId && m_Version == rhs.m_Version;
58}
59
60bool CommandHandlerKey::operator!=(const CommandHandlerKey& rhs) const
61{
62 return !(*this == rhs);
63}
Aron Virginas-Tare898db92019-08-22 12:56:34 +010064
65} // namespace profiling
66
67} // namespace armnn