diff options
author | crgeddes <crgeddes@us.ibm.com> | 2016-06-10 16:08:08 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-15 14:23:47 -0400 |
commit | e0c250ea7ea03358d44519a52665fd371a8167fa (patch) | |
tree | 037173fb2efe0bd50ce474e986cd301cc2ee095f /src/include/usr/fapi2 | |
parent | 325c221ac4d716b0acb147c54729782a41ebe85d (diff) | |
download | talos-hostboot-e0c250ea7ea03358d44519a52665fd371a8167fa.tar.gz talos-hostboot-e0c250ea7ea03358d44519a52665fd371a8167fa.zip |
Implement < operator to fapi2::target's platform implementation
This is needed for doing lookup operations on a vector of fapi2
targets.
Change-Id: I941b0f1e95507f506f9735739c95685afa371083
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25682
Tested-by: Jenkins Server
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: FSP CI Jenkins
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/fapi2')
-rw-r--r-- | src/include/usr/fapi2/target.H | 23 |
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 |