blob: 9ebd83fbec5f53b585bc0f623561fbd0583c9042 [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
Patrick Benavoli065264a2011-11-20 15:46:41 +010029CParameterAccessContext::CParameterAccessContext(string& strError, CParameterBlackboard* pParameterBlackboard, bool bValueSpaceIsRaw, bool bOutputRawFormatIsHex)
30 : base(strError), _pParameterBlackboard(pParameterBlackboard),
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020031 _bValueSpaceIsRaw(bValueSpaceIsRaw), _bOutputRawFormatIsHex(bOutputRawFormatIsHex),
Patrick Benavoli065264a2011-11-20 15:46:41 +010032 _bBigEndianSubsystem(false), _bAutoSync(true)
Patrick Benavoli68a91282011-08-31 11:23:23 +020033{
34}
35
Patrick Benavoli065264a2011-11-20 15:46:41 +010036CParameterAccessContext::CParameterAccessContext(string& strError, bool bBigEndianSubsystem, CParameterBlackboard* pParameterBlackboard)
37 : base(strError), _pParameterBlackboard(pParameterBlackboard), _bValueSpaceIsRaw(false),
38 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(bBigEndianSubsystem), _bAutoSync(true)
39{
40}
41
42CParameterAccessContext::CParameterAccessContext(string& strError)
43 : base(strError), _pParameterBlackboard(NULL), _bValueSpaceIsRaw(false),
44 _bOutputRawFormatIsHex(false), _bBigEndianSubsystem(false), _bAutoSync(true)
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;
57}
58
59// Value Space
60void CParameterAccessContext::setValueSpaceRaw(bool bIsRaw)
61{
62 _bValueSpaceIsRaw = bIsRaw;
63}
64
65bool CParameterAccessContext::valueSpaceIsRaw() const
66{
67 return _bValueSpaceIsRaw;
68}
69
Patrick Benavoli6ba361d2011-08-31 11:23:24 +020070// Output Raw Format for user get value interpretation
71void CParameterAccessContext::setOutputRawFormat(bool bIsHex)
72{
73 _bOutputRawFormatIsHex = bIsHex;
74}
75
76bool CParameterAccessContext::outputRawFormatIsHex()
77{
78 return _bOutputRawFormatIsHex;
79}
80
Patrick Benavoli68a91282011-08-31 11:23:23 +020081// Endianness
82void CParameterAccessContext::setBigEndianSubsystem(bool bBigEndian)
83{
84 _bBigEndianSubsystem = bBigEndian;
85}
86
87bool CParameterAccessContext::isBigEndianSubsystem() const
88{
89 return _bBigEndianSubsystem;
90}
91
92// Automatic synchronization to HW
93void CParameterAccessContext::setAutoSync(bool bAutoSync)
94{
95 _bAutoSync = bAutoSync;
96}
97
98bool CParameterAccessContext::getAutoSync() const
99{
Patrick Benavoli065264a2011-11-20 15:46:41 +0100100 return _bAutoSync;
Patrick Benavoli68a91282011-08-31 11:23:23 +0200101}