w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11VirtEth.hpp
Go to the documentation of this file.
1// $Id: Rw11VirtEth.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2014-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 Initial version
11// 2014-06-09 561 0.1 First draft
12// ---------------------------------------------------------------------------
13
18#ifndef included_Retro_Rw11VirtEth
19#define included_Retro_Rw11VirtEth 1
20
21#include <memory>
22#include <memory>
23#include <functional>
24
25#include "RethBuf.hpp"
26
27#include "Rw11Virt.hpp"
28
29namespace Retro {
30
31 class Rw11VirtEth : public Rw11Virt {
32 public:
33 typedef std::function<bool(std::shared_ptr<RethBuf>&)> rcvcbfo_t;
34
35 explicit Rw11VirtEth(Rw11Unit* punit);
37
38 virtual const std::string& ChannelId() const;
39
40 void SetupRcvCallback(rcvcbfo_t&& rcvcbfo);
41 virtual bool Snd(const RethBuf& ebuf, RerrMsg& emsg) = 0;
42
43 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
44 int detail=0) const;
45
46 static std::unique_ptr<Rw11VirtEth> New(const std::string& url,
47 Rw11Unit* punit, RerrMsg& emsg);
48
49 // statistics counter indices
50 enum stats {
56 };
57
58 protected:
59 std::string fChannelId;
61 };
62
63} // end namespace Retro
64
65#include "Rw11VirtEth.ipp"
66
67#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
FIXME_docs.
Definition: RethBuf.hpp:27
FIXME_docs.
Definition: Rw11Unit.hpp:39
virtual const std::string & ChannelId() const
FIXME_docs.
Definition: Rw11VirtEth.ipp:22
std::function< bool(std::shared_ptr< RethBuf > &)> rcvcbfo_t
Definition: Rw11VirtEth.hpp:33
~Rw11VirtEth()
Destructor.
Definition: Rw11VirtEth.cpp:50
std::string fChannelId
channel id
Definition: Rw11VirtEth.hpp:59
static std::unique_ptr< Rw11VirtEth > New(const std::string &url, Rw11Unit *punit, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11VirtEth.cpp:56
void SetupRcvCallback(rcvcbfo_t &&rcvcbfo)
FIXME_docs.
Definition: Rw11VirtEth.ipp:31
virtual bool Snd(const RethBuf &ebuf, RerrMsg &emsg)=0
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rw11VirtEth.cpp:78
rcvcbfo_t fRcvCb
receive callback fobj
Definition: Rw11VirtEth.hpp:60
FIXME_docs.
Definition: Rw11Virt.hpp:34
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47