1
0
mirror of https://github.com/wfjm/w11.git synced 2026-01-25 12:15:40 +00:00

remove double inheritance in RtclRw11Unit* stack

- was more a hack than a design; inheritance stack now cleaner
- RtclRw11Unit: drop fpCpu, use added Cpu()=0 instead
- RtclRw11UnitBase: add TUV,TB; add TUV* ObjUV(); inherit from TB
- RtclRw11Unit(Disk|Stream|Tape|Term): define ObjUV();inherit from RtclRw11Unit
- RtclRw11Unit(dev): inherit from RtclRw11UnitBase
This commit is contained in:
Walter F.J. Mueller
2017-04-08 20:34:02 +02:00
parent ae070196ce
commit 0f4350db6d
28 changed files with 380 additions and 313 deletions

View File

@@ -17,15 +17,22 @@ software or firmware builds or that the documentation is consistent.
The full set of tests is only run for tagged releases._
### Summary
- more compact dumps, add Dump(..,detail); trace output with cntl name
- remove double inheritance in RtclRw11Unit* stack
- RtclRw11Unit: drop fpCpu, use added Cpu()=0 instead
- RtclRw11UnitBase: add TUV,TB; add TUV* ObjUV(); inherit from TB
- RtclRw11Unit(Disk|Stream|Tape|Term): define ObjUV();inherit from RtclRw11Unit
- RtclRw11Unit(dev): inherit from RtclRw11UnitBase
- trace output with controller name
- Rw11Cntl*: use controller name as message prefix
- more compact dumps, add Dump(..,detail)
- RlinkCommand: add CommandInfo()
- RtclCmdBase: add GetArgsDump()
- RlinkCommandList: Dump(): add detail arg
- Rstats: add NameMaxLength(); Print(): add counter name
- Rw11Cntl: use Dump(detail) for PrimClist ect
- Rw11CntlBase,Rw11Rdma*: Dump(): add detail arg
- Rw11Cntl*: Dump(): add detail arg; use cntl name as message prefix
- RtclRw11Cntl: M_dump: use GetArgsDump and Dump detail
- Rw11(Cntl|Unit|Virt)*,: Dump(): add detail arg
- many other classes: Dump(): add detail arg
- RtclRw11(Cntl|Unit|*): M_dump: use GetArgsDump and Dump detail
- RtimerFd: first practical version
- use clock_gettime instead of gettimeofday
- add Rw11VirtDiskOver (simple overlay file container)

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11Unit.cpp 868 2017-04-07 20:09:33Z mueller $
// $Id: RtclRw11Unit.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.2 drop fpCpu, use added Cpu()=0 instead
// 2017-04-07 868 1.1.1 M_dump: use GetArgsDump and Dump detail
// 2017-04-02 863 1.1 add fpVirt; add DetachCleanup()
// 2013-03-03 494 1.0 Initial version
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11Unit.cpp 868 2017-04-07 20:09:33Z mueller $
\version $Id: RtclRw11Unit.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11Unit.
*/
@@ -46,9 +47,8 @@ namespace Retro {
//------------------------------------------+-----------------------------------
//! Default constructor
RtclRw11Unit::RtclRw11Unit(const std::string& type, Rw11Cpu* pcpu)
RtclRw11Unit::RtclRw11Unit(const std::string& type)
: RtclProxyBase(type),
fpCpu(pcpu),
fGets(),
fSets(),
fpVirt()
@@ -84,7 +84,7 @@ void RtclRw11Unit::DetachCleanup()
int RtclRw11Unit::M_get(RtclArgs& args)
{
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(fpCpu->Connect());
boost::lock_guard<RlinkConnect> lock(Cpu().Connect());
return fGets.M_get(args);
}
@@ -94,7 +94,7 @@ int RtclRw11Unit::M_get(RtclArgs& args)
int RtclRw11Unit::M_set(RtclArgs& args)
{
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(fpCpu->Connect());
boost::lock_guard<RlinkConnect> lock(Cpu().Connect());
return fSets.M_set(args);
}
@@ -110,7 +110,7 @@ int RtclRw11Unit::M_attach(RtclArgs& args)
RerrMsg emsg;
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(fpCpu->Connect());
boost::lock_guard<RlinkConnect> lock(Cpu().Connect());
DetachCleanup();
if (!Obj().Attach(url, emsg)) return args.Quit(emsg);
@@ -126,7 +126,7 @@ int RtclRw11Unit::M_detach(RtclArgs& args)
if (!args.AllDone()) return kERR;
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(fpCpu->Connect());
boost::lock_guard<RlinkConnect> lock(Cpu().Connect());
Obj().Detach();
return kOK;
}
@@ -140,7 +140,7 @@ int RtclRw11Unit::M_virt(RtclArgs& args)
"Bad state: fpVirt == nullptr");
// synchronize with server thread
boost::lock_guard<RlinkConnect> lock(fpCpu->Connect());
boost::lock_guard<RlinkConnect> lock(Cpu().Connect());
return fpVirt->DispatchCmd(args);
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11Unit.hpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclRw11Unit.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.2 drop fpCpu, use added Cpu()=0 instead
// 2017-04-02 863 1.1 add fpVirt,DetachCleanup(),AttachDone(),M_virt()
// 2013-03-03 494 1.0 Initial version
// 2013-02-16 488 0.1 First draft
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11Unit.hpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclRw11Unit.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11Unit.
*/
@@ -47,12 +48,11 @@ namespace Retro {
class RtclRw11Unit : public RtclProxyBase {
public:
RtclRw11Unit(const std::string& type, Rw11Cpu* pcpu);
RtclRw11Unit(const std::string& type);
virtual ~RtclRw11Unit();
virtual Rw11Unit& Obj() = 0;
RtclGetList& GetList();
RtclSetList& SetList();
virtual Rw11Cpu& Cpu() const = 0;
protected:
virtual void AttachDone() = 0;
@@ -66,7 +66,6 @@ namespace Retro {
int M_default(RtclArgs& args);
protected:
Rw11Cpu* fpCpu;
RtclGetList fGets;
RtclSetList fSets;
boost::scoped_ptr<RtclRw11Virt> fpVirt;
@@ -74,6 +73,6 @@ namespace Retro {
} // end namespace Retro
#include "RtclRw11Unit.ipp"
//#include "RtclRw11Unit.ipp"
#endif

View File

@@ -1,45 +0,0 @@
// $Id: RtclRw11Unit.ipp 863 2017-04-02 11:43:15Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 2, or at your option any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for complete details.
//
// Revision History:
// Date Rev Version Comment
// 2013-03-03 494 1.0 Initial version
// 2013-02-22 490 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11Unit.ipp 863 2017-04-02 11:43:15Z mueller $
\brief Implemenation (inline) of RtclRw11Unit.
*/
// all method definitions in namespace Retro
namespace Retro {
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline RtclGetList& RtclRw11Unit::GetList()
{
return fGets;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
inline RtclSetList& RtclRw11Unit::SetList()
{
return fSets;
}
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11UnitBase.hpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclRw11UnitBase.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.2 add TUV,TB; add TUV* ObjUV(); inherit from TB
// 2017-04-02 863 1.1 add AttachDone()
// 2013-03-06 495 1.0 Initial version
// 2013-02-16 488 0.1 First draft
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11UnitBase.hpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclRw11UnitBase.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitBase.
*/
@@ -34,22 +35,24 @@
namespace Retro {
template <class TO>
class RtclRw11UnitBase : public RtclRw11Unit {
template <class TU, class TUV, class TB>
class RtclRw11UnitBase : public TB {
public:
RtclRw11UnitBase(const std::string& type,
const boost::shared_ptr<TO>& spunit);
const boost::shared_ptr<TU>& spunit);
~RtclRw11UnitBase();
TO& Obj();
const boost::shared_ptr<TO>& ObjSPtr();
virtual TU& Obj();
virtual TUV& ObjUV();
virtual Rw11Cpu& Cpu() const;
const boost::shared_ptr<TU>& ObjSPtr();
protected:
virtual void AttachDone();
int M_stats(RtclArgs& args);
protected:
boost::shared_ptr<TO> fspObj; //!< sptr to managed object
boost::shared_ptr<TU> fspObj; //!< sptr to managed object
};
} // end namespace Retro

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11UnitBase.ipp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclRw11UnitBase.ipp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.3 add TUV,TB; add TUV* ObjUV(); inherit from TB
// 2017-04-02 863 1.2 add AttachDone()
// 2015-05-14 680 1.1 fGets: add enabled (moved from RtclRw11UnitDisk)
// 2013-03-06 495 1.0 Initial version
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11UnitBase.ipp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclRw11UnitBase.ipp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation (all inline) of RtclRw11UnitBase.
*/
@@ -36,34 +37,55 @@
// all method definitions in namespace Retro
namespace Retro {
// Note on coding style:
// all base class members must be qualified with "this->" to ensure proper
// name lookup. Otherwise one gets errors like "no declarations were found
// by argument-dependent lookup at the point of instantiation"
//
// Reason is the according to C++ standart in a first pass all names which
// are not template parameter dependent are resolved. If a name is not found
// one gets above mentioned error. All other names are looked up in a second
// pass. Adding "this->" makes the name template parameter dependent.
//
// Prefixing a "TC::" can also be used, e.g. for constants like TB::kOK.
//------------------------------------------+-----------------------------------
//! Constructor
template <class TO>
inline RtclRw11UnitBase<TO>::RtclRw11UnitBase(const std::string& type,
const boost::shared_ptr<TO>& spunit)
: RtclRw11Unit(type, &(spunit->Cntl().Cpu())),
template <class TU, class TUV, class TB>
inline RtclRw11UnitBase<TU,TUV,TB>::RtclRw11UnitBase(const std::string& type,
const boost::shared_ptr<TU>& spunit)
: TB(type),
fspObj(spunit)
{
AddMeth("stats", boost::bind(&RtclRw11UnitBase<TO>::M_stats, this, _1));
TO* pobj = fspObj.get();
fGets.Add<size_t> ("index", boost::bind(&TO::Index, pobj));
fGets.Add<std::string> ("name", boost::bind(&TO::Name, pobj));
fGets.Add<bool> ("enabled", boost::bind(&TO::Enabled, pobj));
this->AddMeth("stats", boost::bind(&RtclRw11UnitBase<TU,TUV,TB>::M_stats,
this, _1));
TU* pobj = fspObj.get();
// the following construction is neccessary because the base class is a
// template argument. Access to "this->fGets" is done via a local variable
// 'gets' to a local variable. Otherwise processing of the template functions
// Add<...> will cause obscure "expected primary-expression before > "
// error messages. Simply too much nested templating...
RtclGetList& gets = this->fGets;
gets.Add<size_t> ("index", boost::bind(&TU::Index, pobj));
gets.Add<std::string> ("name", boost::bind(&TU::Name, pobj));
gets.Add<bool> ("enabled", boost::bind(&TU::Enabled, pobj));
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TO>
inline RtclRw11UnitBase<TO>::~RtclRw11UnitBase()
template <class TU, class TUV, class TB>
inline RtclRw11UnitBase<TU,TUV,TB>::~RtclRw11UnitBase()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TO>
inline TO& RtclRw11UnitBase<TO>::Obj()
template <class TU, class TUV, class TB>
inline TU& RtclRw11UnitBase<TU,TUV,TB>::Obj()
{
return *fspObj;
}
@@ -71,8 +93,26 @@ inline TO& RtclRw11UnitBase<TO>::Obj()
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TO>
inline const boost::shared_ptr<TO>& RtclRw11UnitBase<TO>::ObjSPtr()
template <class TU, class TUV, class TB>
inline TUV& RtclRw11UnitBase<TU,TUV,TB>::ObjUV()
{
return *fspObj;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TU, class TUV, class TB>
inline Rw11Cpu& RtclRw11UnitBase<TU,TUV,TB>::Cpu() const
{
return fspObj->Cpu();
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TU, class TUV, class TB>
inline const boost::shared_ptr<TU>& RtclRw11UnitBase<TU,TUV,TB>::ObjSPtr()
{
return fspObj;
}
@@ -80,30 +120,30 @@ inline const boost::shared_ptr<TO>& RtclRw11UnitBase<TO>::ObjSPtr()
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TO>
void RtclRw11UnitBase<TO>::AttachDone()
template <class TU, class TUV, class TB>
void RtclRw11UnitBase<TU,TUV,TB>::AttachDone()
{
if (!Obj().Virt()) return;
RtclRw11Virt* pvirt=RtclRw11VirtFactory(Obj().Virt());
if (!pvirt) return;
fpVirt.reset(pvirt);
AddMeth("virt", boost::bind(&RtclRw11Unit::M_virt, this, _1));
this->fpVirt.reset(pvirt);
this->AddMeth("virt", boost::bind(&RtclRw11Unit::M_virt, this, _1));
return;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
template <class TO>
int RtclRw11UnitBase<TO>::M_stats(RtclArgs& args)
template <class TU, class TUV, class TB>
int RtclRw11UnitBase<TU,TUV,TB>::M_stats(RtclArgs& args)
{
RtclStats::Context cntx;
if (!RtclStats::GetArgs(args, cntx)) return kERR;
if (!RtclStats::Collect(args, cntx, Obj().Stats())) return kERR;
if (!RtclStats::GetArgs(args, cntx)) return TB::kERR;
if (!RtclStats::Collect(args, cntx, Obj().Stats())) return TB::kERR;
if (Obj().Virt()) {
if (!RtclStats::Collect(args, cntx, Obj().Virt()->Stats())) return kERR;
if (!RtclStats::Collect(args, cntx, Obj().Virt()->Stats())) return TB::kERR;
}
return kOK;
return TB::kOK;
}
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitDL11.cpp 504 2013-04-13 15:37:24Z mueller $
// $Id: RtclRw11UnitDL11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-03-01 493 1.0 Initial version
// 2013-02-16 488 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitDL11.cpp 504 2013-04-13 15:37:24Z mueller $
\version $Id: RtclRw11UnitDL11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitDL11.
*/
@@ -41,9 +42,10 @@ namespace Retro {
RtclRw11UnitDL11::RtclRw11UnitDL11(Tcl_Interp* interp,
const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitDL11>& spunit)
: RtclRw11UnitBase<Rw11UnitDL11>("Rw11UnitDL11", spunit),
RtclRw11UnitTerm(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitDL11,Rw11UnitTerm,
RtclRw11UnitTerm>("Rw11UnitDL11", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitDL11.hpp 504 2013-04-13 15:37:24Z mueller $
// $Id: RtclRw11UnitDL11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-03-01 493 1.0 Initial version
// 2013-02-16 488 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RtclRw11UnitDL11.hpp 504 2013-04-13 15:37:24Z mueller $
\version $Id: RtclRw11UnitDL11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitDL11.
*/
@@ -35,8 +36,8 @@
namespace Retro {
class RtclRw11UnitDL11 : public RtclRw11UnitBase<Rw11UnitDL11>,
public RtclRw11UnitTerm {
class RtclRw11UnitDL11 : public RtclRw11UnitBase<Rw11UnitDL11,Rw11UnitTerm,
RtclRw11UnitTerm> {
public:
RtclRw11UnitDL11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitDisk.cpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclRw11UnitDisk.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitDisk& ObjUV(); inherit from RtclRw11Unit
// 2015-05-14 680 1.1.1 fGets: remove enabled, now in RtclRw11UnitBase
// 2015-03-21 659 1.1 fGets: add enabled
// 2013-04-19 507 1.0 Initial version
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11UnitDisk.cpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclRw11UnitDisk.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitDisk.
*/
@@ -40,30 +41,9 @@ namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
RtclRw11UnitDisk::RtclRw11UnitDisk(RtclRw11Unit* ptcl, Rw11UnitDisk* pobj)
: fpTcl(ptcl),
fpObj(pobj)
{
RtclGetList& gets = ptcl->GetList();
RtclSetList& sets = ptcl->SetList();
gets.Add<const string&> ("type",
boost::bind(&Rw11UnitDisk::Type, pobj));
gets.Add<size_t> ("ncylinder",
boost::bind(&Rw11UnitDisk::NCylinder, pobj));
gets.Add<size_t> ("nhead",
boost::bind(&Rw11UnitDisk::NHead, pobj));
gets.Add<size_t> ("nsector",
boost::bind(&Rw11UnitDisk::NSector, pobj));
gets.Add<size_t> ("blocksize",
boost::bind(&Rw11UnitDisk::BlockSize, pobj));
gets.Add<size_t> ("nblock",
boost::bind(&Rw11UnitDisk::NBlock, pobj));
gets.Add<bool> ("wprot",
boost::bind(&Rw11UnitDisk::WProt, pobj));
sets.Add<const string&> ("type",
boost::bind(&Rw11UnitDisk::SetType,pobj, _1));
}
RtclRw11UnitDisk::RtclRw11UnitDisk(const std::string& type)
: RtclRw11Unit(type)
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
@@ -71,5 +51,35 @@ RtclRw11UnitDisk::RtclRw11UnitDisk(RtclRw11Unit* ptcl, Rw11UnitDisk* pobj)
RtclRw11UnitDisk::~RtclRw11UnitDisk()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RtclRw11UnitDisk::SetupGetSet()
{
// this can't be in ctor because pure virtual is called which is available
// only when more derived class is being constructed. SetupGetSet() must be
// called in ctor of a more derived class.
Rw11UnitDisk* pobj = &ObjUV();
fGets.Add<const string&> ("type",
boost::bind(&Rw11UnitDisk::Type, pobj));
fGets.Add<size_t> ("ncylinder",
boost::bind(&Rw11UnitDisk::NCylinder, pobj));
fGets.Add<size_t> ("nhead",
boost::bind(&Rw11UnitDisk::NHead, pobj));
fGets.Add<size_t> ("nsector",
boost::bind(&Rw11UnitDisk::NSector, pobj));
fGets.Add<size_t> ("blocksize",
boost::bind(&Rw11UnitDisk::BlockSize, pobj));
fGets.Add<size_t> ("nblock",
boost::bind(&Rw11UnitDisk::NBlock, pobj));
fGets.Add<bool> ("wprot",
boost::bind(&Rw11UnitDisk::WProt, pobj));
fSets.Add<const string&> ("type",
boost::bind(&Rw11UnitDisk::SetType,pobj, _1));
return;
}
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitDisk.hpp 863 2017-04-02 11:43:15Z mueller $
// $Id: RtclRw11UnitDisk.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitDisk& ObjUV(); inherit from RtclRw11Unit
// 2013-04-19 507 1.0 Initial version
// 2013-02-22 490 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RtclRw11UnitDisk.hpp 863 2017-04-02 11:43:15Z mueller $
\version $Id: RtclRw11UnitDisk.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitDisk.
*/
@@ -33,16 +34,16 @@
namespace Retro {
class RtclRw11UnitDisk {
class RtclRw11UnitDisk : public RtclRw11Unit {
public:
RtclRw11UnitDisk(RtclRw11Unit* ptcl, Rw11UnitDisk* pobj);
RtclRw11UnitDisk(const std::string& type);
~RtclRw11UnitDisk();
protected:
virtual Rw11UnitDisk& ObjUV() = 0;
protected:
RtclRw11Unit* fpTcl;
Rw11UnitDisk* fpObj;
void SetupGetSet();
};
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitLP11.cpp 515 2013-05-04 17:28:59Z mueller $
// $Id: RtclRw11UnitLP11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,12 +13,13 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitLP11.cpp 515 2013-05-04 17:28:59Z mueller $
\version $Id: RtclRw11UnitLP11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitLP11.
*/
@@ -40,9 +41,10 @@ namespace Retro {
RtclRw11UnitLP11::RtclRw11UnitLP11(Tcl_Interp* interp,
const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitLP11>& spunit)
: RtclRw11UnitBase<Rw11UnitLP11>("Rw11UnitLP11", spunit),
RtclRw11UnitStream(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitLP11,Rw11UnitStream,
RtclRw11UnitStream>("Rw11UnitLP11", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitLP11.hpp 515 2013-05-04 17:28:59Z mueller $
// $Id: RtclRw11UnitLP11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitLP11.hpp 515 2013-05-04 17:28:59Z mueller $
\version $Id: RtclRw11UnitLP11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitLP11.
*/
@@ -34,8 +35,8 @@
namespace Retro {
class RtclRw11UnitLP11 : public RtclRw11UnitBase<Rw11UnitLP11>,
public RtclRw11UnitStream {
class RtclRw11UnitLP11 : public RtclRw11UnitBase<Rw11UnitLP11,Rw11UnitStream,
RtclRw11UnitStream> {
public:
RtclRw11UnitLP11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitPC11.cpp 584 2014-08-22 19:38:12Z mueller $
// $Id: RtclRw11UnitPC11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2014-08-22 584 1.0.1 use nullptr
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitPC11.cpp 584 2014-08-22 19:38:12Z mueller $
\version $Id: RtclRw11UnitPC11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitPC11.
*/
@@ -41,10 +42,11 @@ namespace Retro {
RtclRw11UnitPC11::RtclRw11UnitPC11(Tcl_Interp* interp,
const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitPC11>& spunit)
: RtclRw11UnitBase<Rw11UnitPC11>("Rw11UnitPC11", spunit),
RtclRw11UnitStream(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitPC11,Rw11UnitStream,
RtclRw11UnitStream>("Rw11UnitPC11", spunit)
{
// create default unit command
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
// for 1st PC11, create also alias

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitPC11.hpp 515 2013-05-04 17:28:59Z mueller $
// $Id: RtclRw11UnitPC11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-05-03 515 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitPC11.hpp 515 2013-05-04 17:28:59Z mueller $
\version $Id: RtclRw11UnitPC11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitPC11.
*/
@@ -34,8 +35,8 @@
namespace Retro {
class RtclRw11UnitPC11 : public RtclRw11UnitBase<Rw11UnitPC11>,
public RtclRw11UnitStream {
class RtclRw11UnitPC11 : public RtclRw11UnitBase<Rw11UnitPC11,Rw11UnitStream,
RtclRw11UnitStream> {
public:
RtclRw11UnitPC11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitRHRP.cpp 680 2015-05-14 13:29:46Z mueller $
// $Id: RtclRw11UnitRHRP.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2015-05-14 680 1.0 Initial version
// 2015-03-21 659 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitRHRP.cpp 680 2015-05-14 13:29:46Z mueller $
\version $Id: RtclRw11UnitRHRP.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitRHRP.
*/
@@ -41,9 +42,10 @@ namespace Retro {
RtclRw11UnitRHRP::RtclRw11UnitRHRP(
Tcl_Interp* interp, const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitRHRP>& spunit)
: RtclRw11UnitBase<Rw11UnitRHRP>("Rw11UnitRHRP", spunit),
RtclRw11UnitDisk(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitRHRP,Rw11UnitDisk,
RtclRw11UnitDisk>("Rw11UnitRHRP", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitRHRP.hpp 680 2015-05-14 13:29:46Z mueller $
// $Id: RtclRw11UnitRHRP.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2015-05-14 680 1.0 Initial version
// 2015-03-21 659 0.1 First draft
// ---------------------------------------------------------------------------
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RtclRw11UnitRHRP.hpp 680 2015-05-14 13:29:46Z mueller $
\version $Id: RtclRw11UnitRHRP.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitRHRP.
*/
@@ -35,8 +36,8 @@
namespace Retro {
class RtclRw11UnitRHRP : public RtclRw11UnitBase<Rw11UnitRHRP>,
public RtclRw11UnitDisk {
class RtclRw11UnitRHRP : public RtclRw11UnitBase<Rw11UnitRHRP,Rw11UnitDisk,
RtclRw11UnitDisk> {
public:
RtclRw11UnitRHRP(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitRK11.cpp 509 2013-04-21 20:46:20Z mueller $
// $Id: RtclRw11UnitRK11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2013-02-22 490 1.0 Initial version
// 2013-02-16 488 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitRK11.cpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: RtclRw11UnitRK11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitRK11.
*/
@@ -41,9 +42,10 @@ namespace Retro {
RtclRw11UnitRK11::RtclRw11UnitRK11(
Tcl_Interp* interp, const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitRK11>& spunit)
: RtclRw11UnitBase<Rw11UnitRK11>("Rw11UnitRK11", spunit),
RtclRw11UnitDisk(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitRK11,Rw11UnitDisk,
RtclRw11UnitDisk>("Rw11UnitRK11", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11UnitRK11.hpp 509 2013-04-21 20:46:20Z mueller $
// $Id: RtclRw11UnitRK11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -20,7 +20,7 @@
/*!
\file
\version $Id: RtclRw11UnitRK11.hpp 509 2013-04-21 20:46:20Z mueller $
\version $Id: RtclRw11UnitRK11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitRK11.
*/
@@ -35,8 +35,8 @@
namespace Retro {
class RtclRw11UnitRK11 : public RtclRw11UnitBase<Rw11UnitRK11>,
public RtclRw11UnitDisk {
class RtclRw11UnitRK11 : public RtclRw11UnitBase<Rw11UnitRK11,Rw11UnitDisk,
RtclRw11UnitDisk> {
public:
RtclRw11UnitRK11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitRL11.cpp 561 2014-06-09 17:22:50Z mueller $
// $Id: RtclRw11UnitRL11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2014-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,12 +13,13 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2014-06-08 561 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitRL11.cpp 561 2014-06-09 17:22:50Z mueller $
\version $Id: RtclRw11UnitRL11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitRL11.
*/
@@ -40,9 +41,10 @@ namespace Retro {
RtclRw11UnitRL11::RtclRw11UnitRL11(
Tcl_Interp* interp, const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitRL11>& spunit)
: RtclRw11UnitBase<Rw11UnitRL11>("Rw11UnitRL11", spunit),
RtclRw11UnitDisk(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitRL11,Rw11UnitDisk,
RtclRw11UnitDisk>("Rw11UnitRL11", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,4 +1,4 @@
// $Id: RtclRw11UnitRL11.hpp 647 2015-02-17 22:35:36Z mueller $
// $Id: RtclRw11UnitRL11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2014- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
@@ -19,7 +19,7 @@
/*!
\file
\version $Id: RtclRw11UnitRL11.hpp 647 2015-02-17 22:35:36Z mueller $
\version $Id: RtclRw11UnitRL11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitRL11.
*/
@@ -34,8 +34,8 @@
namespace Retro {
class RtclRw11UnitRL11 : public RtclRw11UnitBase<Rw11UnitRL11>,
public RtclRw11UnitDisk {
class RtclRw11UnitRL11 : public RtclRw11UnitBase<Rw11UnitRL11,Rw11UnitDisk,
RtclRw11UnitDisk> {
public:
RtclRw11UnitRL11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitStream.cpp 515 2013-05-04 17:28:59Z mueller $
// $Id: RtclRw11UnitStream.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,12 +13,13 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitStream& ObjUV(); inh from RtclRw11Unit
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitStream.cpp 515 2013-05-04 17:28:59Z mueller $
\version $Id: RtclRw11UnitStream.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitStream.
*/
@@ -37,18 +38,9 @@ namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
RtclRw11UnitStream::RtclRw11UnitStream(RtclRw11Unit* ptcl, Rw11UnitStream* pobj)
: fpTcl(ptcl),
fpObj(pobj)
{
RtclGetList& gets = ptcl->GetList();
RtclSetList& sets = ptcl->SetList();
gets.Add<int> ("pos",
boost::bind(&Rw11UnitStream::Pos, pobj));
sets.Add<int> ("pos",
boost::bind(&Rw11UnitStream::SetPos,pobj, _1));
}
RtclRw11UnitStream::RtclRw11UnitStream(const std::string& type)
: RtclRw11Unit(type)
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
@@ -57,4 +49,22 @@ RtclRw11UnitStream::~RtclRw11UnitStream()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RtclRw11UnitStream::SetupGetSet()
{
// this can't be in ctor because pure virtual is called which is available
// only when more derived class is being constructed. SetupGetSet() must be
// called in ctor of a more derived class.
Rw11UnitStream* pobj = &ObjUV();
fGets.Add<int> ("pos",
boost::bind(&Rw11UnitStream::Pos, pobj));
fSets.Add<int> ("pos",
boost::bind(&Rw11UnitStream::SetPos,pobj, _1));
return;
}
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitStream.hpp 515 2013-05-04 17:28:59Z mueller $
// $Id: RtclRw11UnitStream.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitStream& ObjUV(); inh from RtclRw11Unit
// 2013-05-01 513 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitStream.hpp 515 2013-05-04 17:28:59Z mueller $
\version $Id: RtclRw11UnitStream.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitStream.
*/
@@ -32,17 +33,16 @@
namespace Retro {
class RtclRw11UnitStream {
class RtclRw11UnitStream : public RtclRw11Unit {
public:
RtclRw11UnitStream(RtclRw11Unit* ptcl,
Rw11UnitStream* pobj);
RtclRw11UnitStream(const std::string& type);
~RtclRw11UnitStream();
protected:
virtual Rw11UnitStream& ObjUV() = 0;
protected:
RtclRw11Unit* fpTcl;
Rw11UnitStream* fpObj;
void SetupGetSet();
};
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTM11.cpp 686 2015-06-04 21:08:08Z mueller $
// $Id: RtclRw11UnitTM11.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,12 +13,13 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2015-05-17 683 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitTM11.cpp 686 2015-06-04 21:08:08Z mueller $
\version $Id: RtclRw11UnitTM11.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitTM11.
*/
@@ -40,9 +41,10 @@ namespace Retro {
RtclRw11UnitTM11::RtclRw11UnitTM11(
Tcl_Interp* interp, const std::string& unitcmd,
const boost::shared_ptr<Rw11UnitTM11>& spunit)
: RtclRw11UnitBase<Rw11UnitTM11>("Rw11UnitTM11", spunit),
RtclRw11UnitTape(this, spunit.get())
: RtclRw11UnitBase<Rw11UnitTM11,Rw11UnitTape,
RtclRw11UnitTape>("Rw11UnitTM11", spunit)
{
SetupGetSet();
CreateObjectCmd(interp, unitcmd.c_str());
}

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTM11.hpp 686 2015-06-04 21:08:08Z mueller $
// $Id: RtclRw11UnitTM11.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 inherit from RtclRw11UnitBase
// 2015-05-17 683 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitTM11.hpp 686 2015-06-04 21:08:08Z mueller $
\version $Id: RtclRw11UnitTM11.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitTM11.
*/
@@ -34,8 +35,8 @@
namespace Retro {
class RtclRw11UnitTM11 : public RtclRw11UnitBase<Rw11UnitTM11>,
public RtclRw11UnitTape {
class RtclRw11UnitTM11 : public RtclRw11UnitBase<Rw11UnitTM11,Rw11UnitTape,
RtclRw11UnitTape> {
public:
RtclRw11UnitTM11(Tcl_Interp* interp,
const std::string& unitcmd,

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTape.cpp 686 2015-06-04 21:08:08Z mueller $
// $Id: RtclRw11UnitTape.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitTape& ObjUV(); inherit from RtclRw11Unit
// 2015-06-04 686 1.0 Initial version
// 2015-05-17 683 0.1 First draft
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitTape.cpp 686 2015-06-04 21:08:08Z mueller $
\version $Id: RtclRw11UnitTape.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitTape.
*/
@@ -38,40 +39,9 @@ namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
RtclRw11UnitTape::RtclRw11UnitTape(RtclRw11Unit* ptcl, Rw11UnitTape* pobj)
: fpTcl(ptcl),
fpObj(pobj)
{
RtclGetList& gets = ptcl->GetList();
RtclSetList& sets = ptcl->SetList();
gets.Add<const string&> ("type",
boost::bind(&Rw11UnitTape::Type, pobj));
gets.Add<bool> ("wprot",
boost::bind(&Rw11UnitTape::WProt, pobj));
gets.Add<size_t> ("capacity",
boost::bind(&Rw11UnitTape::Capacity, pobj));
gets.Add<bool> ("bot",
boost::bind(&Rw11UnitTape::Bot, pobj));
gets.Add<bool> ("eot",
boost::bind(&Rw11UnitTape::Eot, pobj));
gets.Add<bool> ("eom",
boost::bind(&Rw11UnitTape::Eom, pobj));
gets.Add<int> ("posfile",
boost::bind(&Rw11UnitTape::PosFile, pobj));
gets.Add<int> ("posrecord",
boost::bind(&Rw11UnitTape::PosRecord, pobj));
sets.Add<const string&> ("type",
boost::bind(&Rw11UnitTape::SetType,pobj, _1));
sets.Add<bool> ("wprot",
boost::bind(&Rw11UnitTape::SetWProt,pobj, _1));
sets.Add<size_t> ("capacity",
boost::bind(&Rw11UnitTape::SetCapacity,pobj, _1));
sets.Add<int> ("posfile",
boost::bind(&Rw11UnitTape::SetPosFile,pobj, _1));
sets.Add<int> ("posrecord",
boost::bind(&Rw11UnitTape::SetPosRecord,pobj, _1));
}
RtclRw11UnitTape::RtclRw11UnitTape(const std::string& type)
: RtclRw11Unit(type)
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
@@ -79,5 +49,45 @@ RtclRw11UnitTape::RtclRw11UnitTape(RtclRw11Unit* ptcl, Rw11UnitTape* pobj)
RtclRw11UnitTape::~RtclRw11UnitTape()
{}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RtclRw11UnitTape::SetupGetSet()
{
// this can't be in ctor because pure virtual is called which is available
// only when more derived class is being constructed. SetupGetSet() must be
// called in ctor of a more derived class.
Rw11UnitTape* pobj = &ObjUV();
fGets.Add<const string&> ("type",
boost::bind(&Rw11UnitTape::Type, pobj));
fGets.Add<bool> ("wprot",
boost::bind(&Rw11UnitTape::WProt, pobj));
fGets.Add<size_t> ("capacity",
boost::bind(&Rw11UnitTape::Capacity, pobj));
fGets.Add<bool> ("bot",
boost::bind(&Rw11UnitTape::Bot, pobj));
fGets.Add<bool> ("eot",
boost::bind(&Rw11UnitTape::Eot, pobj));
fGets.Add<bool> ("eom",
boost::bind(&Rw11UnitTape::Eom, pobj));
fGets.Add<int> ("posfile",
boost::bind(&Rw11UnitTape::PosFile, pobj));
fGets.Add<int> ("posrecord",
boost::bind(&Rw11UnitTape::PosRecord, pobj));
fSets.Add<const string&> ("type",
boost::bind(&Rw11UnitTape::SetType,pobj, _1));
fSets.Add<bool> ("wprot",
boost::bind(&Rw11UnitTape::SetWProt,pobj, _1));
fSets.Add<size_t> ("capacity",
boost::bind(&Rw11UnitTape::SetCapacity,pobj, _1));
fSets.Add<int> ("posfile",
boost::bind(&Rw11UnitTape::SetPosFile,pobj, _1));
fSets.Add<int> ("posrecord",
boost::bind(&Rw11UnitTape::SetPosRecord,pobj, _1));
return;
}
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTape.hpp 683 2015-05-17 21:54:35Z mueller $
// $Id: RtclRw11UnitTape.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2015-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,13 +13,14 @@
//
// Revision History:
// Date Rev Version Comment
// 2015-05-17 683 0.1 First draft
// 2017-04-08 870 1.1 use Rw11UnitTape& ObjUV(); inherit from RtclRw11Unit
// 2015-05-17 683 1.0 Initial version
// ---------------------------------------------------------------------------
/*!
\file
\version $Id: RtclRw11UnitTape.hpp 683 2015-05-17 21:54:35Z mueller $
\version $Id: RtclRw11UnitTape.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitTape.
*/
@@ -32,16 +33,17 @@
namespace Retro {
class RtclRw11UnitTape {
class RtclRw11UnitTape : public RtclRw11Unit {
public:
RtclRw11UnitTape(RtclRw11Unit* ptcl, Rw11UnitTape* pobj);
RtclRw11UnitTape(const std::string& type);
~RtclRw11UnitTape();
virtual Rw11UnitTape& ObjUV() = 0;
protected:
void SetupGetSet();
protected:
RtclRw11Unit* fpTcl;
Rw11UnitTape* fpObj;
};
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTerm.cpp 511 2013-04-27 13:51:46Z mueller $
// $Id: RtclRw11UnitTerm.cpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitTerm& ObjUV(); inherit from RtclRw11Unit
// 2013-04-26 511 1.0.1 add M_type
// 2013-03-03 494 1.0 Initial version
// 2013-03-01 493 0.1 First draft
@@ -20,7 +21,7 @@
/*!
\file
\version $Id: RtclRw11UnitTerm.cpp 511 2013-04-27 13:51:46Z mueller $
\version $Id: RtclRw11UnitTerm.cpp 870 2017-04-08 18:24:34Z mueller $
\brief Implemenation of RtclRw11UnitTerm.
*/
@@ -39,34 +40,10 @@ namespace Retro {
//------------------------------------------+-----------------------------------
//! Constructor
RtclRw11UnitTerm::RtclRw11UnitTerm(RtclRw11Unit* ptcl, Rw11UnitTerm* pobj)
: fpTcl(ptcl),
fpObj(pobj)
RtclRw11UnitTerm::RtclRw11UnitTerm(const std::string& type)
: RtclRw11Unit(type)
{
ptcl->AddMeth("type", boost::bind(&RtclRw11UnitTerm::M_type, this, _1));
RtclGetList& gets = ptcl->GetList();
RtclSetList& sets = ptcl->SetList();
gets.Add<const string&> ("channelid",
boost::bind(&Rw11UnitTerm::ChannelId, pobj));
gets.Add<bool> ("to7bit",
boost::bind(&Rw11UnitTerm::To7bit, pobj));
gets.Add<bool> ("toenpc",
boost::bind(&Rw11UnitTerm::ToEnpc, pobj));
gets.Add<bool> ("ti7bit",
boost::bind(&Rw11UnitTerm::Ti7bit, pobj));
gets.Add<const string&> ("log",
boost::bind(&Rw11UnitTerm::Log, pobj));
sets.Add<bool> ("to7bit",
boost::bind(&Rw11UnitTerm::SetTo7bit,pobj, _1));
sets.Add<bool> ("toenpc",
boost::bind(&Rw11UnitTerm::SetToEnpc,pobj, _1));
sets.Add<bool> ("ti7bit",
boost::bind(&Rw11UnitTerm::SetTi7bit,pobj, _1));
sets.Add<const string&> ("log",
boost::bind(&Rw11UnitTerm::SetLog,pobj, _1));
AddMeth("type", boost::bind(&RtclRw11UnitTerm::M_type, this, _1));
}
//------------------------------------------+-----------------------------------
@@ -82,12 +59,45 @@ int RtclRw11UnitTerm::M_type(RtclArgs& args)
{
string text;
if (!args.GetArg("text", text)) return TCL_ERROR;
if (!args.AllDone()) return TCL_ERROR;
fpObj->RcvCallback((const uint8_t*)text.data(), text.size());
ObjUV().RcvCallback((const uint8_t*)text.data(), text.size());
return TCL_OK;
}
//------------------------------------------+-----------------------------------
//! FIXME_docs
void RtclRw11UnitTerm::SetupGetSet()
{
// this can't be in ctor because pure virtual is called which is available
// only when more derived class is being constructed. SetupGetSet() must be
// called in ctor of a more derived class.
Rw11UnitTerm* pobj = &ObjUV();
fGets.Add<const string&> ("channelid",
boost::bind(&Rw11UnitTerm::ChannelId, pobj));
fGets.Add<bool> ("to7bit",
boost::bind(&Rw11UnitTerm::To7bit, pobj));
fGets.Add<bool> ("toenpc",
boost::bind(&Rw11UnitTerm::ToEnpc, pobj));
fGets.Add<bool> ("ti7bit",
boost::bind(&Rw11UnitTerm::Ti7bit, pobj));
fGets.Add<const string&> ("log",
boost::bind(&Rw11UnitTerm::Log, pobj));
fSets.Add<bool> ("to7bit",
boost::bind(&Rw11UnitTerm::SetTo7bit,pobj, _1));
fSets.Add<bool> ("toenpc",
boost::bind(&Rw11UnitTerm::SetToEnpc,pobj, _1));
fSets.Add<bool> ("ti7bit",
boost::bind(&Rw11UnitTerm::SetTi7bit,pobj, _1));
fSets.Add<const string&> ("log",
boost::bind(&Rw11UnitTerm::SetLog,pobj, _1));
return;
}
} // end namespace Retro

View File

@@ -1,6 +1,6 @@
// $Id: RtclRw11UnitTerm.hpp 511 2013-04-27 13:51:46Z mueller $
// $Id: RtclRw11UnitTerm.hpp 870 2017-04-08 18:24:34Z mueller $
//
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
//
// This program is free software; you may redistribute and/or modify it under
// the terms of the GNU General Public License as published by the Free
@@ -13,6 +13,7 @@
//
// Revision History:
// Date Rev Version Comment
// 2017-04-08 870 1.1 use Rw11UnitTerm& ObjUV(); inherit from RtclRw11Unit
// 2013-04-26 511 1.0.1 add M_type
// 2013-03-03 494 1.0 Initial version
// 2013-03-01 493 0.1 First draft
@@ -21,7 +22,7 @@
/*!
\file
\version $Id: RtclRw11UnitTerm.hpp 511 2013-04-27 13:51:46Z mueller $
\version $Id: RtclRw11UnitTerm.hpp 870 2017-04-08 18:24:34Z mueller $
\brief Declaration of class RtclRw11UnitTerm.
*/
@@ -34,17 +35,17 @@
namespace Retro {
class RtclRw11UnitTerm {
class RtclRw11UnitTerm : public RtclRw11Unit {
public:
RtclRw11UnitTerm(RtclRw11Unit* ptcl, Rw11UnitTerm* pobj);
RtclRw11UnitTerm(const std::string& type);
~RtclRw11UnitTerm();
virtual Rw11UnitTerm& ObjUV() = 0;
protected:
int M_type(RtclArgs& args);
void SetupGetSet();
protected:
RtclRw11Unit* fpTcl;
Rw11UnitTerm* fpObj;
};
} // end namespace Retro