blob: 41e33bf764aac767c03bb7d31c7fcca87a551bd5 [file] [log] [blame]
Patrick Benavoli68a91282011-08-31 11:23:23 +02001/* <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
37class CConfigurableDomain;
38class CSyncerSet;
39class ISyncer;
40class CSubsystem;
41class CConfigurationAccessContext;
42class CParameterAccessContext;
43
44class CConfigurableElement : public CElement
45{
46 friend class CConfigurableDomain;
Patrick Benavoli63499d42011-10-24 18:50:03 +020047 friend class CDomainConfiguration;
Patrick Benavoli68a91282011-08-31 11:23:23 +020048 typedef list<const CConfigurableDomain*>::const_iterator ConfigurableDomainListConstIterator;
49public:
Patrick Benavoli95ac0342011-11-07 20:32:51 +010050 CConfigurableElement(const string& strName = "");
Patrick Benavoli68a91282011-08-31 11:23:23 +020051 virtual ~CConfigurableElement();
52
53 // Offset in main blackboard
54 void setOffset(uint32_t uiOffset);
55 uint32_t getOffset() const;
56
57 // Allocation
58 virtual uint32_t getFootPrint() const;
59
60 // Syncer set (me, ascendant or descendant ones)
61 void fillSyncerSet(CSyncerSet& syncerSet) const;
62
63 // Belonging domain
64 bool belongsTo(const CConfigurableDomain* pConfigurableDomain) const;
65
66 // Belonging domains
67 void listBelongingDomains(string& strResult, bool bVertical = true) const;
68
69 // Matching check for domain association
70 bool hasNoDomainAssociated() const;
71
72 // Matching check for no valid associated domains
73 bool hasNoValidDomainAssociated() const;
74
75 // Owning domains
76 void listAssociatedDomains(string& strResult, bool bVertical = true) const;
77 uint32_t getBelongingDomainCount() const;
78
79 // Elements with no domains
80 void listRogueElements(string& strResult) const;
81
Patrick Benavoli4bed9212011-10-27 14:18:00 +020082 // Belonging to no domains
83 bool isRogue() const;
84
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020085 // Footprint as string
86 string getFootprintAsString() const;
87
Patrick Benavoli065264a2011-11-20 15:46:41 +010088 // Belonging subsystem
89 virtual const CSubsystem* getBelongingSubsystem() const;
90
91 // Check element is a parameter
92 virtual bool isParameter() const;
93
Patrick Benavoli68a91282011-08-31 11:23:23 +020094 // Parameter access
Patrick Benavoli065264a2011-11-20 15:46:41 +010095 virtual bool accessValue(CPathNavigator& pathNavigator, string& strValue, bool bSet, CParameterAccessContext& parameterAccessContext) const;
Patrick Benavoli6ccab9d2011-11-10 23:21:01 +010096 // Used for simulation and virtual subsystems
Patrick Benavoli68a91282011-08-31 11:23:23 +020097 virtual void setDefaultValues(CParameterAccessContext& parameterAccessContext) const;
98
Patrick Benavoli2ecf9002011-08-31 11:23:24 +020099 // Element properties
100 virtual void showProperties(string& strResult) const;
101
Patrick Benavoli68a91282011-08-31 11:23:23 +0200102 // XML configuration settings parsing
Patrick Benavoli6ba361d2011-08-31 11:23:24 +0200103 virtual bool serializeXmlSettings(CXmlElement& xmlConfigurationSettingsElementContent, CConfigurationAccessContext& configurationAccessContext) const;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200104protected:
105 // Syncer (me or ascendant)
106 virtual ISyncer* getSyncer() const;
107 // Syncer set (descendant)
108 virtual void fillSyncerSetFromDescendant(CSyncerSet& syncerSet) const;
109 // Configuration Domain local search
110 bool containsConfigurableDomain(const CConfigurableDomain* pConfigurableDomain) const;
111private:
112 // Configurable domain association
113 void addAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain);
114 void removeAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain);
115
116 // Belonging domain ascending search
117 bool belongsToDomainAscending(const CConfigurableDomain* pConfigurableDomain) const;
118
119 // Belonging domains
120 void getBelongingDomains(list<const CConfigurableDomain*>& configurableDomainList) const;
121 void listDomains(const list<const CConfigurableDomain*>& configurableDomainList, string& strResult, bool bVertical) const;
122
Patrick Benavoli68a91282011-08-31 11:23:23 +0200123 // Check parent is still of current type (by structure knowledge)
124 bool isOfConfigurableElementType(const CElement* pParent) const;
125
126 // Offset in main blackboard
127 uint32_t _uiOffset;
128
129 // Associated configurable domains
130 list<const CConfigurableDomain*> _configurableDomainList;
131};
132