blob: 05e3cc3bdba9547fc1e6df98de8ebd81f742b150 [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 Boisnard6bc17c02013-02-25 15:55:47 +010029CParameterAccessContext::CParameterAccessContext(string& strError, CParameterBlackboard* pParameterBlackboard, bool bValueSpaceIsRaw, bool bOutputRawFormatIsHex, uint32_t uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010030 : base(strError), _pParameterBlackboard(pParameterBlackboard),
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020031 _bValueSpaceIsRaw(bValueSpaceIsRaw), _bOutputRawFormatIsHex(bOutputRawFormatIsHex),
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010032 _bBigEndianSubsystem(false), _bAutoSync(true), _uiBaseOffset(uiBaseOffset)
Patrick Benavoli68a91282011-08-31 11:23:23 +020033{
34}
35
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010036CParameterAccessContext::CParameterAccessContext(string& strError, bool bBigEndianSubsystem, CParameterBlackboard* pParameterBlackboard, uint32_t uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010037 : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(false),
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010038 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(true), _uiBaseOffset(uiBaseOffset)
Patrick Benavoli065264a2011-11-20 15:46:41 +010039{
40}
41
42CParameterAccessContext::CParameterAccessContext(string& strError)
43 : base(strError), _pParameterBlackboard(NULL), _bValueSpaceIsRaw(false),
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010044 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(true), _uiBaseOffset(0)
Patrick Benavoli68a91282011-08-31 11:23:23 +020045{
46}
47
48// ParameterBlackboard
49CParameterBlackboard* CParameterAccessContext::getParameterBlackboard()
50{
51 return _pParameterBlackboard;
52}
53
54void CParameterAccessContext::setParameterBlackboard(CParameterBlackboard* pBlackboard)
55{
56 _pParameterBlackboard = pBlackboard;
Frédéric Boisnard6bc17c02013-02-25 15:55:47 +010057 _uiBaseOffset = 0;
58}
59
60// Base offset for blackboard access
61void CParameterAccessContext::setBaseOffset(uint32_t uiBaseOffset)
62{
63 _uiBaseOffset = uiBaseOffset;
64}
65
66uint32_t CParameterAccessContext::getBaseOffset() const
67{
68 return _uiBaseOffset;
Patrick Benavoli68a91282011-08-31 11:23:23 +020069}
70
71// Value Space
72void CParameterAccessContext::setValueSpaceRaw(bool bIsRaw)
73{
74 _bValueSpaceIsRaw = bIsRaw;
75}
76
77bool CParameterAccessContext::valueSpaceIsRaw() const
78{
79 return _bValueSpaceIsRaw;
80}
81
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020082// Output Raw Format for user get value interpretation
83void CParameterAccessContext::setOutputRawFormat(bool bIsHex)
84{
85 _bOutputRawFormatIsHex = bIsHex;
86}
87
88bool CParameterAccessContext::outputRawFormatIsHex()
89{
90 return _bOutputRawFormatIsHex;
91}
92
Patrick Benavoli68a91282011-08-31 11:23:23 +020093// Endianness
94void CParameterAccessContext::setBigEndianSubsystem(bool bBigEndian)
95{
96 _bBigEndianSubsystem = bBigEndian;
97}
98
99bool CParameterAccessContext::isBigEndianSubsystem() const
100{
101 return _bBigEndianSubsystem;
102}
103
104// Automatic synchronization to HW
105void CParameterAccessContext::setAutoSync(bool bAutoSync)
106{
107 _bAutoSync = bAutoSync;
108}
109
110bool CParameterAccessContext::getAutoSync() const
111{
Patrick Benavoli065264a2011-11-20 15:46:41 +0100112 return _bAutoSync;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200113}