Changeset 13766 for trunk


Ignore:
Timestamp:
05/17/12 20:20:58 (12 years ago)
Author:
tbretz
Message:
Replaced boost::function by std::function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r13692 r13766  
    77#include <valarray>
    88
    9 #include <boost/bind.hpp>
    109#include <boost/regex.hpp>
    1110
     
    166165    {
    167166    public:
    168         boost::function<void(const QEvent &)> fFunction;
    169 
    170         FunctionEvent(const boost::function<void(const QEvent &)> &f)
     167        function<void(const QEvent &)> fFunction;
     168
     169        FunctionEvent(const function<void(const QEvent &)> &f)
    171170            : QEvent((QEvent::Type)QEvent::registerEventType()),
    172171            fFunction(f) { }
     
    273272    // ===================== Services and Commands ==========================
    274273
    275     QStandardItem *AddServiceItem(const std::string &server, const std::string &service, bool iscmd)
     274    QStandardItem *AddServiceItem(const string &server, const string &service, bool iscmd)
    276275    {
    277276        QListView *servers     = iscmd ? fDimCmdServers     : fDimSvcServers;
     
    350349    }
    351350
    352     void AddServer(const std::string &s)
     351    void AddServer(const string &s)
    353352    {
    354353        DimNetwork::AddServer(s);
    355354
    356355        QApplication::postEvent(this,
    357            new FunctionEvent(boost::bind(&FactGui::handleAddServer, this, s)));
    358     }
    359 
    360     void AddService(const std::string &server, const std::string &service, const std::string &fmt, bool iscmd)
     356           new FunctionEvent(bind(&FactGui::handleAddServer, this, s)));
     357    }
     358
     359    void AddService(const string &server, const string &service, const string &fmt, bool iscmd)
    361360    {
    362361        QApplication::postEvent(this,
    363            new FunctionEvent(boost::bind(&FactGui::handleAddService, this, server, service, fmt, iscmd)));
    364     }
    365 
    366     void RemoveService(std::string server, std::string service, bool iscmd)
     362           new FunctionEvent(bind(&FactGui::handleAddService, this, server, service, fmt, iscmd)));
     363    }
     364
     365    void RemoveService(string server, string service, bool iscmd)
    367366    {
    368367        UnsubscribeService(server+'/'+service, true);
    369368
    370369        QApplication::postEvent(this,
    371            new FunctionEvent(boost::bind(&FactGui::handleRemoveService, this, server, service, iscmd)));
    372     }
    373 
    374     void RemoveAllServices(const std::string &server)
     370           new FunctionEvent(bind(&FactGui::handleRemoveService, this, server, service, iscmd)));
     371    }
     372
     373    void RemoveAllServices(const string &server)
    375374    {
    376375        UnsubscribeAllServices(server);
    377376
    378377        QApplication::postEvent(this,
    379            new FunctionEvent(boost::bind(&FactGui::handleRemoveAllServices, this, server)));
    380     }
    381 
    382     void AddDescription(const std::string &server, const std::string &service, const vector<Description> &vec)
     378           new FunctionEvent(bind(&FactGui::handleRemoveAllServices, this, server)));
     379    }
     380
     381    void AddDescription(const string &server, const string &service, const vector<Description> &vec)
    383382    {
    384383        QApplication::postEvent(this,
    385            new FunctionEvent(boost::bind(&FactGui::handleAddDescription, this, server, service, vec)));
     384           new FunctionEvent(bind(&FactGui::handleAddDescription, this, server, service, vec)));
    386385    }
    387386
    388387    // ======================================================================
    389388
    390     void handleAddServer(const std::string &server)
     389    void handleAddServer(const string &server)
    391390    {
    392391        const State s = GetState(server, GetCurrentState(server));
     
    394393    }
    395394
    396     void handleAddService(const std::string &server, const std::string &service, const std::string &/*fmt*/, bool iscmd)
     395    void handleAddService(const string &server, const string &service, const string &/*fmt*/, bool iscmd)
    397396    {
    398397        QStandardItem *item = AddServiceItem(server, service, iscmd);
     
    401400    }
    402401
    403     void handleRemoveService(const std::string &server, const std::string &service, bool iscmd)
     402    void handleRemoveService(const string &server, const string &service, bool iscmd)
    404403    {
    405404        QListView *servers = iscmd ? fDimCmdServers : fDimSvcServers;
     
    424423    }
    425424
    426     void handleRemoveAllServices(const std::string &server)
     425    void handleRemoveAllServices(const string &server)
    427426    {
    428427        handleStateChanged(Time(), server, State(-2, "Offline", "No connection via DIM."));
     
    444443    }
    445444
    446     void handleAddDescription(const std::string &server, const std::string &service, const vector<Description> &vec)
     445    void handleAddDescription(const string &server, const string &service, const vector<Description> &vec)
    447446    {
    448447        const bool iscmd = IsCommand(server, service)==true;
     
    26062605                dat[i] -= fVecBiasVolt[entry.hv()]/fBiasOffsets[entry.hv()]*1e6;
    26072606
    2608             //dat[i] /= entry.group()==0 ? 4 : 5;
     2607            dat[i] *= 4.5 / (entry.group() ? 5 : 4);
    26092608
    26102609            fBiasCamA->SetEnable(i, uint16_t(ptr[entry.hv()])!=0x8000);
     
    26222621    bool fChatOnline;
    26232622
    2624     void handleStateChanged(const Time &time, const std::string &server,
     2623    void handleStateChanged(const Time &time, const string &server,
    26252624                            const State &s)
    26262625    {
     
    29832982    }
    29842983
    2985     void IndicateStateChange(const Time &time, const std::string &server)
     2984    void IndicateStateChange(const Time &time, const string &server)
    29862985    {
    29872986        const State s = GetState(server, GetCurrentState(server));
    29882987
    29892988        QApplication::postEvent(this,
    2990            new FunctionEvent(boost::bind(&FactGui::handleStateChanged, this, time, server, s)));
     2989           new FunctionEvent(bind(&FactGui::handleStateChanged, this, time, server, s)));
    29912990    }
    29922991
     
    29942993    {
    29952994        QApplication::postEvent(this,
    2996            new FunctionEvent(boost::bind(&FactGui::handleWrite, this, time, txt, qos)));
     2995           new FunctionEvent(bind(&FactGui::handleWrite, this, time, txt, qos)));
    29972996
    29982997        return 0;
     
    30573056
    30583057        QApplication::postEvent(this,
    3059                                 new FunctionEvent(boost::bind(&FactGui::handleDimService, this, str)));
     3058                                new FunctionEvent(bind(&FactGui::handleDimService, this, str)));
    30603059    }
    30613060
     
    30813080        //const boost::function<void()> f = boost::bind(handler, this, DimData(getInfo()));
    30823081
    3083         FunctionEvent *evt = new FunctionEvent(boost::bind(&FactGui::CallInfoHandler, this, handler, DimData(getInfo())));
     3082        FunctionEvent *evt = new FunctionEvent(bind(&FactGui::CallInfoHandler, this, handler, DimData(getInfo())));
    30843083        // FunctionEvent *evt = new FunctionEvent(boost::bind(&FactGui::CallInfoHandler, this, f));
    30853084        // FunctionEvent *evt = new FunctionEvent(boost::bind(handler, this, DimData(getInfo()))));
Note: See TracChangeset for help on using the changeset viewer.