blob: 61d54a389e95c1d5e5d03e1fd50518b9591c655f [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#include "ParameterAccessContext.h"
26
27#define base CErrorContext
28
Frédéric Boisnard150407c2013-03-15 14:46:23 +010029CParameterAccessContext::CParameterAccessContext(string& strError,
30 CParameterBlackboard* pParameterBlackboard,
31 bool bValueSpaceIsRaw,
32 bool bOutputRawFormatIsHex,
33 uint32_t uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010034 : base(strError), _pParameterBlackboard(pParameterBlackboard),
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020035 _bValueSpaceIsRaw(bValueSpaceIsRaw), _bOutputRawFormatIsHex(bOutputRawFormatIsHex),
Frédéric Boisnard150407c2013-03-15 14:46:23 +010036 _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(uiBaseOffset)
Patrick Benavoli68a91282011-08-31 11:23:23 +020037{
38}
39
Frédéric Boisnard150407c2013-03-15 14:46:23 +010040CParameterAccessContext::CParameterAccessContext(string& strError,
41 bool bBigEndianSubsystem,
42 CParameterBlackboard* pParameterBlackboard,
43 uint32_t uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010044 : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(false),
Frédéric Boisnard150407c2013-03-15 14:46:23 +010045 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(false),
46 _uiBaseOffset(uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010047{
48}
49
50CParameterAccessContext::CParameterAccessContext(string& strError)
51 : base(strError), _pParameterBlackboard(NULL), _bValueSpaceIsRaw(false),
Frédéric Boisnard150407c2013-03-15 14:46:23 +010052 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(0)
Patrick Benavoli68a91282011-08-31 11:23:23 +020053{
54}
55
56// ParameterBlackboard
57CParameterBlackboard* CParameterAccessContext::getParameterBlackboard()
58{
59 return _pParameterBlackboard;
60}
61
62void CParameterAccessContext::setParameterBlackboard(CParameterBlackboard* pBlackboard)
63{
64 _pParameterBlackboard = pBlackboard;
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010065 _uiBaseOffset = 0;
66}
67
68// Base offset for blackboard access
69void CParameterAccessContext::setBaseOffset(uint32_t uiBaseOffset)
70{
71 _uiBaseOffset = uiBaseOffset;
72}
73
74uint32_t CParameterAccessContext::getBaseOffset() const
75{
76 return _uiBaseOffset;
Patrick Benavoli68a91282011-08-31 11:23:23 +020077}
78
79// Value Space
80void CParameterAccessContext::setValueSpaceRaw(bool bIsRaw)
81{
82 _bValueSpaceIsRaw = bIsRaw;
83}
84
85bool CParameterAccessContext::valueSpaceIsRaw() const
86{
87 return _bValueSpaceIsRaw;
88}
89
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020090// Output Raw Format for user get value interpretation
91void CParameterAccessContext::setOutputRawFormat(bool bIsHex)
92{
93 _bOutputRawFormatIsHex = bIsHex;
94}
95
96bool CParameterAccessContext::outputRawFormatIsHex()
97{
98 return _bOutputRawFormatIsHex;
99}
100
Patrick Benavoli68a91282011-08-31 11:23:23 +0200101// Endianness
102void CParameterAccessContext::setBigEndianSubsystem(bool bBigEndian)
103{
104 _bBigEndianSubsystem = bBigEndian;
105}
106
107bool CParameterAccessContext::isBigEndianSubsystem() const
108{
109 return _bBigEndianSubsystem;
110}
111
112// Automatic synchronization to HW
113void CParameterAccessContext::setAutoSync(bool bAutoSync)
114{
115 _bAutoSync = bAutoSync;
116}
117
118bool CParameterAccessContext::getAutoSync() const
119{
Patrick Benavoli065264a2011-11-20 15:46:41 +0100120 return _bAutoSync;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200121}