diff options
| author | Brian Silver <bsilver@us.ibm.com> | 2015-03-04 11:40:08 -0600 |
|---|---|---|
| committer | Joshua Hunsberger <jahunsbe@us.ibm.com> | 2017-10-23 15:50:53 -0500 |
| commit | 2cb6e4bc7949ea1846bb11c8e0f3ced3d7112837 (patch) | |
| tree | afc4092a2da26199b46a8a6e59e9b6adc91f41a8 /import/hwpf | |
| parent | 9d95b4a77423ea74222f3fadbbf0c2a6ca5491a9 (diff) | |
| download | talos-hcode-2cb6e4bc7949ea1846bb11c8e0f3ced3d7112837.tar.gz talos-hcode-2cb6e4bc7949ea1846bb11c8e0f3ced3d7112837.zip | |
Add fapi2::buffer<T>::extractToRight()
Change-Id: I3c9825260e24500c7bb8adc4bb92e154d31b5208
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16157
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Tested-by: Brian Silver <bsilver@us.ibm.com>
Diffstat (limited to 'import/hwpf')
| -rw-r--r-- | import/hwpf/fapi2/include/buffer.H | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/import/hwpf/fapi2/include/buffer.H b/import/hwpf/fapi2/include/buffer.H index 848f032a..dbc20a95 100644 --- a/import/hwpf/fapi2/include/buffer.H +++ b/import/hwpf/fapi2/include/buffer.H @@ -398,24 +398,23 @@ namespace fapi2 return; } -#if 0 /// /// @brief Copy data from this buffer into an OT and right justify - /// @tparam OT the type of the outgoing data - defaults to T - /// @tparam SB Start bit to insert into - defaults to 0 - /// @tparam SS Start bit in o_out - default value is zero - /// @tparam L Length of bits to copy - defaults to sizeof(OT) * 8 + /// @tparam SS Start bit to insert into (source start) + /// @tparam L Length of bits to insert + /// @tparam OT the type of the outgoing (target) /// @param[out] o_out OT to copy into - data is placed right aligned /// @note Asserting that all the parameters are known at /// compile time so this can be templated only. If that is not /// the case we can add a function parameter version. - /// @post Data is copied from specified location to o_out, right - /// aligned. Data is only right aligned if L < sizeof(bits_type) /// - template< typename OT = T, bits_type L = parameterTraits<OT>::bit_length, - bits_type SB = 0, bits_type SS = 0 > - void extractFromRight(OT& o_out); -#endif + template<bits_type SS, bits_type L, typename OT> + inline void extractToRight(OT& o_out) + { + extract<parameterTraits<OT>::bit_length - L, L, SS>(o_out); + return; + } + ///@} }; }; |

