w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RtclRw11CntlDiskBase.ipp
Go to the documentation of this file.
1// $Id: RtclRw11CntlDiskBase.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2017- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-04-16 878 1.0 Initial version
8// ---------------------------------------------------------------------------
9
19#include <sstream>
20
22
24
25// all method definitions in namespace Retro
26namespace Retro {
28//------------------------------------------+-----------------------------------
31template <class TC>
33 const std::string& cclass)
34 : RtclRw11CntlRdmaBase<TC>(type,cclass)
35{}
36
37//------------------------------------------+-----------------------------------
39
40template <class TC>
42{}
43
44//------------------------------------------+-----------------------------------
46
47template <class TC>
49{
50 if (!args.AllDone()) return RtclRw11Cntl::kERR;
51 std::ostringstream sos;
52 TC& cntl = this->Obj();
53 sos << "unit type en wp cyl hd sec blocks bsz at attachurl\n";
54 for (size_t i=0; i<cntl.NUnit(); i++) {
55 Rw11UnitDisk& unit = cntl.Unit(i);
56 sos << RosPrintf(unit.Name().c_str(),"-s",4)
57 << " " << RosPrintf(unit.Type().c_str(),"-s",4)
58 << " " << (unit.Enabled() ? " y" : " n")
59 << " " << (unit.WProt() ? " y" : " n")
60 << " " << RosPrintf(unit.NCylinder(),"d",4)
61 << " " << RosPrintf(unit.NHead(),"d",2)
62 << " " << RosPrintf(unit.NSector(),"d",3)
63 << " " << RosPrintf(unit.NBlock(),"d",7)
64 << " " << RosPrintf(unit.BlockSize(),"d",3)
65 << " " << (unit.IsAttached() ? " y" : " n")
66 << " " << unit.AttachUrl()
67 << "\n";
68 }
69 args.AppendResultLines(sos);
70 return RtclRw11Cntl::kOK;
71}
72
73
74} // end namespace Retro
FIXME_docs.
Definition: RtclArgs.hpp:41
void AppendResultLines(const std::string &str)
FIXME_docs.
Definition: RtclArgs.cpp:484
bool AllDone()
FIXME_docs.
Definition: RtclArgs.cpp:447
static const int kOK
Definition: RtclCmdBase.hpp:54
static const int kERR
Definition: RtclCmdBase.hpp:55
virtual int M_default(RtclArgs &args)
FIXME_docs.
RtclRw11CntlDiskBase(const std::string &type, const std::string &cclass)
Constructor.
Implemenation (all inline) of RtclRw11CntlRdmaBase.
size_t NCylinder() const
FIXME_docs.
bool WProt() const
FIXME_docs.
size_t NHead() const
FIXME_docs.
const std::string & Type() const
FIXME_docs.
size_t NBlock() const
FIXME_docs.
size_t NSector() const
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
virtual bool Enabled() const
FIXME_docs.
bool IsAttached() const
FIXME_docs.
Definition: Rw11Unit.cpp:61
std::string Name() const
FIXME_docs.
Definition: Rw11Unit.ipp:31
const std::string & AttachUrl() const
FIXME_docs.
Definition: Rw11Unit.cpp:69
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Definition: RosPrintf.ipp:38
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47