blob: e27ad4b4fbe9527a8580009b3120f51ea0726f1c [file] [log] [blame]
Kevin Rocard93250d12012-07-19 17:48:30 +02001/*
Patrick Benavoli68a91282011-08-31 11:23:23 +02002 * 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 Benavoli68a91282011-08-31 11:23:23 +020022 * CREATED: 2011-06-01
23 * UPDATED: 2011-07-27
Patrick Benavoli68a91282011-08-31 11:23:23 +020024 */
25#pragma once
26
27#include "ConfigurableElement.h"
28#include "TypeElement.h"
29
30class IMapper;
31class CParameterBlackboard;
32class CParameterAccessContext;
33
34class CInstanceConfigurableElement : public CConfigurableElement
35{
36public:
37 enum Type {
38 EBitParameter,
39 EBitParameterBlock,
40 EParameter,
Patrick Benavoli1352ae52011-10-21 16:48:04 +020041 EStringParameter,
Patrick Benavoli68a91282011-08-31 11:23:23 +020042 EParameterBlock,
43 EComponent
44 };
45
46 CInstanceConfigurableElement(const string& strName, const CTypeElement* pTypeElement);
47
48 // Instantiated type
49 const CTypeElement* getTypeElement() const;
50
51 // Mapping info
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020052 bool getMappingData(const string& strKey, const string*& pStrValue) const;
Patrick Benavoli68a91282011-08-31 11:23:23 +020053
54 // From CElement
55 virtual string getKind() const;
56
57 // Syncer to/from HW
58 void setSyncer(ISyncer* pSyncer);
59 void unsetSyncer();
60
61 // Type
62 virtual Type getType() const = 0;
63
64 // Mapping execution
65 bool map(IMapper& mapper, string& strError);
Patrick Benavoli2ecf9002011-08-31 11:23:24 +020066
67 // Element properties
68 virtual void showProperties(string& strResult) const;
Patrick Benavoli065264a2011-11-20 15:46:41 +010069
70 // Scalar or Array?
71 bool isScalar() const;
72
73 // Array Length
74 uint32_t getArrayLength() const;
Patrick Benavoli68a91282011-08-31 11:23:23 +020075protected:
76 // Syncer
77 virtual ISyncer* getSyncer() const;
78 // Syncer set (descendant)
79 virtual void fillSyncerSetFromDescendant(CSyncerSet& syncerSet) const;
80 // Sync
81 bool sync(CParameterAccessContext& parameterAccessContext) const;
82 // Check parameter access path well formed for leaf elements
83 static bool checkPathExhausted(CPathNavigator& pathNavigator, CErrorContext& errorContext);
84private:
85 // Type Element
86 const CTypeElement* _pTypeElement;
87
88 // Sync to HW
89 ISyncer* _pSyncer;
90};
91