w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkCommandExpect.ipp
Go to the documentation of this file.
1// $Id: RlinkCommandExpect.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-07 1077 1.2.1 SetBlock: add move versions
8// 2015-04-02 661 1.2 expect logic: remove stat from Expect, invert mask
9// 2014-12-20 616 1.1 add Done count methods (for rblk/wblk)
10// 2011-03-12 368 1.0 Initial version
11// 2011-01-15 355 0.1 First draft
12// ---------------------------------------------------------------------------
13
18// all method definitions in namespace Retro
19namespace Retro {
20
21//------------------------------------------+-----------------------------------
23
24inline void RlinkCommandExpect::SetData(uint16_t data, uint16_t datamsk)
25{
26 fDataVal = data;
27 fDataMsk = datamsk;
28 return;
29}
30
31//------------------------------------------+-----------------------------------
33
34inline void RlinkCommandExpect::SetDone(uint16_t done, bool check)
35{
36 fDataVal = done;
37 fDataMsk = check ? 0xffff : 0x0;
38 return;
39}
40
41//------------------------------------------+-----------------------------------
43
44inline void RlinkCommandExpect::SetBlock(const std::vector<uint16_t>& block)
45{
46 fBlockVal = block;
47 fBlockMsk.clear();
48 return;
49}
50
51//------------------------------------------+-----------------------------------
53
54inline void RlinkCommandExpect::SetBlock(std::vector<uint16_t>&& block)
55{
56 fBlockVal = move(block);
57 fBlockMsk.clear();
58 return;
59}
60
61//------------------------------------------+-----------------------------------
63
65 const std::vector<uint16_t>& block,
66 const std::vector<uint16_t>& blockmsk)
67{
68 fBlockVal = block;
69 fBlockMsk = blockmsk;
70 return;
71}
72
73//------------------------------------------+-----------------------------------
75
76inline void RlinkCommandExpect::SetBlock(std::vector<uint16_t>&& block,
77 std::vector<uint16_t>&& blockmsk)
78{
79 fBlockVal = move(block);
80 fBlockMsk = move(blockmsk);
81 return;
82}
83
84//------------------------------------------+-----------------------------------
86
87inline uint16_t RlinkCommandExpect::DataValue() const
88{
89 return fDataVal;
90}
91
92//------------------------------------------+-----------------------------------
94
95inline uint16_t RlinkCommandExpect::DataMask() const
96{
97 return fDataMsk;
98}
99
100//------------------------------------------+-----------------------------------
102
103inline uint16_t RlinkCommandExpect::DoneValue() const
104{
105 return fDataVal;
106}
107
108//------------------------------------------+-----------------------------------
110
111inline const std::vector<uint16_t>& RlinkCommandExpect::BlockValue() const
112{
113 return fBlockVal;
114}
115
116//------------------------------------------+-----------------------------------
118
119inline const std::vector<uint16_t>& RlinkCommandExpect::BlockMask() const
120{
121 return fBlockMsk;
122}
123
124//------------------------------------------+-----------------------------------
126
127inline bool RlinkCommandExpect::DataCheck(uint16_t val) const
128{
129 return (val & fDataMsk) == fDataVal;
130}
131
132//------------------------------------------+-----------------------------------
134
135inline bool RlinkCommandExpect::DoneCheck(uint16_t val) const
136{
137 return !DoneIsChecked() || val == fDataVal;
138}
139
140//------------------------------------------+-----------------------------------
142
144{
145 return fDataMsk != 0x0;
146}
147
148//------------------------------------------+-----------------------------------
150
152{
153 return fDataMsk != 0x0;
154}
155
156} // end namespace Retro
uint16_t DoneValue() const
FIXME_docs.
void SetDone(uint16_t done, bool check=true)
FIXME_docs.
uint16_t DataValue() const
FIXME_docs.
void SetBlock(const std::vector< uint16_t > &block)
FIXME_docs.
std::vector< uint16_t > fBlockVal
block value
std::vector< uint16_t > fBlockMsk
block mask
bool DataIsChecked() const
FIXME_docs.
bool DoneCheck(uint16_t val) const
FIXME_docs.
bool DataCheck(uint16_t val) const
FIXME_docs.
bool DoneIsChecked() const
FIXME_docs.
void SetData(uint16_t data, uint16_t datamsk=0)
FIXME_docs.
const std::vector< uint16_t > & BlockValue() const
FIXME_docs.
uint16_t DataMask() const
FIXME_docs.
const std::vector< uint16_t > & BlockMask() const
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47