[PFW] Access Configurations directly

BZ: 88357

This patch aims to enable direct access to Configurations
without using the main blackboard. 2 additional commands are
available:
- getConfigurationParameter <domain> <configuration> <param path>:
Get value for parameter at given path from configuration.
- setConfigurationParameter <domain> <configuration> <param path> <value>
Set value for parameter at given path to configuration.

Change-Id: I9357ba5141feee558fa3f7c10f62db14406433b6
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Reviewed-on: http://android.intel.com:8080/92325
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp
index 6d1c19c..8a497fd 100644
--- a/parameter/ConfigurableDomain.cpp
+++ b/parameter/ConfigurableDomain.cpp
@@ -1,4 +1,4 @@
-/* 
+/*
  * INTEL CONFIDENTIAL
  * Copyright © 2011 Intel 
  * Corporation All Rights Reserved.
@@ -372,6 +372,64 @@
     return true;
 }
 
+/**
+* Blackboard Configuration and Base Offset retrieval.
+*
+* This method fetches the Blackboard associated to the ConfigurableElement
+* given in parameter, for a specific Configuration. The ConfigurableElement
+* must belong to the Domain. If a Blackboard is found, the base offset of
+* the ConfigurableElement is returned as well. This base offset corresponds to
+* the offset of the ancestor of the ConfigurableElement associated to the Configuration.
+*
+* @param[in] strConfiguration                           Name of the Configuration.
+* @param[in] pCandidateDescendantConfigurableElement    Pointer to a CConfigurableElement that
+*                                                       belongs to the Domain.
+* @param[out] uiBaseOffset                              The base offset of the CConfigurableElement.
+* @param[out] bIsLastApplied                            Boolean indicating that the Configuration is
+*                                                       the last one applied of the Domain.
+* @param[out] strError                                  Error message
+*
+* return Pointer to the Blackboard of the Configuration.
+*/
+CParameterBlackboard* CConfigurableDomain::findConfigurationBlackboard(const string& strConfiguration,
+                                                                       const CConfigurableElement* pCandidateDescendantConfigurableElement,
+                                                                       uint32_t& uiBaseOffset,
+                                                                       bool& bIsLastApplied,
+                                                                       string& strError) const
+{
+    // Find Configuration
+    const CDomainConfiguration* pDomainConfiguration = static_cast<const CDomainConfiguration*>(findChild(strConfiguration));
+
+    if (!pDomainConfiguration) {
+
+        strError = "Domain configuration " + strConfiguration + " not found";
+
+        return NULL;
+    }
+
+    // Parse all configurable elements
+    ConfigurableElementListIterator it;
+
+    for (it = _configurableElementList.begin(); it != _configurableElementList.end(); ++it) {
+
+        const CConfigurableElement* pAssociatedConfigurableElement = *it;
+
+        // Check if the the associated element is the configurable element or one of its ancestors
+        if ((pCandidateDescendantConfigurableElement == pAssociatedConfigurableElement) ||
+            (pCandidateDescendantConfigurableElement->isDescendantOf(pAssociatedConfigurableElement))) {
+
+            uiBaseOffset = pAssociatedConfigurableElement->getOffset();
+            bIsLastApplied = (pDomainConfiguration == _pLastAppliedConfiguration);
+
+            return pDomainConfiguration->getBlackboard(pAssociatedConfigurableElement);
+        }
+    }
+
+    strError = "Element not associated to the Domain";
+
+    return NULL;
+}
+
 // Domain splitting
 bool CConfigurableDomain::split(CConfigurableElement* pConfigurableElement, string& strError)
 {