| Kevin Rocard | 93250d1 | 2012-07-19 17:48:30 +0200 | [diff] [blame] | 1 | /* |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 2 | * INTEL CONFIDENTIAL |
| 3 | * Copyright © 2011 Intel |
| 4 | * Corporation All Rights Reserved. |
| 5 | * |
| 6 | * The source code contained or described herein and all documents related to |
| 7 | * the source code ("Material") are owned by Intel Corporation or its suppliers |
| 8 | * or licensors. Title to the Material remains with Intel Corporation or its |
| 9 | * suppliers and licensors. The Material contains trade secrets and proprietary |
| 10 | * and confidential information of Intel or its suppliers and licensors. The |
| 11 | * Material is protected by worldwide copyright and trade secret laws and |
| 12 | * treaty provisions. No part of the Material may be used, copied, reproduced, |
| 13 | * modified, published, uploaded, posted, transmitted, distributed, or |
| 14 | * disclosed in any way without Intel’s prior express written permission. |
| 15 | * |
| 16 | * No license under any patent, copyright, trade secret or other intellectual |
| 17 | * property right is granted to or conferred upon you by disclosure or delivery |
| 18 | * of the Materials, either expressly, by implication, inducement, estoppel or |
| 19 | * otherwise. Any license under such intellectual property rights must be |
| 20 | * express and approved by Intel in writing. |
| 21 | * |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 22 | * CREATED: 2011-06-01 |
| 23 | * UPDATED: 2011-07-27 |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 24 | */ |
| 25 | #pragma once |
| 26 | |
| 27 | #include "Element.h" |
| 28 | |
| 29 | #include <list> |
| 30 | |
| 31 | class CConfigurableDomain; |
| 32 | class CSyncerSet; |
| 33 | class ISyncer; |
| 34 | class CSubsystem; |
| 35 | class CConfigurationAccessContext; |
| 36 | class CParameterAccessContext; |
| Frédéric Boisnard | 9620e44 | 2012-05-30 16:15:02 +0200 | [diff] [blame] | 37 | class CAreaConfiguration; |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 38 | |
| 39 | class CConfigurableElement : public CElement |
| 40 | { |
| 41 | friend class CConfigurableDomain; |
| Patrick Benavoli | 63499d4 | 2011-10-24 18:50:03 +0200 | [diff] [blame] | 42 | friend class CDomainConfiguration; |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 43 | typedef list<const CConfigurableDomain*>::const_iterator ConfigurableDomainListConstIterator; |
| 44 | public: |
| Patrick Benavoli | 95ac034 | 2011-11-07 20:32:51 +0100 | [diff] [blame] | 45 | CConfigurableElement(const string& strName = ""); |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 46 | virtual ~CConfigurableElement(); |
| 47 | |
| 48 | // Offset in main blackboard |
| 49 | void setOffset(uint32_t uiOffset); |
| 50 | uint32_t getOffset() const; |
| 51 | |
| 52 | // Allocation |
| 53 | virtual uint32_t getFootPrint() const; |
| 54 | |
| 55 | // Syncer set (me, ascendant or descendant ones) |
| 56 | void fillSyncerSet(CSyncerSet& syncerSet) const; |
| 57 | |
| 58 | // Belonging domain |
| 59 | bool belongsTo(const CConfigurableDomain* pConfigurableDomain) const; |
| 60 | |
| 61 | // Belonging domains |
| 62 | void listBelongingDomains(string& strResult, bool bVertical = true) const; |
| 63 | |
| 64 | // Matching check for domain association |
| 65 | bool hasNoDomainAssociated() const; |
| 66 | |
| 67 | // Matching check for no valid associated domains |
| 68 | bool hasNoValidDomainAssociated() const; |
| 69 | |
| 70 | // Owning domains |
| 71 | void listAssociatedDomains(string& strResult, bool bVertical = true) const; |
| 72 | uint32_t getBelongingDomainCount() const; |
| 73 | |
| 74 | // Elements with no domains |
| 75 | void listRogueElements(string& strResult) const; |
| 76 | |
| Patrick Benavoli | 4bed921 | 2011-10-27 14:18:00 +0200 | [diff] [blame] | 77 | // Belonging to no domains |
| 78 | bool isRogue() const; |
| 79 | |
| Patrick Benavoli | 6ba361d | 2011-08-31 11:23:24 +0200 | [diff] [blame] | 80 | // Footprint as string |
| 81 | string getFootprintAsString() const; |
| 82 | |
| Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 83 | // Belonging subsystem |
| 84 | virtual const CSubsystem* getBelongingSubsystem() const; |
| 85 | |
| 86 | // Check element is a parameter |
| 87 | virtual bool isParameter() const; |
| 88 | |
| Frédéric Boisnard | 9620e44 | 2012-05-30 16:15:02 +0200 | [diff] [blame] | 89 | // AreaConfiguration creation |
| 90 | virtual CAreaConfiguration* createAreaConfiguration(const CSyncerSet* pSyncerSet) const; |
| 91 | |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 92 | // Parameter access |
| Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 93 | virtual bool accessValue(CPathNavigator& pathNavigator, string& strValue, bool bSet, CParameterAccessContext& parameterAccessContext) const; |
| Frederic Boisnard | 6cae0ec | 2013-05-23 18:48:58 +0200 | [diff] [blame^] | 94 | |
| 95 | /** |
| 96 | * Get the list of all the ancestors that have a mapping. |
| 97 | * |
| 98 | * The mapping is represented as a string of all the mapping data (key:value) defined in the |
| 99 | * context of the element. |
| 100 | * In this class, the method is generic and calls its parent getListOfElementsWithMappings(...) |
| 101 | * method. |
| 102 | * |
| 103 | * @param[in:out] configurableElementPath List of all the ConfigurableElements found |
| 104 | * that have a mapping. Elements are added at the end of the list, so the root Element will be |
| 105 | * the last one. |
| 106 | * |
| 107 | */ |
| 108 | virtual void getListOfElementsWithMapping(list<const CConfigurableElement*>& |
| 109 | configurableElementPath) const; |
| 110 | |
| Patrick Benavoli | 6ccab9d | 2011-11-10 23:21:01 +0100 | [diff] [blame] | 111 | // Used for simulation and virtual subsystems |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 112 | virtual void setDefaultValues(CParameterAccessContext& parameterAccessContext) const; |
| 113 | |
| Patrick Benavoli | 2ecf900 | 2011-08-31 11:23:24 +0200 | [diff] [blame] | 114 | // Element properties |
| 115 | virtual void showProperties(string& strResult) const; |
| 116 | |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 117 | // XML configuration settings parsing |
| Patrick Benavoli | 6ba361d | 2011-08-31 11:23:24 +0200 | [diff] [blame] | 118 | virtual bool serializeXmlSettings(CXmlElement& xmlConfigurationSettingsElementContent, CConfigurationAccessContext& configurationAccessContext) const; |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 119 | protected: |
| 120 | // Syncer (me or ascendant) |
| 121 | virtual ISyncer* getSyncer() const; |
| 122 | // Syncer set (descendant) |
| 123 | virtual void fillSyncerSetFromDescendant(CSyncerSet& syncerSet) const; |
| 124 | // Configuration Domain local search |
| 125 | bool containsConfigurableDomain(const CConfigurableDomain* pConfigurableDomain) const; |
| Frederic Boisnard | 6cae0ec | 2013-05-23 18:48:58 +0200 | [diff] [blame^] | 126 | |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 127 | private: |
| 128 | // Configurable domain association |
| 129 | void addAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain); |
| 130 | void removeAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain); |
| 131 | |
| 132 | // Belonging domain ascending search |
| 133 | bool belongsToDomainAscending(const CConfigurableDomain* pConfigurableDomain) const; |
| 134 | |
| 135 | // Belonging domains |
| 136 | void getBelongingDomains(list<const CConfigurableDomain*>& configurableDomainList) const; |
| 137 | void listDomains(const list<const CConfigurableDomain*>& configurableDomainList, string& strResult, bool bVertical) const; |
| 138 | |
| Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 139 | // Check parent is still of current type (by structure knowledge) |
| 140 | bool isOfConfigurableElementType(const CElement* pParent) const; |
| 141 | |
| 142 | // Offset in main blackboard |
| 143 | uint32_t _uiOffset; |
| 144 | |
| 145 | // Associated configurable domains |
| 146 | list<const CConfigurableDomain*> _configurableDomainList; |
| 147 | }; |
| 148 | |