From c6885d24740b8491bd927feeb7c4688368dbf5a2 Mon Sep 17 00:00:00 2001 From: Andres Lugo-Reyes Date: Thu, 19 May 2016 13:06:17 -0500 Subject: add platform support for fapi2::Target.isFunctional() Change-Id: I265f34327c5bd593ee1d6f13f6cd19d191db66fd RTC:154321 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24991 Reviewed-by: Daniel M. Crowell Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes Reviewed-by: Matt Derksen Reviewed-by: William G. Hoffa --- src/include/usr/fapi2/target.H | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/include/usr/fapi2') diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H index 5912f6045..255f66dd5 100644 --- a/src/include/usr/fapi2/target.H +++ b/src/include/usr/fapi2/target.H @@ -487,7 +487,7 @@ inline Target Target::getParent(void) const TARGETING::UTIL_FILTER_ALL); } - assert(l_parentList.size() == 1, "Found %d parents of the same type. Target HUID %x , \ + assert(l_parentList.size() == 1, "Found %d parents of the same type. Target HUID %x ,\ looking for parents of type %x", l_parentList.size(), TARGETING::get_huid(this->get()) , requiredPType); TARGETING::Target * l_parentTarget = l_parentList[0]; @@ -845,6 +845,18 @@ Target::getOtherEnd(fapi2::Target& o_target, } +/// +/// @brief Determine whether the target is functional or not +/// @return true if the target is functional, false otherwise +/// +template< TargetType K, typename V > +inline bool Target< K, V >::isFunctional(void) const +{ + TARGETING::PredicateIsFunctional l_functional; + return l_functional(static_cast(this->get())); +} + + /// /// @brief Return the string interpretation of this target /// @tparam T The type of the target -- cgit v1.2.3