aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/CommandHandlerKey.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/CommandHandlerKey.cpp')
-rw-r--r--src/profiling/CommandHandlerKey.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/profiling/CommandHandlerKey.cpp b/src/profiling/CommandHandlerKey.cpp
new file mode 100644
index 0000000000..6ce73440b8
--- /dev/null
+++ b/src/profiling/CommandHandlerKey.cpp
@@ -0,0 +1,57 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "CommandHandlerKey.hpp"
+
+uint32_t CommandHandlerKey::GetPacketId() const
+{
+ return m_PacketId;
+}
+
+uint32_t CommandHandlerKey::GetVersion() const
+{
+ return m_Version;
+}
+
+bool CommandHandlerKey::operator<(const CommandHandlerKey& rhs) const
+{
+ bool result = true;
+
+ if (m_PacketId == rhs.m_PacketId)
+ {
+ result = m_Version < rhs.m_Version;
+ }
+ else if (m_PacketId > rhs.m_PacketId)
+ {
+ result = false;
+ }
+
+ return result;
+}
+
+bool CommandHandlerKey::operator>(const CommandHandlerKey& rhs) const
+{
+ return rhs < *this;
+}
+
+bool CommandHandlerKey::operator<=(const CommandHandlerKey& rhs) const
+{
+ return !(*this > rhs);
+}
+
+bool CommandHandlerKey::operator>=(const CommandHandlerKey& rhs) const
+{
+ return !(*this < rhs);
+}
+
+bool CommandHandlerKey::operator==(const CommandHandlerKey& rhs) const
+{
+ return m_PacketId == rhs.m_PacketId && m_Version == rhs.m_Version;
+}
+
+bool CommandHandlerKey::operator!=(const CommandHandlerKey& rhs) const
+{
+ return !(*this == rhs);
+}