summaryrefslogtreecommitdiffstats
path: root/src/include/usr/fapi2
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/fapi2')
-rw-r--r--src/include/usr/fapi2/target.H23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H
index 756b1d85f..3aa7e9342 100644
--- a/src/include/usr/fapi2/target.H
+++ b/src/include/usr/fapi2/target.H
@@ -109,8 +109,9 @@ Target<K, V>& Target<K, V>::operator=(const Target& i_right)
/// @tparam V the type of the target's Value
/// @param[in] i_right Reference to Target to compare.
/// @return bool. True if equal.
-/// @note Platforms need to define this so that the physical
-/// targets are determined to be equivilent rather than just the handles
+/// @note This platform uses handles for comparison as
+/// target handles are statically defined so the order
+/// is consistent.
///
template<TargetType K, typename V>
bool Target<K, V>::operator==(const Target& i_right) const
@@ -122,13 +123,27 @@ bool Target<K, V>::operator==(const Target& i_right) const
/// @tparam V the type of the target's Value
/// @param[in] i_right Reference to Target to compare.
/// @return bool. True if not equal.
-/// @note Platforms need to define this so that the physical
-/// targets are determined to be equivilent rather than just the handles
+/// @note This platform uses handles for comparison as
+/// target handles are statically defined so the order
+/// is consistent.
///
template<TargetType K, typename V>
bool Target<K, V>::operator!=(const Target& i_right) const
{ return i_right.iv_handle != iv_handle; }
+///
+/// @brief Less Than Comparison Operator
+/// @param[in] i_right Reference to Target to compare.
+/// @return bool. True if less than i_right
+/// @note This platform uses handles for comparison as
+/// target handles are statically defined so the order
+/// is consistent.
+///
+template<TargetType K, typename V>
+bool Target<K, V>::operator<(const Target& i_right) const
+{
+ return iv_handle < i_right.iv_handle;
+}
///
/// @brief This function takes in a FAPI2 Type and returns the corresponding
OpenPOWER on IntegriCloud