Kevin Rocard | 93250d1 | 2012-07-19 17:48:30 +0200 | [diff] [blame] | 1 | /* |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 2 | * 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 Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 22 | * CREATED: 2011-06-01 |
| 23 | * UPDATED: 2011-07-27 |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 24 | */ |
| 25 | #include "ParameterAccessContext.h" |
| 26 | |
| 27 | #define base CErrorContext |
| 28 | |
Frédéric Boisnard | 150407c | 2013-03-15 14:46:23 +0100 | [diff] [blame^] | 29 | CParameterAccessContext::CParameterAccessContext(string& strError, |
| 30 | CParameterBlackboard* pParameterBlackboard, |
| 31 | bool bValueSpaceIsRaw, |
| 32 | bool bOutputRawFormatIsHex, |
| 33 | uint32_t uiBaseOffset) |
Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 34 | : base(strError), _pParameterBlackboard(pParameterBlackboard), |
Patrick Benavoli | 6ba361d | 2011-08-31 11:23:24 +0200 | [diff] [blame] | 35 | _bValueSpaceIsRaw(bValueSpaceIsRaw), _bOutputRawFormatIsHex(bOutputRawFormatIsHex), |
Frédéric Boisnard | 150407c | 2013-03-15 14:46:23 +0100 | [diff] [blame^] | 36 | _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(uiBaseOffset) |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 37 | { |
| 38 | } |
| 39 | |
Frédéric Boisnard | 150407c | 2013-03-15 14:46:23 +0100 | [diff] [blame^] | 40 | CParameterAccessContext::CParameterAccessContext(string& strError, |
| 41 | bool bBigEndianSubsystem, |
| 42 | CParameterBlackboard* pParameterBlackboard, |
| 43 | uint32_t uiBaseOffset) |
Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 44 | : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(false), |
Frédéric Boisnard | 150407c | 2013-03-15 14:46:23 +0100 | [diff] [blame^] | 45 | _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(false), |
| 46 | _uiBaseOffset(uiBaseOffset) |
Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 47 | { |
| 48 | } |
| 49 | |
| 50 | CParameterAccessContext::CParameterAccessContext(string& strError) |
| 51 | : base(strError), _pParameterBlackboard(NULL), _bValueSpaceIsRaw(false), |
Frédéric Boisnard | 150407c | 2013-03-15 14:46:23 +0100 | [diff] [blame^] | 52 | _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(false), _uiBaseOffset(0) |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 53 | { |
| 54 | } |
| 55 | |
| 56 | // ParameterBlackboard |
| 57 | CParameterBlackboard* CParameterAccessContext::getParameterBlackboard() |
| 58 | { |
| 59 | return _pParameterBlackboard; |
| 60 | } |
| 61 | |
| 62 | void CParameterAccessContext::setParameterBlackboard(CParameterBlackboard* pBlackboard) |
| 63 | { |
| 64 | _pParameterBlackboard = pBlackboard; |
Frédéric Boisnard | 6bc17c0 | 2013-02-25 15:55:47 +0100 | [diff] [blame] | 65 | _uiBaseOffset = 0; |
| 66 | } |
| 67 | |
| 68 | // Base offset for blackboard access |
| 69 | void CParameterAccessContext::setBaseOffset(uint32_t uiBaseOffset) |
| 70 | { |
| 71 | _uiBaseOffset = uiBaseOffset; |
| 72 | } |
| 73 | |
| 74 | uint32_t CParameterAccessContext::getBaseOffset() const |
| 75 | { |
| 76 | return _uiBaseOffset; |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | // Value Space |
| 80 | void CParameterAccessContext::setValueSpaceRaw(bool bIsRaw) |
| 81 | { |
| 82 | _bValueSpaceIsRaw = bIsRaw; |
| 83 | } |
| 84 | |
| 85 | bool CParameterAccessContext::valueSpaceIsRaw() const |
| 86 | { |
| 87 | return _bValueSpaceIsRaw; |
| 88 | } |
| 89 | |
Patrick Benavoli | 6ba361d | 2011-08-31 11:23:24 +0200 | [diff] [blame] | 90 | // Output Raw Format for user get value interpretation |
| 91 | void CParameterAccessContext::setOutputRawFormat(bool bIsHex) |
| 92 | { |
| 93 | _bOutputRawFormatIsHex = bIsHex; |
| 94 | } |
| 95 | |
| 96 | bool CParameterAccessContext::outputRawFormatIsHex() |
| 97 | { |
| 98 | return _bOutputRawFormatIsHex; |
| 99 | } |
| 100 | |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 101 | // Endianness |
| 102 | void CParameterAccessContext::setBigEndianSubsystem(bool bBigEndian) |
| 103 | { |
| 104 | _bBigEndianSubsystem = bBigEndian; |
| 105 | } |
| 106 | |
| 107 | bool CParameterAccessContext::isBigEndianSubsystem() const |
| 108 | { |
| 109 | return _bBigEndianSubsystem; |
| 110 | } |
| 111 | |
| 112 | // Automatic synchronization to HW |
| 113 | void CParameterAccessContext::setAutoSync(bool bAutoSync) |
| 114 | { |
| 115 | _bAutoSync = bAutoSync; |
| 116 | } |
| 117 | |
| 118 | bool CParameterAccessContext::getAutoSync() const |
| 119 | { |
Patrick Benavoli | 065264a | 2011-11-20 15:46:41 +0100 | [diff] [blame] | 120 | return _bAutoSync; |
Patrick Benavoli | 68a9128 | 2011-08-31 11:23:23 +0200 | [diff] [blame] | 121 | } |