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