w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtTerm.hpp
Go to the documentation of this file.
1// $Id: Rw11VirtTerm.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-15 1083 1.1.2 SetupRcvCallback(): use rval ref and move semantics
8// 2018-12-14 1081 1.1.1 use std::function instead of boost
9// 2018-12-02 1076 1.1 use unique_ptr for New()
10// 2017-04-07 868 1.0.1 Dump(): add detail arg
11// 2013-03-06 495 1.0 Initial version
12// 2013-02-13 488 0.1 First draft
13// ---------------------------------------------------------------------------
14
19#ifndef included_Retro_Rw11VirtTerm
20#define included_Retro_Rw11VirtTerm 1
21
22#include <memory>
23#include <functional>
24
25#include "Rw11Virt.hpp"
26
27namespace Retro {
28
29 class Rw11VirtTerm : public Rw11Virt {
30 public:
31 typedef std::function<bool(const uint8_t*, size_t)> rcvcbfo_t;
32
33 explicit Rw11VirtTerm(Rw11Unit* punit);
35
36 virtual const std::string& ChannelId() const;
37
38 void SetupRcvCallback(rcvcbfo_t&& rcvcbfo);
39 virtual bool Snd(const uint8_t* data, size_t count, RerrMsg& emsg) = 0;
40
41 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
42 int detail=0) const;
43
44 static std::unique_ptr<Rw11VirtTerm> New(const std::string& url,
45 Rw11Unit* punit, RerrMsg& emsg);
46
47 // statistics counter indices
48 enum stats {
54 };
55
56 protected:
57 std::string fChannelId;
59 };
60
61} // end namespace Retro
62
63#include "Rw11VirtTerm.ipp"
64
65#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: Rw11Unit.hpp:39
static std::unique_ptr< Rw11VirtTerm > New(const std::string &url, Rw11Unit *punit, RerrMsg &emsg)
FIXME_docs.
void SetupRcvCallback(rcvcbfo_t &&rcvcbfo)
FIXME_docs.
rcvcbfo_t fRcvCb
receive callback fobj
virtual bool Snd(const uint8_t *data, size_t count, RerrMsg &emsg)=0
std::string fChannelId
channel id
~Rw11VirtTerm()
Destructor.
std::function< bool(const uint8_t *, size_t)> rcvcbfo_t
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
virtual const std::string & ChannelId() const
FIXME_docs.
FIXME_docs.
Definition: Rw11Virt.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47