w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11Unit.cpp
Go to the documentation of this file.
1// $Id: Rw11Unit.cpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-04-15 875 1.1.3 add IsAttached(), AttachUrl()
8// 2017-04-07 868 1.1.2 Dump(): add detail arg
9// 2015-05-13 680 1.1.1 add Enabled()
10// 2013-05-03 515 1.1 use AttachDone(),DetachCleanup(),DetachDone()
11// 2013-03-06 495 1.0 Initial version
12// 2013-02-13 488 0.1 First draft
13// ---------------------------------------------------------------------------
14
19#include "librtools/RosFill.hpp"
20
21#include "Rw11Unit.hpp"
22#include "Rw11Virt.hpp"
23
24using namespace std;
25
31// all method definitions in namespace Retro
32namespace Retro {
33
34//------------------------------------------+-----------------------------------
36
37Rw11Unit::Rw11Unit(Rw11Cntl* pcntl, size_t index)
38 : fpCntlBase(pcntl),
39 fIndex(index),
40 fAttachOpts(),
41 fStats()
42{}
43
44//------------------------------------------+-----------------------------------
46
48{}
49
50//------------------------------------------+-----------------------------------
52
54{
55 return true;
56}
57
58//------------------------------------------+-----------------------------------
60
62{
63 return bool(VirtBase());
64}
65
66//------------------------------------------+-----------------------------------
68
69const std::string& Rw11Unit::AttachUrl() const
70{
71 if (VirtBase()) {
72 return VirtBase()->Url().Url();
73 }
74
75 static const string strnil;
76 return strnil;
77}
78
79//------------------------------------------+-----------------------------------
81
82bool Rw11Unit::Attach(const std::string& /*url*/, RerrMsg& emsg)
83{
84 emsg.Init("Rw11Unit::Attach","attach not available for this device type");
85 return false;
86}
87
88//------------------------------------------+-----------------------------------
90
92{
93 return;
94}
95
96//------------------------------------------+-----------------------------------
98
99void Rw11Unit::Dump(std::ostream& os, int ind, const char* text,
100 int detail) const
101{
102 RosFill bl(ind);
103 os << bl << (text?text:"--") << "Rw11Unit @ " << this << endl;
104
105 os << bl << " fpCntlBase: " << fpCntlBase << endl;
106 os << bl << " fIndex: " << fIndex << endl;
107 os << bl << " fAttachOpts: " << fAttachOpts << endl;
108 fStats.Dump(os, ind+2, "fStats: ", detail-1);
109 return;
110}
111
112//------------------------------------------+-----------------------------------
114
116{}
117
118//------------------------------------------+-----------------------------------
120
122{}
123
124//------------------------------------------+-----------------------------------
126
128{}
129
130} // end namespace Retro
FIXME_docs.
Definition: RerrMsg.hpp:25
void Init(const std::string &meth, const std::string &text)
FIXME_docs.
Definition: RerrMsg.cpp:74
I/O appicator to generate fill characters.
Definition: RosFill.hpp:24
const std::string & Url() const
FIXME_docs.
Definition: RparseUrl.ipp:29
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rstats.cpp:178
FIXME_docs.
Definition: Rw11Cntl.hpp:42
bool IsAttached() const
FIXME_docs.
Definition: Rw11Unit.cpp:61
virtual bool Attach(const std::string &url, RerrMsg &emsg)
FIXME_docs.
Definition: Rw11Unit.cpp:82
virtual Rw11Virt * VirtBase() const =0
virtual void DetachDone()
FIXME_docs.
Definition: Rw11Unit.cpp:127
Rstats fStats
statistics
Definition: Rw11Unit.hpp:90
virtual void DetachCleanup()
FIXME_docs.
Definition: Rw11Unit.cpp:121
size_t fIndex
unit number
Definition: Rw11Unit.hpp:88
virtual void Detach()
FIXME_docs.
Definition: Rw11Unit.cpp:91
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
Definition: Rw11Unit.cpp:99
virtual bool Enabled() const
FIXME_docs.
Definition: Rw11Unit.cpp:53
virtual void AttachDone()
FIXME_docs.
Definition: Rw11Unit.cpp:115
virtual ~Rw11Unit()
Destructor.
Definition: Rw11Unit.cpp:47
Rw11Unit()
default ctor blocker
Definition: Rw11Unit.hpp:84
std::string fAttachOpts
unit context options for attach
Definition: Rw11Unit.hpp:89
Rw11Cntl * fpCntlBase
plain Rw11Cntl ptr
Definition: Rw11Unit.hpp:87
const std::string & AttachUrl() const
FIXME_docs.
Definition: Rw11Unit.cpp:69
const RparseUrl & Url() const
FIXME_docs.
Definition: Rw11Virt.ipp:71
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47