w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkCommandExpect.hpp
Go to the documentation of this file.
1// $Id: RlinkCommandExpect.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2018 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.2 SetBlock: add move versions
8// 2017-04-07 868 1.2.1 Dump(): add detail arg
9// 2015-04-02 661 1.2 expect logic: remove stat from Expect, invert mask
10// 2014-12-20 616 1.1 add Done count methods (for rblk/wblk)
11// 2011-03-12 368 1.0 Initial version
12// 2011-01-15 355 0.1 First draft
13// ---------------------------------------------------------------------------
14
15
20#ifndef included_Retro_RlinkCommandExpect
21#define included_Retro_RlinkCommandExpect 1
22
23#include <cstdint>
24#include <vector>
25
26namespace Retro {
27
29 public:
30
32 RlinkCommandExpect(uint16_t data, uint16_t datamsk=0xffff);
33 RlinkCommandExpect(const std::vector<uint16_t>& block);
34 RlinkCommandExpect(const std::vector<uint16_t>& block,
35 const std::vector<uint16_t>& blockmsk);
37
38 void SetData(uint16_t data, uint16_t datamsk=0);
39 void SetDone(uint16_t done, bool check=true);
40 void SetBlock(const std::vector<uint16_t>& block);
41 void SetBlock(std::vector<uint16_t>&& block);
42 void SetBlock(const std::vector<uint16_t>& block,
43 const std::vector<uint16_t>& blockmsk);
44 void SetBlock(std::vector<uint16_t>&& block,
45 std::vector<uint16_t>&& blockmsk);
46
47 uint16_t DataValue() const;
48 uint16_t DataMask() const;
49 uint16_t DoneValue() const;
50 const std::vector<uint16_t>& BlockValue() const;
51 const std::vector<uint16_t>& BlockMask() const;
52
53 bool DataCheck(uint16_t val) const;
54 bool DoneCheck(uint16_t val) const;
55 bool BlockCheck(size_t ind, uint16_t val) const;
56 size_t BlockCheck(const uint16_t* pval, size_t size) const;
57
58 bool DataIsChecked() const;
59 bool DoneIsChecked() const;
60 bool BlockIsChecked(size_t ind) const;
61
62 void Dump(std::ostream& os, int ind=0, const char* text=0,
63 int detail=0) const;
64
65 protected:
66 uint16_t fDataVal;
67 uint16_t fDataMsk;
68 std::vector<uint16_t> fBlockVal;
69 std::vector<uint16_t> fBlockMsk;
70 };
71
72} // end namespace Retro
73
75
76#endif
uint16_t DoneValue() const
FIXME_docs.
void SetDone(uint16_t done, bool check=true)
FIXME_docs.
uint16_t DataValue() const
FIXME_docs.
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) 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.
bool BlockCheck(size_t ind, uint16_t val) const
FIXME_docs.
uint16_t DataMask() const
FIXME_docs.
RlinkCommandExpect()
Default constructor.
const std::vector< uint16_t > & BlockMask() const
FIXME_docs.
bool BlockIsChecked(size_t ind) const
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47