mirror of
https://github.com/wfjm/w11.git
synced 2026-05-04 23:26:38 +00:00
use std::bind instead of lambda
- automatic return type detection for lambda's can be error prone - it is safer and more compact to use std:bind as method forwarder - closes issue #19
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -14,7 +14,7 @@
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-19 1090 1.1.4 use RosPrintf(bool)
|
||||
// 2018-12-15 1082 1.1.3 use lambda instead of bind
|
||||
// 2018-12-15 1082 1.1.3 use lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.1.2 use std::shared_ptr instead of boost and range loop
|
||||
// 2017-04-07 868 1.1.1 Dump(): add detail arg
|
||||
// 2014-12-30 625 1.1 adopt to Rlink V4 attn logic
|
||||
@@ -27,6 +27,8 @@
|
||||
\brief Implemenation of Rw11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/Rexception.hpp"
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -35,6 +37,7 @@
|
||||
#include "Rw11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11
|
||||
@@ -70,8 +73,7 @@ Rw11::~Rw11()
|
||||
void Rw11::SetServer(const std::shared_ptr<RlinkServer>& spserv)
|
||||
{
|
||||
fspServ = spserv;
|
||||
fspServ->AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
fspServ->AddAttnHandler(bind(&Rw11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<kLam, this);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlDEUNA.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11CntlDEUNA.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2014-2019 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,9 +13,10 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 0.5.8 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 0.5.7 use RosPrintf(bool)
|
||||
// 2018-12-17 1087 0.5.6 use std::lock_guard instead of boost
|
||||
// 2018-12-15 1082 0.5.5 use lambda instead of bind
|
||||
// 2018-12-15 1082 0.5.5 use lambda instead of boost::bind
|
||||
// 2018-12-09 1080 0.5.4 use HasVirt(); Virt() returns ref
|
||||
// 2018-12-08 1078 0.5.3 BUGFIX: Start(Tx|Rx)Ring, was broken in r1049
|
||||
// when fixing -Wunused-variable warnings
|
||||
@@ -35,6 +36,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
@@ -48,6 +50,7 @@
|
||||
#include "Rw11CntlDEUNA.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlDEUNA
|
||||
@@ -354,8 +357,7 @@ void Rw11CntlDEUNA::Start()
|
||||
UnitSetup(0);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlDEUNA::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
fStarted = true;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlDL11.cpp 1089 2018-12-19 10:45:41Z mueller $
|
||||
// $Id: Rw11CntlDL11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 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,7 +13,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.3.2 use lambda instead of bind
|
||||
// 2019-02-23 1114 1.3.2 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.3.1 use lambda instead of boost::bind
|
||||
// 2017-05-14 897 1.3 add RcvChar(),TraceChar(); trace received chars
|
||||
// 2017-04-02 865 1.2.3 Dump(): add detail arg
|
||||
// 2017-03-03 858 1.2.2 use cntl name as message prefix
|
||||
@@ -31,6 +32,8 @@
|
||||
\brief Implemenation of Rw11CntlDL11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -40,6 +43,7 @@
|
||||
#include "Rw11CntlDL11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlDL11
|
||||
@@ -122,8 +126,7 @@ void Rw11CntlDL11::Start()
|
||||
fPC_xbuf = Cpu().AddRibr(fPrimClist, fBase+kXBUF);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlDL11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
fStarted = true;
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlLP11.cpp 1089 2018-12-19 10:45:41Z mueller $
|
||||
// $Id: Rw11CntlLP11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 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,7 +13,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.2.5 use lambda instead of bind
|
||||
// 2019-02-23 1114 1.2.6 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.2.5 use lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.2.4 use HasVirt()
|
||||
// 2017-04-02 865 1.2.3 Dump(): add detail arg
|
||||
// 2017-03-03 858 1.2.2 use cntl name as message prefix
|
||||
@@ -29,6 +30,8 @@
|
||||
\brief Implemenation of Rw11CntlLP11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -38,6 +41,7 @@
|
||||
#include "Rw11CntlLP11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlLP11
|
||||
@@ -110,8 +114,7 @@ void Rw11CntlLP11::Start()
|
||||
fPC_buf = Cpu().AddRibr(fPrimClist, fBase+kBUF);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlLP11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlPC11.cpp 1089 2018-12-19 10:45:41Z mueller $
|
||||
// $Id: Rw11CntlPC11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 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,7 +13,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.3.3 use lambda instead of bind
|
||||
// 2019-02-23 1114 1.3.4 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.3.3 use lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.3.2 use HasVirt(); Virt() returns ref
|
||||
// 2018-10-28 1062 1.3.1 replace boost/foreach
|
||||
// 2017-05-14 897 1.3 trace received chars
|
||||
@@ -29,6 +30,8 @@
|
||||
\brief Implemenation of Rw11CntlPC11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -38,6 +41,7 @@
|
||||
#include "Rw11CntlPC11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlPC11
|
||||
@@ -121,8 +125,7 @@ void Rw11CntlPC11::Start()
|
||||
fPC_pbuf = Cpu().AddRibr(fPrimClist, fBase+kPBUF);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlPC11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlRHRP.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11CntlRHRP.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
// the boot code is from the simh project and Copyright Robert M Supnik
|
||||
//
|
||||
@@ -15,8 +15,9 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 1.0.10 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 1.0.9 use RosPrintf(bool)
|
||||
// 2018-12-15 1082 1.0.8 use std::bind or lambda instead of bind
|
||||
// 2018-12-15 1082 1.0.8 use std::bind or lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.0.7 use HasVirt(); Virt() returns ref
|
||||
// 2018-10-28 1062 1.0.6 replace boost/foreach
|
||||
// 2017-04-02 865 1.0.5 Dump(): add detail arg
|
||||
@@ -33,6 +34,8 @@
|
||||
\brief Implemenation of Rw11CntlRHRP.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -42,6 +45,7 @@
|
||||
#include "Rw11CntlRHRP.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlRHRP
|
||||
@@ -187,12 +191,8 @@ Rw11CntlRHRP::Rw11CntlRHRP()
|
||||
fRd_fu(0),
|
||||
fRd_ovr(false),
|
||||
fRdma(this,
|
||||
std::bind(&Rw11CntlRHRP::RdmaPreExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4),
|
||||
std::bind(&Rw11CntlRHRP::RdmaPostExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4))
|
||||
std::bind(&Rw11CntlRHRP::RdmaPreExecCB, this, _1, _2, _3, _4),
|
||||
std::bind(&Rw11CntlRHRP::RdmaPostExecCB, this, _1, _2, _3, _4))
|
||||
{
|
||||
// must be here because Units have a back-ptr (not available at Rw11CntlBase)
|
||||
for (size_t i=0; i<NUnit(); i++) {
|
||||
@@ -275,8 +275,7 @@ void Rw11CntlRHRP::Start()
|
||||
fPC_rpdc = Cpu().AddRibr(fPrimClist, fBase+kRPDC);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlRHRP::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlRK11.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11CntlRK11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
// the boot code is from the simh project and Copyright Robert M Supnik
|
||||
//
|
||||
@@ -15,8 +15,9 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 2.0.10 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 2.0.9 use RosPrintf(bool)
|
||||
// 2018-12-15 1082 2.0.8 use std::bind or lambda instead of boost
|
||||
// 2018-12-15 1082 2.0.8 use std::bind or lambda instead of boost::bind
|
||||
// 2018-12-09 1080 2.0.7 use HasVirt(); Virt() returns ref
|
||||
// 2018-10-28 1062 2.0.6 replace boost/foreach
|
||||
// 2017-04-02 865 2.0.5 Dump(): add detail arg
|
||||
@@ -37,6 +38,8 @@
|
||||
\brief Implemenation of Rw11CntlRK11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -44,6 +47,7 @@
|
||||
#include "librtools/RlogMsg.hpp"
|
||||
|
||||
#include "Rw11CntlRK11.hpp"
|
||||
using namespace std::placeholders;
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -154,12 +158,8 @@ Rw11CntlRK11::Rw11CntlRK11()
|
||||
fRd_fu(0),
|
||||
fRd_ovr(false),
|
||||
fRdma(this,
|
||||
std::bind(&Rw11CntlRK11::RdmaPreExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4),
|
||||
std::bind(&Rw11CntlRK11::RdmaPostExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4))
|
||||
std::bind(&Rw11CntlRK11::RdmaPreExecCB, this, _1, _2, _3, _4),
|
||||
std::bind(&Rw11CntlRK11::RdmaPostExecCB, this, _1, _2, _3, _4))
|
||||
{
|
||||
// must be here because Units have a back-ptr (not available at Rw11CntlBase)
|
||||
for (size_t i=0; i<NUnit(); i++) {
|
||||
@@ -220,8 +220,7 @@ void Rw11CntlRK11::Start()
|
||||
fPC_rkcs = Cpu().AddRibr(fPrimClist, fBase+kRKCS);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlRK11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlRL11.cpp 1091 2018-12-23 12:38:29Z mueller $
|
||||
// $Id: Rw11CntlRL11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2014-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
// the boot code is from the simh project and Copyright Robert M Supnik
|
||||
// CalcCrc() is adopted from the simh project and Copyright Robert M Supnik
|
||||
@@ -16,9 +16,10 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 1.0.11 use std::bind instead of lambda
|
||||
// 2018-12-22 1091 1.0.10 AttnHandler(): sa->san (-Wshadow fix)
|
||||
// 2018-12-19 1090 1.0.9 use RosPrintf(bool)
|
||||
// 2018-12-15 1082 1.0.8 use std::bind or lambda instead of bind
|
||||
// 2018-12-15 1082 1.0.8 use std::bind or lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.0.7 use HasVirt(); Virt() returns ref
|
||||
// 2018-10-28 1062 1.0.6 replace boost/foreach
|
||||
// 2017-04-02 865 1.0.5 Dump(): add detail arg
|
||||
@@ -35,6 +36,8 @@
|
||||
\brief Implemenation of Rw11CntlRL11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -44,6 +47,7 @@
|
||||
#include "Rw11CntlRL11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlRL11
|
||||
@@ -196,12 +200,8 @@ Rw11CntlRL11::Rw11CntlRL11()
|
||||
fRd_fu(0),
|
||||
fRd_ovr(false),
|
||||
fRdma(this,
|
||||
std::bind(&Rw11CntlRL11::RdmaPreExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4),
|
||||
std::bind(&Rw11CntlRL11::RdmaPostExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4))
|
||||
std::bind(&Rw11CntlRL11::RdmaPreExecCB, this, _1, _2, _3, _4),
|
||||
std::bind(&Rw11CntlRL11::RdmaPostExecCB, this, _1, _2, _3, _4))
|
||||
{
|
||||
// must be here because Units have a back-ptr (not available at Rw11CntlBase)
|
||||
for (size_t i=0; i<NUnit(); i++) {
|
||||
@@ -261,8 +261,7 @@ void Rw11CntlRL11::Start()
|
||||
fPC_pos = Cpu().AddRibr(fPrimClist, fBase+kRLMP);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlRL11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11CntlTM11.cpp 1089 2018-12-19 10:45:41Z mueller $
|
||||
// $Id: Rw11CntlTM11.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2015-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Other credits:
|
||||
// the boot code is from the simh project and Copyright Robert M Supnik
|
||||
//
|
||||
@@ -15,7 +15,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.0.7 use std::bind or lambda instead of boost
|
||||
// 2019-02-23 1114 1.0.8 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.0.7 use std::bind or lambda instead of boost::bind
|
||||
// 2018-12-09 1080 1.0.6 use HasVirt(); Virt() returns ref
|
||||
// 2018-10-28 1062 1.0.5 replace boost/foreach
|
||||
// 2017-04-02 865 1.0.4 Dump(): add detail arg
|
||||
@@ -31,6 +32,8 @@
|
||||
\brief Implemenation of Rw11CntlTM11.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintBvi.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -40,6 +43,7 @@
|
||||
#include "Rw11CntlTM11.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11CntlTM11
|
||||
@@ -139,12 +143,8 @@ Rw11CntlTM11::Rw11CntlTM11()
|
||||
fRd_opcode(0),
|
||||
fBuf(),
|
||||
fRdma(this,
|
||||
std::bind(&Rw11CntlTM11::RdmaPreExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4),
|
||||
std::bind(&Rw11CntlTM11::RdmaPostExecCB, this,
|
||||
placeholders::_1, placeholders::_2,
|
||||
placeholders::_3, placeholders::_4))
|
||||
std::bind(&Rw11CntlTM11::RdmaPreExecCB, this, _1, _2, _3, _4),
|
||||
std::bind(&Rw11CntlTM11::RdmaPostExecCB, this, _1, _2, _3, _4))
|
||||
{
|
||||
// must be here because Units have a back-ptr (not available at Rw11CntlBase)
|
||||
for (size_t i=0; i<NUnit(); i++) {
|
||||
@@ -203,8 +203,7 @@ void Rw11CntlTM11::Start()
|
||||
fPC_tmba = Cpu().AddRibr(fPrimClist, fBase+kTMBA);
|
||||
|
||||
// add attn handler
|
||||
Server().AddAttnHandler([this](RlinkServer::AttnArgs& args)
|
||||
{ return AttnHandler(args); },
|
||||
Server().AddAttnHandler(bind(&Rw11CntlTM11::AttnHandler, this, _1),
|
||||
uint16_t(1)<<fLam, this);
|
||||
|
||||
fStarted = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11Rdma.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11Rdma.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2015-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2015-2019 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,9 +13,10 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 1.1.5 use std::bind instead of lambda
|
||||
// 2018-12-19 1090 1.1.4 use RosPrintf(bool)
|
||||
// 2018-12-15 1083 1.1.3 for std::function setups: use rval ref and move
|
||||
// 2018-12-15 1082 1.1.2 use lambda instead of bind
|
||||
// 2018-12-15 1082 1.1.2 use lambda instead of boost::bind
|
||||
// 2017-04-02 865 1.1.1 Dump(): add detail arg
|
||||
// 2015-02-17 647 1.1 PreExecCB with nwdone and nwnext
|
||||
// 2015-01-04 627 1.0 Initial version
|
||||
@@ -27,6 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/Rexception.hpp"
|
||||
#include "librtools/RosFill.hpp"
|
||||
@@ -96,7 +98,7 @@ void Rw11Rdma::QueueRMem(uint32_t addr, uint16_t* block, size_t size,
|
||||
{
|
||||
fStats.Inc(kStatNQueRMem);
|
||||
SetupRdma(false, addr, block, size, mode);
|
||||
Server().QueueAction([this](){ return RdmaHandler(); });
|
||||
Server().QueueAction(bind(&Rw11Rdma::RdmaHandler, this));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,7 +110,7 @@ void Rw11Rdma::QueueWMem(uint32_t addr, const uint16_t* block, size_t size,
|
||||
{
|
||||
fStats.Inc(kStatNQueWMem);
|
||||
SetupRdma(true, addr, const_cast<uint16_t*>(block), size, mode);
|
||||
Server().QueueAction([this](){ return RdmaHandler(); });
|
||||
Server().QueueAction(bind(&Rw11Rdma::RdmaHandler, this));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11UnitDEUNA.cpp 1083 2018-12-15 19:19:16Z mueller $
|
||||
// $Id: Rw11UnitDEUNA.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2014-2019 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,7 +13,7 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-14 1081 1.0.3 use std::bind instead of boost
|
||||
// 2018-12-14 1081 1.0.3 use std::bind instead of boost::bind
|
||||
// 2018-12-09 1080 1.0.2 use HasVirt(); Virt() returns ref
|
||||
// 2018-12-01 1076 1.0.1 use unique_ptr
|
||||
// 2017-01-29 847 1.0 Initial version
|
||||
@@ -25,12 +25,15 @@
|
||||
\brief Implemenation of Rw11UnitDEUNA.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "Rw11CntlDEUNA.hpp"
|
||||
|
||||
#include "Rw11UnitDEUNA.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11UnitDEUNA
|
||||
@@ -72,8 +75,7 @@ void Rw11UnitDEUNA::Dump(std::ostream& os, int ind, const char* text,
|
||||
|
||||
void Rw11UnitDEUNA::AttachDone()
|
||||
{
|
||||
Virt().SetupRcvCallback(std::bind(&Rw11CntlDEUNA::RcvCallback,
|
||||
&Cntl(), placeholders::_1));
|
||||
Virt().SetupRcvCallback(bind(&Rw11CntlDEUNA::RcvCallback, &Cntl(), _1));
|
||||
Cntl().UnitSetup(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11UnitTerm.cpp 1090 2018-12-21 12:17:35Z mueller $
|
||||
// $Id: Rw11UnitTerm.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -30,6 +30,8 @@
|
||||
\brief Implemenation of Rw11UnitTerm.
|
||||
*/
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RparseUrl.hpp"
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -38,6 +40,7 @@
|
||||
#include "Rw11UnitTerm.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11UnitTerm
|
||||
@@ -295,8 +298,7 @@ void Rw11UnitTerm::Dump(std::ostream& os, int ind, const char* text,
|
||||
|
||||
void Rw11UnitTerm::AttachDone()
|
||||
{
|
||||
Virt().SetupRcvCallback(std::bind(&Rw11UnitTerm::RcvCallback,
|
||||
this, placeholders::_1, placeholders::_2));
|
||||
Virt().SetupRcvCallback(std::bind(&Rw11UnitTerm::RcvCallback, this, _1, _2));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11VirtEthTap.cpp 1088 2018-12-17 17:37:00Z mueller $
|
||||
// $Id: Rw11VirtEthTap.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2014-2019 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,7 +13,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.0.3 use lambda instead of bind
|
||||
// 2019-02-23 1114 1.0.4 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.0.3 use lambda instead of boost::bind
|
||||
// 2018-11-30 1075 1.0.2 use list-init
|
||||
// 2018-10-27 1059 1.0.1 coverity fixup (uncaught exception in dtor)
|
||||
// BUGFIX: coverity (buffer not null terminated)
|
||||
@@ -37,12 +38,15 @@
|
||||
#include <net/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/Rtools.hpp"
|
||||
|
||||
#include "Rw11VirtEthTap.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11VirtEthTap
|
||||
@@ -105,8 +109,7 @@ bool Rw11VirtEthTap::Open(const std::string& url, RerrMsg& emsg)
|
||||
|
||||
fFd = fd;
|
||||
|
||||
Server().AddPollHandler([this](const pollfd& pfd)
|
||||
{ return RcvPollHandler(pfd); },
|
||||
Server().AddPollHandler(bind(&Rw11VirtEthTap::RcvPollHandler, this, _1),
|
||||
fFd, POLLIN);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11VirtTermPty.cpp 1082 2018-12-15 13:56:20Z mueller $
|
||||
// $Id: Rw11VirtTermPty.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 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,7 +13,8 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2018-12-15 1082 1.0.4 use lambda instead of bind
|
||||
// 2019-02-23 1114 1.0.5 use std::bind instead of lambda
|
||||
// 2018-12-15 1082 1.0.4 use lambda instead of boost::bind
|
||||
// 2018-10-27 1059 1.0.3 coverity fixup (uncaught exception in dtor)
|
||||
// 2017-04-15 875 1.0.2 Open(): set default scheme
|
||||
// 2017-04-07 868 1.0.1 Dump(): add detail arg
|
||||
@@ -32,10 +33,13 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "Rw11VirtTermPty.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11VirtTermPty
|
||||
@@ -102,8 +106,7 @@ bool Rw11VirtTermPty::Open(const std::string& url, RerrMsg& emsg)
|
||||
fFd = fd;
|
||||
fChannelId = pname;
|
||||
|
||||
Server().AddPollHandler([this](const pollfd& pfd)
|
||||
{ return RcvPollHandler(pfd); },
|
||||
Server().AddPollHandler(bind(&Rw11VirtTermPty::RcvPollHandler, this, _1),
|
||||
fFd, POLLIN);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11VirtTermTcp.cpp 1091 2018-12-23 12:38:29Z mueller $
|
||||
// $Id: Rw11VirtTermTcp.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 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,10 +13,11 @@
|
||||
//
|
||||
// Revision History:
|
||||
// Date Rev Version Comment
|
||||
// 2019-02-23 1114 1.0.14 use std::bind instead of lambda
|
||||
// 2018-12-22 1091 1.0.13 pfd->pfd1 (-Wshadow fix)
|
||||
// 2018-12-19 1090 1.0.12 use RosPrintf(bool)
|
||||
// 2018-12-18 1089 1.0.11 use c++ style casts
|
||||
// 2018-12-15 1082 1.0.10 use lambda instead of bind
|
||||
// 2018-12-15 1082 1.0.10 use lambda instead of boost::bind
|
||||
// 2018-11-30 1075 1.0.9 use list-init
|
||||
// 2018-11-11 1066 1.0.8 coverity fixup (unchecked return value)
|
||||
// 2018-10-27 1059 1.0.7 coverity fixup (uncaught exception in dtor)
|
||||
@@ -41,6 +42,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
|
||||
#include "librtools/RosFill.hpp"
|
||||
#include "librtools/RosPrintf.hpp"
|
||||
@@ -50,6 +52,7 @@
|
||||
#include "Rw11VirtTermTcp.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
/*!
|
||||
\class Retro::Rw11VirtTermTcp
|
||||
@@ -188,8 +191,7 @@ bool Rw11VirtTermTcp::Open(const std::string& url, RerrMsg& emsg)
|
||||
lmsg << "TermTcp: listen on " << fChannelId << " for " << Unit().Name();
|
||||
}
|
||||
|
||||
Server().AddPollHandler([this](const pollfd& pfd)
|
||||
{ return ListenPollHandler(pfd); },
|
||||
Server().AddPollHandler(bind(&Rw11VirtTermTcp::ListenPollHandler, this, _1),
|
||||
fFdListen, POLLIN);
|
||||
|
||||
return true;
|
||||
@@ -345,8 +347,7 @@ int Rw11VirtTermTcp::ListenPollHandler(const pollfd& pfd)
|
||||
fState = ts_Stream;
|
||||
|
||||
Server().RemovePollHandler(fFdListen);
|
||||
Server().AddPollHandler([this](const pollfd& pfd1)
|
||||
{ return RcvPollHandler(pfd1); },
|
||||
Server().AddPollHandler(bind(&Rw11VirtTermTcp::RcvPollHandler, this, _1),
|
||||
fFd, POLLIN);
|
||||
return 0;
|
||||
}
|
||||
@@ -432,8 +433,7 @@ int Rw11VirtTermTcp::RcvPollHandler(const pollfd& pfd)
|
||||
}
|
||||
::close(fFd);
|
||||
fFd = -1;
|
||||
Server().AddPollHandler([this](const pollfd& pfd1)
|
||||
{ return ListenPollHandler(pfd1); },
|
||||
Server().AddPollHandler(bind(&Rw11VirtTermTcp::ListenPollHandler, this, _1),
|
||||
fFdListen, POLLIN);
|
||||
fState = ts_Listen;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user