w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkCommandList.hpp
Go to the documentation of this file.
1// $Id: RlinkCommandList.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-23 1091 1.4.2 AddWblk(): add move version
8// 2018-12-07 1077 1.4.1 SetLastExpectBlock: add move versions
9// 2018-12-01 1076 1.4 use unique_ptr
10// 2017-04-02 865 1.3.1 Dump(): add detail arg
11// 2015-04-02 661 1.3 expect logic: add SetLastExpect methods
12// 2014-11-23 606 1.2 new rlink v4 iface
13// 2014-08-02 576 1.1 rename LastExpect->SetLastExpect
14// 2013-05-06 495 1.0.1 add RlinkContext to Print() args; drop oper<<()
15// 2011-03-05 366 1.0 Initial version
16// 2011-01-09 354 0.1 First draft
17// ---------------------------------------------------------------------------
18
19
24#ifndef included_Retro_RlinkCommandList
25#define included_Retro_RlinkCommandList 1
26
27#include <cstddef>
28#include <cstdint>
29#include <vector>
30#include <iostream>
31#include <memory>
32
34#include "RlinkCommand.hpp"
35#include "RlinkContext.hpp"
36#include "RlinkAddrMap.hpp"
37
38namespace Retro {
39
41 public:
42 typedef std::unique_ptr<RlinkCommand> cmd_uptr_t;
43 typedef std::unique_ptr<RlinkCommandExpect> exp_uptr_t;
44
48
49 size_t AddCommand(cmd_uptr_t&& upcmd);
50 size_t AddCommand(const RlinkCommand& cmd);
51 size_t AddCommand(const RlinkCommandList& clist);
52 size_t AddRreg(uint16_t addr);
53 size_t AddRblk(uint16_t addr, size_t size);
54 size_t AddRblk(uint16_t addr, uint16_t* block, size_t size);
55 size_t AddWreg(uint16_t addr, uint16_t data);
56 size_t AddWblk(uint16_t addr, const std::vector<uint16_t>& block);
57 size_t AddWblk(uint16_t addr, std::vector<uint16_t>&& block);
58 size_t AddWblk(uint16_t addr, const uint16_t* block, size_t size);
59 size_t AddLabo();
60 size_t AddAttn();
61 size_t AddInit(uint16_t addr, uint16_t data);
62
63 void SetLastExpectStatus(uint8_t stat, uint8_t statmsk=0xff);
64 void SetLastExpectData(uint16_t data, uint16_t datamsk=0xffff);
65 void SetLastExpectDone(uint16_t done);
66 void SetLastExpectBlock(const std::vector<uint16_t>& block);
67 void SetLastExpectBlock(std::vector<uint16_t>&& block);
68 void SetLastExpectBlock(const std::vector<uint16_t>& block,
69 const std::vector<uint16_t>& blockmsk);
70 void SetLastExpectBlock(std::vector<uint16_t>&& block,
71 std::vector<uint16_t>&& blockmsk);
72 void SetLastExpect(exp_uptr_t&& upexp);
73
74 void ClearLaboIndex();
75 void SetLaboIndex(int ind);
76 int LaboIndex() const;
77 bool LaboActive() const;
78
79 void Clear();
80 size_t Size() const;
81
82 void Print(std::ostream& os, const RlinkAddrMap* pamap=0,
83 size_t abase=16, size_t dbase=16,
84 size_t sbase=16) const;
85 void Dump(std::ostream& os, int ind=0, const char* text=0,
86 int detail=0) const;
87
89
90 RlinkCommand& operator[](size_t ind);
91 const RlinkCommand& operator[](size_t ind) const;
92
93 protected:
94 std::vector<cmd_uptr_t> fList;
96 };
97
98} // end namespace Retro
99
100#include "RlinkCommandList.ipp"
101
102#endif
size_t AddWreg(uint16_t addr, uint16_t data)
FIXME_docs.
size_t AddCommand(cmd_uptr_t &&upcmd)
FIXME_docs.
RlinkCommandList & operator=(const RlinkCommandList &rhs)
FIXME_docs.
int fLaboIndex
index of active labo (-1 if no)
size_t AddAttn()
FIXME_docs.
size_t Size() const
FIXME_docs.
void ClearLaboIndex()
FIXME_docs.
size_t AddInit(uint16_t addr, uint16_t data)
FIXME_docs.
size_t AddRblk(uint16_t addr, size_t size)
FIXME_docs.
RlinkCommandList()
Default constructor.
void SetLastExpectStatus(uint8_t stat, uint8_t statmsk=0xff)
FIXME_docs.
void SetLastExpectBlock(const std::vector< uint16_t > &block)
FIXME_docs.
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t AddWblk(uint16_t addr, const std::vector< uint16_t > &block)
FIXME_docs.
int LaboIndex() const
FIXME_docs.
RlinkCommand & operator[](size_t ind)
FIXME_docs.
void SetLaboIndex(int ind)
FIXME_docs.
size_t AddRreg(uint16_t addr)
FIXME_docs.
std::unique_ptr< RlinkCommand > cmd_uptr_t
void Print(std::ostream &os, const RlinkAddrMap *pamap=0, size_t abase=16, size_t dbase=16, size_t sbase=16) const
FIXME_docs.
std::vector< cmd_uptr_t > fList
vector of commands
void SetLastExpectDone(uint16_t done)
FIXME_docs.
void SetLastExpect(exp_uptr_t &&upexp)
FIXME_docs.
bool LaboActive() const
FIXME_docs.
std::unique_ptr< RlinkCommandExpect > exp_uptr_t
void SetLastExpectData(uint16_t data, uint16_t datamsk=0xffff)
FIXME_docs.
size_t AddLabo()
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47