blob: 5b61d3ba3b880c8aea7a20c3c32a0da9c9fb94ae [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;
47 typedef list<const CConfigurableDomain*>::const_iterator ConfigurableDomainListConstIterator;
48public:
49 CConfigurableElement(const string& strName);
50 virtual ~CConfigurableElement();
51
52 // Offset in main blackboard
53 void setOffset(uint32_t uiOffset);
54 uint32_t getOffset() const;
55
56 // Allocation
57 virtual uint32_t getFootPrint() const;
58
59 // Syncer set (me, ascendant or descendant ones)
60 void fillSyncerSet(CSyncerSet& syncerSet) const;
61
62 // Belonging domain
63 bool belongsTo(const CConfigurableDomain* pConfigurableDomain) const;
64
65 // Belonging domains
66 void listBelongingDomains(string& strResult, bool bVertical = true) const;
67
68 // Matching check for domain association
69 bool hasNoDomainAssociated() const;
70
71 // Matching check for no valid associated domains
72 bool hasNoValidDomainAssociated() const;
73
74 // Owning domains
75 void listAssociatedDomains(string& strResult, bool bVertical = true) const;
76 uint32_t getBelongingDomainCount() const;
77
78 // Elements with no domains
79 void listRogueElements(string& strResult) const;
80
81 // Parameter access
82 virtual bool setValue(CPathNavigator& pathNavigator, const string& strValue, CErrorContext& errorContext) const;
83 virtual bool getValue(CPathNavigator& pathNavigator, string& strValue, CErrorContext& errorContext) const;
84 // Used for simulation only
85 virtual void setDefaultValues(CParameterAccessContext& parameterAccessContext) const;
86
87 // XML configuration settings parsing
88 virtual bool serializeXmlSettings(CXmlElement& xmlConfigurableElementSettingsElement, CConfigurationAccessContext& configurationAccessContext) const;
89protected:
90 // Syncer (me or ascendant)
91 virtual ISyncer* getSyncer() const;
92 // Syncer set (descendant)
93 virtual void fillSyncerSetFromDescendant(CSyncerSet& syncerSet) const;
94 // Configuration Domain local search
95 bool containsConfigurableDomain(const CConfigurableDomain* pConfigurableDomain) const;
96private:
97 // Configurable domain association
98 void addAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain);
99 void removeAttachedConfigurableDomain(const CConfigurableDomain* pConfigurableDomain);
100
101 // Belonging domain ascending search
102 bool belongsToDomainAscending(const CConfigurableDomain* pConfigurableDomain) const;
103
104 // Belonging domains
105 void getBelongingDomains(list<const CConfigurableDomain*>& configurableDomainList) const;
106 void listDomains(const list<const CConfigurableDomain*>& configurableDomainList, string& strResult, bool bVertical) const;
107
108 // Belonging subsystem
109 virtual const CSubsystem* getBelongingSubsystem() const;
110
111 // Check parent is still of current type (by structure knowledge)
112 bool isOfConfigurableElementType(const CElement* pParent) const;
113
114 // Offset in main blackboard
115 uint32_t _uiOffset;
116
117 // Associated configurable domains
118 list<const CConfigurableDomain*> _configurableDomainList;
119};
120