Changeset 11481


Ignore:
Timestamp:
07/20/11 08:03:38 (13 years ago)
Author:
tbretz
Message:
Replaced boost::thread by std::thread and boost::bind by std::bind from the C++0x standard
Location:
trunk/FACT++/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Configuration.cc

    r11479 r11481  
    332332#include <iomanip>
    333333
    334 #include <boost/bind.hpp>
    335334#include <boost/regex.hpp>
    336335#include <boost/filesystem.hpp>
     
    512511Configuration::Configuration(const string &prgname) : fName(UnLibToolize(prgname)),
    513512fNameMapper(bind1st(mem_fun(&Configuration::DefaultMapper), this)),
    514 fPrintUsage(boost::bind(&Configuration::PrintUsage, this))
     513fPrintUsage(bind(&Configuration::PrintUsage, this))
    515514{
    516515    po::options_description generic("Generic options");
     
    877876//!
    878877//
    879 void Configuration::SetNameMapper(const boost::function<string(string)> &func)
     878void Configuration::SetNameMapper(const function<string(string)> &func)
    880879{
    881880    fNameMapper = func;
     
    887886}
    888887
    889 void Configuration::SetPrintUsage(const boost::function<void(void)> &func)
     888void Configuration::SetPrintUsage(const function<void(void)> &func)
    890889{
    891890    fPrintUsage = func;
     
    894893void Configuration::SetPrintUsage()
    895894{
    896     fPrintUsage = boost::bind(&Configuration::PrintUsage, this);
    897 }
    898 
    899 void Configuration::SetPrintVersion(const boost::function<void(const string&)> &func)
     895    fPrintUsage = bind(&Configuration::PrintUsage, this);
     896}
     897
     898void Configuration::SetPrintVersion(const function<void(const string&)> &func)
    900899{
    901900    fPrintVersion = func;
     
    904903void Configuration::SetPrintVersion()
    905904{
    906     fPrintVersion = boost::function<void(const string&)>();
     905    fPrintVersion = function<void(const string&)>();
    907906}
    908907
     
    13101309#endif
    13111310
    1312     if (!fPrintVersion.empty())
     1311    if (fPrintVersion)
    13131312    {
    13141313        fPrintVersion(fName);
  • trunk/FACT++/src/Configuration.h

    r11387 r11481  
    4646
    4747    /// Pointer to the mapper function for environment variables
    48     boost::function<std::string(std::string)> fNameMapper;
    49     boost::function<void()>                   fPrintUsage;
    50     boost::function<void(const std::string&)> fPrintVersion;
     48    std::function<std::string(std::string)> fNameMapper;
     49    std::function<void()>                   fPrintUsage;
     50    std::function<void(const std::string&)> fPrintVersion;
    5151
    5252    /// Helper function which return the max of the two arguments in the first argument
     
    9595    void SetArgumentPositions(const po::positional_options_description &desc);
    9696
    97     void SetNameMapper(const boost::function<std::string(std::string)> &func);
     97    void SetNameMapper(const std::function<std::string(std::string)> &func);
    9898    void SetNameMapper();
    9999
    100     void SetPrintUsage(const boost::function<void(void)> &func);
     100    void SetPrintUsage(const std::function<void(void)> &func);
    101101    void SetPrintUsage();
    102102
    103     void SetPrintVersion(const boost::function<void(const std::string &)> &func);
     103    void SetPrintVersion(const std::function<void(const std::string &)> &func);
    104104    void SetPrintVersion();
    105105
  • trunk/FACT++/src/EventImp.h

    r11246 r11481  
    55#include <vector>
    66
    7 #include <boost/function.hpp>
    8 //#include <boost/bind/arg.hpp>
     7#include <functional>
    98
    109#include "Time.h"
     
    1615
    1716    /// http://www.boost.org/doc/libs/1_45_0/libs/bind/bind.html
    18     boost::function<int(const EventImp &)> fFunction;
     17    std::function<int(const EventImp &)> fFunction;
    1918
    2019public:
     
    3130    // Function handling
    3231    EventImp &AssignFunction(const boost::function<int(const EventImp &)> &func) { fFunction = func; return *this; }
    33     bool HasFunc() const { return !fFunction.empty(); }
    34     int ExecFunc() const { return HasFunc() ? fFunction(*this) : -1; }
     32    bool HasFunc() const { return fFunction; }
     33    int ExecFunc() const { return fFunction ? fFunction(*this) : -1; }
    3534
    3635    // Configuration helper
  • trunk/FACT++/src/Main.h

    r11472 r11481  
    33
    44#include <thread>
    5 #include <boost/bind.hpp>
     5#include <functional>
    66
    77#include "LocalControl.h"
     
    8383
    8484//    boost::thread t(boost::bind(&AutoScheduler<S>::Run, &io_service));
    85     thread t(boost::bind(MainThread, &io_service, dummy));
     85    thread t(bind(MainThread, &io_service, dummy));
    8686
    8787    const vector<string> v1 = conf.Vec<string>("cmd");
  • trunk/FACT++/src/biasctrl.cc

    r11477 r11481  
    1 #include <boost/bind.hpp>
     1#include <functional>
    22
    33#include "Dim.h"
     
    1818namespace dummy = ba::placeholders;
    1919
     20using namespace std::placeholders;
    2021using namespace std;
    2122
     
    416417    }
    417418
    418     boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    419     {
    420         return boost::bind(&StateMachineBias::Wrap, this, func);
     419    function<int(const EventImp &)> Wrapper(function<void()> func)
     420    {
     421        return bind(&StateMachineBias::Wrap, this, func);
    421422    }
    422423
     
    516517        // Verbosity commands
    517518        T::AddEvent("SET_VERBOSE", "B")
    518             (boost::bind(&StateMachineBias::SetVerbosity, this, _1))
     519            (bind(&StateMachineBias::SetVerbosity, this, _1))
    519520            ("set verbosity state"
    520521             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
     
    522523        // Conenction commands
    523524        AddEvent("DISCONNECT", kStateConnected)
    524             (boost::bind(&StateMachineBias::Disconnect, this))
     525            (bind(&StateMachineBias::Disconnect, this))
    525526            ("disconnect from ethernet");
    526527
    527528        AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected)
    528             (boost::bind(&StateMachineBias::Reconnect, this, _1))
     529            (bind(&StateMachineBias::Reconnect, this, _1))
    529530            ("(Re)connect ethernet connection to FTM, a new address can be given"
    530531             "|[host][string]:new ethernet address in the form <host:port>");
     
    605606    shell.SetReceiver(io_service);
    606607
    607     boost::thread t(boost::bind(RunThread, &io_service));
    608     // boost::thread t(boost::bind(&StateMachineBias<S>::Run, &io_service));
     608    boost::thread t(bind(RunThread, &io_service));
     609    // boost::thread t(bind(&StateMachineBias<S>::Run, &io_service));
    609610
    610611    if (conf.Has("cmd"))
  • trunk/FACT++/src/chatserv.cc

    r11011 r11481  
    11#include <iostream>
    2 
    3 #include <boost/bind.hpp>
    42
    53#include "Dim.h"
     
    6866    {
    6967        AddEvent("MSG", "C")
    70             (boost::bind(&ChatServer::HandleMsg, this, _1))
     68            (bind(&ChatServer::HandleMsg, this, placeholders::_1))
    7169            ("|msg[string]:message to be distributed");
    7270    }
  • trunk/FACT++/src/datalogger.cc

    r11463 r11481  
    4545//#include <sys/stat.h>    //for getting files sizes
    4646#include <fstream>
    47 
    48 #include <boost/bind.hpp>
     47#include <functional>
     48
    4949#include <boost/filesystem.hpp>
    5050
     
    389389    }
    390390    else if (shouldBackLog)
    391          {
     391    {
    392392             ostringstream str;
    393393             MessageImp mimp(str);
     
    580580bool DataLogger::OpenTextFilePlease(ofstream& stream, const string& name)
    581581{
     582    if (stream.is_open())
     583        return true;
     584
    582585    errno = 0;
    583     if (!stream.is_open())
    584586    stream.open(name.c_str(), ios_base::out | ios_base::app);
    585587    if (!stream.is_open())
     
    806808    // Add the possible transitions for this machine
    807809    AddEvent(kSM_NightlyOpen, "START", kSM_Ready, kSM_BadNightlyConfig)
    808         (boost::bind(&DataLogger::StartPlease, this))
     810        (bind(&DataLogger::StartPlease, this))
    809811        ("Start the nightly logging. Nightly file location must be specified already");
    810812
    811813    AddEvent(kSM_Ready, "STOP", kSM_NightlyOpen, kSM_WaitingRun, kSM_Logging, kSM_DailyWriteError, kSM_RunWriteError)
    812         (boost::bind(&DataLogger::GoToReadyPlease, this))
     814        (bind(&DataLogger::GoToReadyPlease, this))
    813815        ("Stop all data logging, close all files.");
    814816
    815817    AddEvent(kSM_Logging, "START_RUN", kSM_WaitingRun, kSM_BadRunConfig)
    816         (boost::bind(&DataLogger::StartRunPlease, this))
     818        (bind(&DataLogger::StartRunPlease, this))
    817819        ("Start the run logging. Run file location must be specified already.");
    818820
    819821    AddEvent(kSM_WaitingRun, "STOP_RUN", kSM_Logging)
    820         (boost::bind(&DataLogger::StopRunPlease, this))
     822        (bind(&DataLogger::StopRunPlease, this))
    821823        ("Wait for a run to be started, open run-files as soon as a run number arrives.");
    822824
    823825    AddEvent(kSM_Ready, "RESET", kSM_Error, kSM_BadNightlyConfig, kSM_BadRunConfig, kSM_DailyWriteError, kSM_RunWriteError)
    824         (boost::bind(&DataLogger::GoToReadyPlease, this))
     826        (bind(&DataLogger::GoToReadyPlease, this))
    825827        ("Transition to exit error states. Closes the any open file.");
    826828
    827829    AddEvent(kSM_WaitingRun, "WAIT_FOR_RUN_NUMBER", kSM_NightlyOpen, kSM_Ready)
    828         (boost::bind(&DataLogger::NightlyToWaitRunPlease, this))
     830        (bind(&DataLogger::NightlyToWaitRunPlease, this))
    829831        ("Go to waiting for run number state. In this state with any received run-number a new file is opened.");
    830832
    831833    AddEvent(kSM_NightlyOpen, "BACK_TO_NIGHTLY_OPEN", kSM_WaitingRun)
    832     (boost::bind(&DataLogger::BackToNightlyOpenPlease, this))
     834    (bind(&DataLogger::BackToNightlyOpenPlease, this))
    833835    ("Go from the wait for run to nightly open state.");
    834836
    835837    // Add the possible configurations for this machine
    836838    AddEvent("SET_NIGHTLY_FOLDER", "C", kSM_Ready, kSM_BadNightlyConfig)
    837         (boost::bind(&DataLogger::ConfigureNightlyFileName, this, _1))
     839        (bind(&DataLogger::ConfigureNightlyFileName, this, placeholders::_1))
    838840        ("Configure the base folder for the nightly files."
    839841         "|Path[string]:Absolute or relative path name where the nightly files should be stored.");
    840842
    841843    AddEvent("SET_RUN_FOLDER", "C", kSM_Ready, kSM_BadNightlyConfig, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig)
    842         (boost::bind(&DataLogger::ConfigureRunFileName, this, _1))
     844        (bind(&DataLogger::ConfigureRunFileName, this, placeholders::_1))
    843845        ("Configure the base folder for the run files."
    844846         "|Path[string]:Absolute or relative path name where the run files should be stored.");
    845847
    846848    AddEvent("SET_RUN_NUMBER", "X", kSM_Ready, kSM_NightlyOpen, kSM_WaitingRun, kSM_BadRunConfig, kSM_Logging)
    847         (boost::bind(&DataLogger::ConfigureRunNumber, this, _1))
     849        (bind(&DataLogger::ConfigureRunNumber, this, placeholders::_1))
    848850        ("Configure the run number. Cannot be done in logging state");
    849851
    850852     // Provide a print command
    851853     AddEvent("PRINT")
    852             (boost::bind(&DataLogger::PrintStatePlease, this, _1))
     854            (bind(&DataLogger::PrintStatePlease, this, placeholders::_1))
    853855            ("Print information about the internal status of the data logger.");
    854856
     
    881883     // provide services control commands
    882884     AddEvent("SET_DEBUG_MODE", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    883          (boost::bind(&DataLogger::SetDebugOnOff, this, _1))
     885         (bind(&DataLogger::SetDebugOnOff, this, placeholders::_1))
    884886         ("Switch debug mode on or off. Debug mode prints information about every service written to a file."
    885887          "|Enable[bool]:Enable of disable debug mode (yes/no).");
    886888
    887889     AddEvent("SET_STATISTICS_UPDATE_INTERVAL", "S:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    888          (boost::bind(&DataLogger::SetStatsPeriod, this, _1))
     890         (bind(&DataLogger::SetStatsPeriod, this, placeholders::_1))
    889891         ("Interval in which the data-logger statistics service (STATS) is updated."
    890892          "|Interval[ms]:Value in milliseconds (<=0: no update).");
    891893
    892894     AddEvent("ENABLE_FILENAME_SERVICES", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    893          (boost::bind(&DataLogger::SetOpenedFilesOnOff ,this, _1))
     895         (bind(&DataLogger::SetOpenedFilesOnOff ,this, placeholders::_1))
    894896         ("Switch service which distributes information about the open files on or off."
    895897          "|Enable[bool]:Enable of disable filename services (yes/no).");
    896898
    897899     AddEvent("ENABLE_NUMSUBS_SERVICE", "B:1", kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun, kSM_Ready)
    898          (boost::bind(&DataLogger::SetNumSubsAndFitsOnOff, this, _1))
     900         (bind(&DataLogger::SetNumSubsAndFitsOnOff, this, placeholders::_1))
    899901         ("Switch the service which distributes information about the number of subscriptions and open files on or off."
    900902          "|Enable[bool]:Enable of disable NUM_SUBS service (yes/no).");
    901903
    902904     AddEvent("SET_RUN_TIMEOUT", "L:1", kSM_Ready, kSM_NightlyOpen, kSM_Logging, kSM_WaitingRun)
    903          (boost::bind(&DataLogger::SetRunTimeoutDelay, this, _1))
     905         (bind(&DataLogger::SetRunTimeoutDelay, this, placeholders::_1))
    904906         ("Set the timeout delay for old run numbers."
    905907          "|timeout[min]:Time out in minutes after which files for expired runs are closed.");
     
    23842386         {
    23852387             NotifyOpenedFile(fFullNightlyLogFileName, 1, fOpenedNightlyFiles);
    2386             for (vector<string>::iterator it=backLogBuffer.begin();it!=backLogBuffer.end();it++)
    2387                 fNightlyLogFile << *it << endl;
     2388             for (vector<string>::iterator it=backLogBuffer.begin();it!=backLogBuffer.end();it++)
     2389             {
     2390                 fNightlyLogFile << *it;
     2391             }
    23882392         }
    23892393    }
  • trunk/FACT++/src/drivectrl.cc

    r11474 r11481  
    1 #include <boost/bind.hpp>
    2 
    31#include "FACT.h"
    42#include "Dim.h"
     
    412410    {
    413411        boost::asio::async_read_until(*this, fBuffer, '\n',
    414                                       boost::bind(&ConnectionDrive::HandleReceivedReport, this,
     412                                      bind(&ConnectionDrive::HandleReceivedReport, this,
    415413                                                  dummy::error, dummy::bytes_transferred));
    416414    }
     
    423421
    424422        fKeepAlive.expires_from_now(boost::posix_time::seconds(10));
    425         fKeepAlive.async_wait(boost::bind(&ConnectionDrive::HandleKeepAlive,
     423        fKeepAlive.async_wait(bind(&ConnectionDrive::HandleKeepAlive,
    426424                                          this, dummy::error));
    427425    }
     
    576574    boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    577575    {
    578         return boost::bind(&StateMachineDrive::Wrap, this, func);
     576        return bind(&StateMachineDrive::Wrap, this, func);
    579577    }
    580578
     
    772770        // Drive Commands
    773771        T::AddEvent("MOVE_TO", "D:2", kStateArmed)  // ->ZDAZ
    774             (boost::bind(&StateMachineDrive::SendCoordinates, this, _1, kPoint))
     772            (bind(&StateMachineDrive::SendCoordinates, this, placeholders::_1, kPoint))
    775773            (""
    776774             "|zd[deg]:"
     
    778776
    779777        T::AddEvent("TRACK", "D:2", kStateArmed)   // ->RADEC/GRB
    780             (boost::bind(&StateMachineDrive::SendCoordinates, this, _1, kTrackSlow))
     778            (bind(&StateMachineDrive::SendCoordinates, this, placeholders::_1, kTrackSlow))
    781779            (""
    782780             "|ra[h]:"
     
    784782
    785783        T::AddEvent("MOON", kStateArmed)
    786             (boost::bind(&StateMachineDrive::SendCommand, this, "MOON 0 0"))
     784            (bind(&StateMachineDrive::SendCommand, this, "MOON 0 0"))
    787785            ("");
    788786        T::AddEvent("VENUS", kStateArmed)
    789             (boost::bind(&StateMachineDrive::SendCommand, this, "CELEST 2 0 0"))
     787            (bind(&StateMachineDrive::SendCommand, this, "CELEST 2 0 0"))
    790788            ("");
    791789        T::AddEvent("MARS", kStateArmed)
    792             (boost::bind(&StateMachineDrive::SendCommand, this, "CELEST 4 0 0"))
     790            (bind(&StateMachineDrive::SendCommand, this, "CELEST 4 0 0"))
    793791            ("");
    794792        T::AddEvent("JUPITER", kStateArmed)
    795             (boost::bind(&StateMachineDrive::SendCommand, this, "CELEST 5 0 0"))
     793            (bind(&StateMachineDrive::SendCommand, this, "CELEST 5 0 0"))
    796794            ("");
    797795        T::AddEvent("SATURN", kStateArmed)
    798             (boost::bind(&StateMachineDrive::SendCommand, this, "CELEST 6 0 0"))
     796            (bind(&StateMachineDrive::SendCommand, this, "CELEST 6 0 0"))
    799797            ("");
    800798
    801799        T::AddEvent("TPOINT")
    802             (boost::bind(&StateMachineDrive::SendCommand, this, "TPOIN FACT 0"))
     800            (bind(&StateMachineDrive::SendCommand, this, "TPOIN FACT 0"))
    803801            ("");
    804802
    805803        T::AddEvent("STOP")
    806             (boost::bind(&StateMachineDrive::SendCommand, this, "STOP!"))
     804            (bind(&StateMachineDrive::SendCommand, this, "STOP!"))
    807805            ("");
    808806
    809807        T::AddEvent("ARM", kStateConnected)
    810             (boost::bind(&StateMachineDrive::SendCommand, this, "ARM lock"))
     808            (bind(&StateMachineDrive::SendCommand, this, "ARM lock"))
    811809            ("");
    812810
     
    814812        // Verbosity commands
    815813        T::AddEvent("SET_VERBOSE", "B")
    816             (boost::bind(&StateMachineDrive::SetVerbosity, this, _1))
     814            (bind(&StateMachineDrive::SetVerbosity, this, placeholders::_1))
    817815            ("set verbosity state"
    818816             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
     
    820818        // Conenction commands
    821819        AddEvent("DISCONNECT", kStateConnected, kStateArmed)
    822             (boost::bind(&StateMachineDrive::Disconnect, this))
     820            (bind(&StateMachineDrive::Disconnect, this))
    823821            ("disconnect from ethernet");
    824822
    825823        AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected, kStateArmed)
    826             (boost::bind(&StateMachineDrive::Reconnect, this, _1))
     824            (bind(&StateMachineDrive::Reconnect, this, placeholders::_1))
    827825            ("(Re)connect ethernet connection to FTM, a new address can be given"
    828826             "|[host][string]:new ethernet address in the form <host:port>");
     
    903901    shell.SetReceiver(io_service);
    904902
    905     boost::thread t(boost::bind(RunThread, &io_service));
    906     // boost::thread t(boost::bind(&StateMachineDrive<S>::Run, &io_service));
     903    boost::thread t(bind(RunThread, &io_service));
     904    // boost::thread t(bind(&StateMachineDrive<S>::Run, &io_service));
    907905
    908906    if (conf.Has("cmd"))
  • trunk/FACT++/src/fadctrl.cc

    r11480 r11481  
     1#include <functional>
     2
    13#include "Dim.h"
    24#include "Event.h"
     
    15281530        // FAD Commands
    15291531        T::AddEvent("SEND_CMD", "I:1")
    1530             (boost::bind(&StateMachineFAD::SendCmd, this, _1))
     1532            (bind(&StateMachineFAD::SendCmd, this, placeholders::_1))
    15311533            ("Send a command to the FADs. Values between 0 and 0xffff are allowed."
    15321534             "|command[uint16]:Command to be transmittted.");
    15331535        T::AddEvent("SEND_DATA", "I:2")
    1534             (boost::bind(&StateMachineFAD::SendCmdData, this, _1))
     1536            (bind(&StateMachineFAD::SendCmdData, this, placeholders::_1))
    15351537            ("Send a command with data to the FADs. Values between 0 and 0xffff are allowed."
    15361538             "|command[uint16]:Command to be transmittted."
     
    15381540
    15391541        T::AddEvent("ENABLE_SRCLK", "B:1")
    1540             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdSrclk))
     1542            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSrclk))
    15411543            ("Set SRCLK");
    15421544        T::AddEvent("ENABLE_BUSY", "B:1")
    1543             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdBusy))
     1545            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdBusy))
    15441546            ("Set BUSY");
    15451547        T::AddEvent("ENABLE_SCLK", "B:1")
    1546             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdSclk))
     1548            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSclk))
    15471549            ("Set SCLK");
    15481550        T::AddEvent("ENABLE_DRS", "B:1")
    1549             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdDrsEnable))
     1551            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdDrsEnable))
    15501552            ("Switch Domino wave");
    15511553        T::AddEvent("ENABLE_DWRITE", "B:1")
    1552             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdDwrite))
     1554            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdDwrite))
    15531555            ("Set Dwrite (possibly high / always low)");
    15541556        T::AddEvent("ENABLE_CONTINOUS_TRIGGER", "B:1")
    1555             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdContTrigger))
     1557            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdContTrigger))
    15561558            ("Enable continous (internal) trigger.");
    15571559        T::AddEvent("ENABLE_TRIGGER_LINE", "B:1")
    1558             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdTriggerLine))
     1560            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdTriggerLine))
    15591561            ("Incoming triggers can be accepted/will not be accepted");
    15601562        T::AddEvent("ENABLE_COMMAND_SOCKET_MODE", "B:1")
    1561             (boost::bind(&StateMachineFAD::CmdEnable, this, _1, FAD::kCmdSocket))
     1563            (bind(&StateMachineFAD::CmdEnable, this, placeholders::_1, FAD::kCmdSocket))
    15621564            ("Set debug mode (yes: dump events through command socket, no=dump events through other sockets)");
    15631565
    15641566        T::AddEvent("SET_TRIGGER_RATE", "I:1")
    1565             (boost::bind(&StateMachineFAD::SetTriggerRate, this, _1))
     1567            (bind(&StateMachineFAD::SetTriggerRate, this, placeholders::_1))
    15661568            ("Enable continous trigger");
    15671569        T::AddEvent("SEND_SINGLE_TRIGGER")
    1568             (boost::bind(&StateMachineFAD::Trigger, this, 1))
     1570            (bind(&StateMachineFAD::Trigger, this, 1))
    15691571            ("Issue software triggers");
    15701572        T::AddEvent("SEND_N_TRIGGERS", "I")
    1571             (boost::bind(&StateMachineFAD::SendTriggers, this, _1))
     1573            (bind(&StateMachineFAD::SendTriggers, this, placeholders::_1))
    15721574            ("Issue software triggers");
    15731575        T::AddEvent("START_RUN", "")
    1574             (boost::bind(&StateMachineFAD::StartRun, this, _1, true))
     1576            (bind(&StateMachineFAD::StartRun, this, placeholders::_1, true))
    15751577            ("Set FAD DAQ mode. when started, no configurations must be send.");
    15761578        T::AddEvent("STOP_RUN")
    1577             (boost::bind(&StateMachineFAD::StartRun, this, _1, false))
     1579            (bind(&StateMachineFAD::StartRun, this, placeholders::_1, false))
    15781580            ("");
    15791581        T::AddEvent("PHASE_SHIFT", "S:1")
    1580             (boost::bind(&StateMachineFAD::PhaseShift, this, _1))
     1582            (bind(&StateMachineFAD::PhaseShift, this, placeholders::_1))
    15811583            ("Adjust ADC phase (in 'steps')");
    15821584
    15831585        T::AddEvent("RESET_EVENT_COUNTER")
    1584             (boost::bind(&StateMachineFAD::Cmd, this, FAD::kCmdResetEventCounter))
     1586            (bind(&StateMachineFAD::Cmd, this, FAD::kCmdResetEventCounter))
    15851587            ("");
    15861588
    15871589        T::AddEvent("SET_RUN_NUMBER", "X:1")
    1588             (boost::bind(&StateMachineFAD::SetRunNumber, this, _1))
     1590            (bind(&StateMachineFAD::SetRunNumber, this, placeholders::_1))
    15891591            ("");
    15901592
    15911593        T::AddEvent("SET_MAX_MEMORY", "S:1")
    1592             (boost::bind(&StateMachineFAD::SetMaxMemoryBuffer, this, _1))
     1594            (bind(&StateMachineFAD::SetMaxMemoryBuffer, this, placeholders::_1))
    15931595            ("Set maximum memory buffer size allowed to be consumed by the EventBuilder to buffer events."
    15941596             "|memory[short]:Buffer size in Mega-bytes.");
    15951597
    15961598        T::AddEvent("SET_REGISTER", "I:2")
    1597             (boost::bind(&StateMachineFAD::SetRegister, this, _1))
     1599            (bind(&StateMachineFAD::SetRegister, this, placeholders::_1))
    15981600            ("set register to value"
    15991601            "|addr[short]:Address of register"
     
    16021604        // FIXME:  Maybe add a mask which channels should be set?
    16031605        T::AddEvent("SET_REGION_OF_INTEREST", "I:2")
    1604             (boost::bind(&StateMachineFAD::SetRoi, this, _1))
     1606            (bind(&StateMachineFAD::SetRoi, this, placeholders::_1))
    16051607            ("Set region-of-interest to value"
    16061608            "|addr[short]:Address of register"
     
    16091611        // FIXME:  Maybe add a mask which channels should be set?
    16101612        T::AddEvent("SET_DAC_VALUE", "I:2")
    1611             (boost::bind(&StateMachineFAD::SetDac, this, _1))
     1613            (bind(&StateMachineFAD::SetDac, this, placeholders::_1))
    16121614            ("Set DAC numbers in range to value"
    16131615            "|addr[short]:Address of register (-1 for all)"
     
    16151617
    16161618        T::AddEvent("CONFIGURE", "C", FAD::kConnected, FAD::kConfigured)
    1617             (boost::bind(&StateMachineFAD::StartConfigure, this, _1))
     1619            (bind(&StateMachineFAD::StartConfigure, this, placeholders::_1))
    16181620            ("");
    16191621
    16201622        T::AddEvent("RESET_CONFIGURE", FAD::kConfiguring, FAD::kConfigured)
    1621             (boost::bind(&StateMachineFAD::ResetConfig, this))
     1623            (bind(&StateMachineFAD::ResetConfig, this))
    16221624            ("");
    16231625
    16241626        // Verbosity commands
    16251627        T::AddEvent("SET_VERBOSE", "B:1")
    1626             (boost::bind(&StateMachineFAD::SetVerbosity, this, _1))
     1628            (bind(&StateMachineFAD::SetVerbosity, this, placeholders::_1))
    16271629            ("Set verbosity state"
    16281630             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    16291631
    16301632        T::AddEvent("SET_HEX_OUTPUT", "B:1")
    1631             (boost::bind(&StateMachineFAD::SetHexOutput, this, _1))
     1633            (bind(&StateMachineFAD::SetHexOutput, this, placeholders::_1))
    16321634            ("Enable or disable hex output for received data"
    16331635             "|hexout[bool]:disable or enable hex output for received data (yes/no)");
    16341636
    16351637        T::AddEvent("SET_DATA_OUTPUT", "B:1")
    1636             (boost::bind(&StateMachineFAD::SetDataOutput, this, _1))
     1638            (bind(&StateMachineFAD::SetDataOutput, this, placeholders::_1))
    16371639            ("");
    16381640
    16391641        T::AddEvent("SET_DEBUG_TX", "B:1")
    1640             (boost::bind(&StateMachineFAD::SetDebugTx, this, _1))
     1642            (bind(&StateMachineFAD::SetDebugTx, this, placeholders::_1))
    16411643            ("Enable or disable the output of messages in case of successfull data transmission to the boards."
    16421644             "|debug[bool]:disable or enable debug output for transmitted data (yes/no)");
    16431645
    16441646        T::AddEvent("SET_DEBUG_EVENT_BUILDER_OUT", "B:1")
    1645             (boost::bind(&StateMachineFAD::SetDebugEb, this, _1))
     1647            (bind(&StateMachineFAD::SetDebugEb, this, placeholders::_1))
    16461648            ("");
    16471649
    16481650        T::AddEvent("PRINT_EVENT", "S:1")
    1649             (boost::bind(&StateMachineFAD::PrintEvent, this, _1))
     1651            (bind(&StateMachineFAD::PrintEvent, this, placeholders::_1))
    16501652            ("Print (last) event"
    16511653             "|board[short]:slot from which the event should be printed (-1 for all)");
    16521654
    16531655        T::AddEvent("DUMP_STREAM", "B:1")
    1654             (boost::bind(&StateMachineFAD::SetDumpStream, this, _1))
     1656            (bind(&StateMachineFAD::SetDumpStream, this, placeholders::_1))
    16551657            ("For debugging purpose: the binary data stream read from the sockets 0-7 can be dumped to files."
    16561658             "|switch[bool]:Enable (yes) or disable (no)");
    16571659
    16581660        T::AddEvent("DUMP_RECV", "B:1")
    1659             (boost::bind(&StateMachineFAD::SetDumpRecv, this, _1))
     1661            (bind(&StateMachineFAD::SetDumpRecv, this, placeholders::_1))
    16601662            ("For debugging purpose: the times when data has been receives are dumped to a file."
    16611663             "|switch[bool]:Enable (yes) or disable (no)");
    16621664
    16631665        T::AddEvent("BLOCK_TRANSMISSION", "S:1;B:1")
    1664             (boost::bind(&StateMachineFAD::SetBlockTransmission, this, _1))
     1666            (bind(&StateMachineFAD::SetBlockTransmission, this, placeholders::_1))
    16651667            ("Blocks the transmission of commands to the given slot. Use with care! For debugging pupose only!"
    16661668             "|slot[short]:Slot to which the command transmission should be blocked (0-39)"
     
    16681670
    16691671        T::AddEvent("BLOCK_TRANSMISSION_RANGE", "S:2;B:1")
    1670             (boost::bind(&StateMachineFAD::SetBlockTransmissionRange, this, _1))
     1672            (bind(&StateMachineFAD::SetBlockTransmissionRange, this, placeholders::_1))
    16711673            ("Blocks the transmission of commands to the given range of slots. Use with care! For debugging pupose only!"
    16721674             "|first[short]:First slot to which the command transmission should be blocked (0-39)"
     
    16751677
    16761678        T::AddEvent("IGNORE_EVENTS", "S:1;B:1")
    1677             (boost::bind(&StateMachineFAD::SetIgnoreSlot, this, _1))
     1679            (bind(&StateMachineFAD::SetIgnoreSlot, this, placeholders::_1))
    16781680            ("Instructs the event-builder to ignore events from the given slot but still read the data from the socket."
    16791681             "|slot[short]:Slot from which the data should be ignored when building events"
     
    16811683
    16821684        T::AddEvent("IGNORE_EVENTS_RANGE", "S:2;B:1")
    1683             (boost::bind(&StateMachineFAD::SetIgnoreSlots, this, _1))
     1685            (bind(&StateMachineFAD::SetIgnoreSlots, this, placeholders::_1))
    16841686            ("Instructs the event-builder to ignore events from the given slot but still read the data from the socket."
    16851687             "|first[short]:First slot from which the data should be ignored when building events"
     
    16881690
    16891691        T::AddEvent("CLOSE_OPEN_FILES", FAD::kConnecting, FAD::kConnected)
    1690             (boost::bind(&StateMachineFAD::CloseOpenFiles, this))
     1692            (bind(&StateMachineFAD::CloseOpenFiles, this))
    16911693            ("Close all run files opened by the EventBuilder.");
    16921694
    16931695        T::AddEvent("TEST", "S:1")
    1694            (boost::bind(&StateMachineFAD::Test, this, _1))
     1696           (bind(&StateMachineFAD::Test, this, placeholders::_1))
    16951697            ("");
    16961698
     
    16991701        // Conenction commands
    17001702        T::AddEvent("START", FAD::kOffline)
    1701             (boost::bind(&StateMachineFAD::StartConnection, this))
     1703            (bind(&StateMachineFAD::StartConnection, this))
    17021704            ("Start EventBuilder thread and connect all valid slots.");
    17031705
    17041706        T::AddEvent("STOP",  FAD::kDisconnected, FAD::kConnecting, FAD::kConnected)
    1705             (boost::bind(&StateMachineFAD::StopConnection, this))
     1707            (bind(&StateMachineFAD::StopConnection, this))
    17061708            ("Stop EventBuilder thread (still write buffered events) and disconnect all slots.");
    17071709
    17081710        T::AddEvent("ABORT", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected)
    1709             (boost::bind(&StateMachineFAD::AbortConnection, this))
     1711            (bind(&StateMachineFAD::AbortConnection, this))
    17101712            ("Immediately abort EventBuilder thread and disconnect all slots.");
    17111713
    17121714        T::AddEvent("SOFT_RESET", FAD::kConnected)
    1713             (boost::bind(&StateMachineFAD::Reset, this, true))
     1715            (bind(&StateMachineFAD::Reset, this, true))
    17141716            ("Wait for buffers to drain, close all files and reinitialize event builder thread.");
    17151717
    17161718        T::AddEvent("HARD_RESET", FAD::kConnected)
    1717             (boost::bind(&StateMachineFAD::Reset, this, false))
     1719            (bind(&StateMachineFAD::Reset, this, false))
    17181720            ("Free all buffers, close all files and reinitialize event builder thread.");
    17191721
    17201722        T::AddEvent("CONNECT", "S:1", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected)
    1721             (boost::bind(&StateMachineFAD::EnableSlot, this, _1, true))
     1723            (bind(&StateMachineFAD::EnableSlot, this, placeholders::_1, true))
    17221724            ("Connect a disconnected slot.");
    17231725
    17241726        T::AddEvent("DISCONNECT", "S:1", FAD::kConnecting, FAD::kConnected)
    1725             (boost::bind(&StateMachineFAD::EnableSlot, this, _1, false))
     1727            (bind(&StateMachineFAD::EnableSlot, this, placeholders::_1, false))
    17261728            ("Disconnect a connected slot.");
    17271729
    17281730        T::AddEvent("TOGGLE", "S:1", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected)
    1729             (boost::bind(&StateMachineFAD::ToggleSlot, this, _1))
     1731            (bind(&StateMachineFAD::ToggleSlot, this, placeholders::_1))
    17301732            ("");
    17311733
    17321734        T::AddEvent("SET_FILE_FORMAT", "S:1")
    1733             (boost::bind(&StateMachineFAD::SetFileFormat, this, _1))
     1735            (bind(&StateMachineFAD::SetFileFormat, this, placeholders::_1))
    17341736            ("");
    17351737
    17361738
    17371739        T::AddEvent("ADD_ADDRESS", "C", FAD::kOffline)
    1738             (boost::bind(&StateMachineFAD::AddAddress, this, _1))
     1740            (bind(&StateMachineFAD::AddAddress, this, placeholders::_1))
    17391741            ("Add the address of a DRS4 board to the first free slot"
    17401742             "|IP[string]:address in the format <address:port>");
    17411743        T::AddEvent("REMOVE_SLOT", "S:1", FAD::kOffline)
    1742             (boost::bind(&StateMachineFAD::RemoveSlot, this, _1))
     1744            (bind(&StateMachineFAD::RemoveSlot, this, placeholders::_1))
    17431745            ("Remove the Iaddress in slot n. For a list see LIST"
    17441746             "|slot[short]:Remove the address in slot n from the list");
    17451747        T::AddEvent("LIST_SLOTS")
    1746             (boost::bind(&StateMachineFAD::ListSlots, this))
     1748            (bind(&StateMachineFAD::ListSlots, this))
    17471749            ("Print a list of all available board addressesa and whether they are enabled");
    17481750    }
     
    20232025    shell.SetReceiver(io_service);
    20242026
    2025     boost::thread t(boost::bind(RunThread, &io_service));
    2026     //boost::thread t(boost::bind(&StateMachineFAD<S>::Run, &io_service));
     2027    boost::thread t(bind(RunThread, &io_service));
     2028    //boost::thread t(bind(&StateMachineFAD<S>::Run, &io_service));
    20272029
    20282030    if (conf.Has("cmd"))
  • trunk/FACT++/src/fscctrl.cc

    r11479 r11481  
    1 #include <boost/bind.hpp>
     1#include <functional>
    22
    33#include "Dim.h"
     
    1111
    1212#include "tools.h"
    13 
    1413
    1514namespace ba    = boost::asio;
     
    370369    }
    371370
    372     boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    373     {
    374         return boost::bind(&StateMachineFSC::Wrap, this, func);
     371    function<int(const EventImp &)> Wrapper(function<void()> func)
     372    {
     373        return bind(&StateMachineFSC::Wrap, this, func);
    375374    }
    376375
     
    480479        // Verbosity commands
    481480        T::AddEvent("SET_VERBOSE", "B:1")
    482             (boost::bind(&StateMachineFSC::SetVerbosity, this, _1))
     481            (bind(&StateMachineFSC::SetVerbosity, this, placeholders::_1))
    483482            ("set verbosity state"
    484483             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    485484
    486485        T::AddEvent("DUMP_STREAM", "B:1")
    487             (boost::bind(&StateMachineFSC::SetDumpStream, this, _1))
     486            (bind(&StateMachineFSC::SetDumpStream, this, placeholders::_1))
    488487            (""
    489488             "");
     
    491490        // Conenction commands
    492491        AddEvent("DISCONNECT", kStateConnected)
    493             (boost::bind(&StateMachineFSC::Disconnect, this))
     492            (bind(&StateMachineFSC::Disconnect, this))
    494493            ("disconnect from ethernet");
    495494
    496495        AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected)
    497             (boost::bind(&StateMachineFSC::Reconnect, this, _1))
     496            (bind(&StateMachineFSC::Reconnect, this, placeholders::_1))
    498497            ("(Re)connect ethernet connection to FTM, a new address can be given"
    499498             "|[host][string]:new ethernet address in the form <host:port>");
  • trunk/FACT++/src/ftmctrl.cc

    r11480 r11481  
    1919
    2020using namespace std;
     21using namespace std::placeholders;
    2122
    2223// ------------------------------------------------------------------------
     
    11351136    }
    11361137
    1137     boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    1138     {
    1139         return boost::bind(&StateMachineFTM::Wrap, this, func);
     1138    function<int(const EventImp &)> Wrapper(function<void()> func)
     1139    {
     1140        return bind(&StateMachineFTM::Wrap, this, func);
    11401141    }
    11411142
     
    17061707        // deletion and creation of threads and more.
    17071708
     1709
    17081710        // State names
    17091711        T::AddStateName(FTM::kDisconnected, "Disconnected",
     
    17311733        // FTM Commands
    17321734        T::AddEvent("TOGGLE_LED", FTM::kIdle)
    1733             (Wrapper(boost::bind(&ConnectionFTM::CmdToggleLed, &fFTM)))
     1735            (Wrapper(bind(&ConnectionFTM::CmdToggleLed, &fFTM)))
    17341736            ("toggle led");
    17351737
    17361738        T::AddEvent("PING", FTM::kIdle)
    1737             (Wrapper(boost::bind(&ConnectionFTM::CmdPing, &fFTM)))
     1739            (Wrapper(bind(&ConnectionFTM::CmdPing, &fFTM)))
    17381740            ("send ping");
    17391741
    17401742        T::AddEvent("REQUEST_DYNAMIC_DATA", FTM::kIdle)
    1741             (Wrapper(boost::bind(&ConnectionFTM::CmdReqDynDat, &fFTM)))
     1743            (Wrapper(bind(&ConnectionFTM::CmdReqDynDat, &fFTM)))
    17421744            ("request transmission of dynamic data block");
    17431745
    17441746        T::AddEvent("REQUEST_STATIC_DATA", FTM::kIdle)
    1745             (Wrapper(boost::bind(&ConnectionFTM::CmdReqStatDat, &fFTM)))
     1747            (Wrapper(bind(&ConnectionFTM::CmdReqStatDat, &fFTM)))
    17461748            ("request transmission of static data from FTM to memory");
    17471749
    17481750        T::AddEvent("GET_REGISTER", "I", FTM::kIdle)
    1749             (boost::bind(&StateMachineFTM::GetRegister, this, _1))
     1751            (bind(&StateMachineFTM::GetRegister, this, placeholders::_1))
    17501752            ("read register from address addr"
    17511753            "|addr[short]:Address of register");
    17521754
    17531755        T::AddEvent("SET_REGISTER", "I:2", FTM::kIdle)
    1754             (boost::bind(&StateMachineFTM::SetRegister, this, _1))
     1756            (bind(&StateMachineFTM::SetRegister, this, placeholders::_1))
    17551757            ("set register to value"
    17561758            "|addr[short]:Address of register"
     
    17581760
    17591761        T::AddEvent("START_RUN", FTM::kIdle, FTM::kConfigured)
    1760             (Wrapper(boost::bind(&ConnectionFTM::CmdStartRun, &fFTM)))
     1762            (Wrapper(bind(&ConnectionFTM::CmdStartRun, &fFTM)))
    17611763            ("start a run (start distributing triggers)");
    17621764
    17631765        T::AddEvent("STOP_RUN", FTM::kTakingData)
    1764             (Wrapper(boost::bind(&ConnectionFTM::CmdStopRun, &fFTM)))
     1766            (Wrapper(bind(&ConnectionFTM::CmdStopRun, &fFTM)))
    17651767            ("stop a run (stop distributing triggers)");
    17661768
    17671769        T::AddEvent("TAKE_N_EVENTS", "I", FTM::kIdle)
    1768             (boost::bind(&StateMachineFTM::TakeNevents, this, _1))
     1770            (bind(&StateMachineFTM::TakeNevents, this, placeholders::_1))
    17691771            ("take n events (distribute n triggers)|number[int]:Number of events to be taken");
    17701772
    17711773        T::AddEvent("DISABLE_REPORTS", "B", FTM::kIdle)
    1772             (boost::bind(&StateMachineFTM::DisableReports, this, _1))
     1774            (bind(&StateMachineFTM::DisableReports, this, placeholders::_1))
    17731775            ("disable sending rate reports"
    17741776             "|status[bool]:disable or enable that the FTM sends rate reports (yes/no)");
    17751777
    17761778        T::AddEvent("SET_THRESHOLD", "I:2", FTM::kIdle)
    1777             (boost::bind(&StateMachineFTM::SetThreshold, this, _1))
     1779            (bind(&StateMachineFTM::SetThreshold, this, placeholders::_1))
    17781780            ("Set the comparator threshold"
    17791781             "|Patch[idx]:Index of the patch (0-159), -1 for all"
     
    17811783
    17821784        T::AddEvent("SET_PRESCALING", "I:1", FTM::kIdle)
    1783             (boost::bind(&StateMachineFTM::SetPrescaling, this, _1))
     1785            (bind(&StateMachineFTM::SetPrescaling, this, placeholders::_1))
    17841786            (""
    17851787             "|[]:");
    17861788
    17871789        T::AddEvent("ENABLE_FTU", "I:1;B:1", FTM::kIdle)
    1788             (boost::bind(&StateMachineFTM::EnableFTU, this, _1))
     1790            (bind(&StateMachineFTM::EnableFTU, this, placeholders::_1))
    17891791            ("Enable or disable FTU"
    17901792             "|Board[idx]:Index of the board (0-39), -1 for all"
     
    17921794
    17931795        T::AddEvent("DISABLE_PIXEL", "S:1", FTM::kIdle)
    1794             (boost::bind(&StateMachineFTM::EnablePixel, this, _1, false))
     1796            (bind(&StateMachineFTM::EnablePixel, this, placeholders::_1, false))
    17951797            ("(-1 or all)");
    17961798
    17971799        T::AddEvent("ENABLE_PIXEL", "S:1", FTM::kIdle)
    1798             (boost::bind(&StateMachineFTM::EnablePixel, this, _1, true))
     1800            (bind(&StateMachineFTM::EnablePixel, this, placeholders::_1, true))
    17991801            ("(-1 or all)");
    18001802
    18011803        T::AddEvent("DISABLE_ALL_PIXELS_EXCEPT", "S:1", FTM::kIdle)
    1802             (boost::bind(&StateMachineFTM::DisableAllPixelsExcept, this, _1))
     1804            (bind(&StateMachineFTM::DisableAllPixelsExcept, this, placeholders::_1))
    18031805            ("");
    18041806
    18051807        T::AddEvent("DISABLE_ALL_PATCHES_EXCEPT", "S:1", FTM::kIdle)
    1806             (boost::bind(&StateMachineFTM::DisableAllPatchesExcept, this, _1))
     1808            (bind(&StateMachineFTM::DisableAllPatchesExcept, this, placeholders::_1))
    18071809            ("");
    18081810
    18091811        T::AddEvent("TOGGLE_PIXEL", "S:1", FTM::kIdle)
    1810             (boost::bind(&StateMachineFTM::TogglePixel, this, _1))
     1812            (bind(&StateMachineFTM::TogglePixel, this, placeholders::_1))
    18111813            ("");
    18121814
    18131815        T::AddEvent("TOGGLE_FTU", "I:1", FTM::kIdle)
    1814             (boost::bind(&StateMachineFTM::ToggleFTU, this, _1))
     1816            (bind(&StateMachineFTM::ToggleFTU, this, placeholders::_1))
    18151817            ("Toggle status of FTU (this is mainly meant to be used in the GUI)"
    18161818             "|Board[idx]:Index of the board (0-39)");
    18171819
    18181820        T::AddEvent("SET_TRIGGER_INTERVAL", "I:1", FTM::kIdle)
    1819             (boost::bind(&StateMachineFTM::SetTriggerInterval, this, _1))
     1821            (bind(&StateMachineFTM::SetTriggerInterval, this, placeholders::_1))
    18201822            ("Sets the trigger interval which is the distance between two consecutive artificial triggers."
    18211823             "|interval[int]:The applied trigger interval is: interval*4ns+8ns");
    18221824
    18231825        T::AddEvent("SET_TRIGGER_DELAY", "I:1", FTM::kIdle)
    1824             (boost::bind(&StateMachineFTM::SetTriggerDelay, this, _1))
     1826            (bind(&StateMachineFTM::SetTriggerDelay, this, placeholders::_1))
    18251827            (""
    18261828             "|delay[int]:The applied trigger delay is: delay*4ns+8ns");
    18271829
    18281830        T::AddEvent("SET_TIME_MARKER_DELAY", "I:1", FTM::kIdle)
    1829             (boost::bind(&StateMachineFTM::SetTimeMarkerDelay, this, _1))
     1831            (bind(&StateMachineFTM::SetTimeMarkerDelay, this, placeholders::_1))
    18301832            (""
    18311833            "|delay[int]:The applied time marker delay is: delay*4ns+8ns");
    18321834
    18331835        T::AddEvent("SET_DEAD_TIME", "I:1", FTM::kIdle)
    1834             (boost::bind(&StateMachineFTM::SetDeadTime, this, _1))
     1836            (bind(&StateMachineFTM::SetDeadTime, this, placeholders::_1))
    18351837            (""
    18361838            "|dead_time[int]:The applied dead time is: dead_time*4ns+8ns");
    18371839
    18381840        T::AddEvent("ENABLE_TRIGGER", "B:1", FTM::kIdle)
    1839             (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kTrigger))
     1841            (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kTrigger))
    18401842            ("Switch on the physics trigger"
    18411843             "|Enable[bool]:Enable physics trigger (yes/no)");
     
    18431845        // FIXME: Switch on/off depending on sequence
    18441846        T::AddEvent("ENABLE_EXT1", "B:1", FTM::kIdle)
    1845             (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt1))
     1847            (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kExt1))
    18461848            ("Switch on the triggers through the first external line"
    18471849             "|Enable[bool]:Enable ext1 trigger (yes/no)");
     
    18491851        // FIXME: Switch on/off depending on sequence
    18501852        T::AddEvent("ENABLE_EXT2", "B:1", FTM::kIdle)
    1851             (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kExt2))
     1853            (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kExt2))
    18521854            ("Switch on the triggers through the second external line"
    18531855             "|Enable[bool]:Enable ext2 trigger (yes/no)");
    18541856
    18551857        T::AddEvent("ENABLE_VETO", "B:1", FTM::kIdle)
    1856             (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kVeto))
     1858            (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kVeto))
    18571859            ("Enable veto line"
    18581860             "|Enable[bool]:Enable veto (yes/no)");
    18591861
    18601862        T::AddEvent("ENABLE_CLOCK_CONDITIONER", "B:1", FTM::kIdle)
    1861             (boost::bind(&StateMachineFTM::Enable, this, _1, FTM::StaticData::kClockConditioner))
     1863            (bind(&StateMachineFTM::Enable, this, placeholders::_1, FTM::StaticData::kClockConditioner))
    18621864            ("Enable clock conidtioner output in favor of time marker output"
    18631865             "|Enable[bool]:Enable clock conditioner (yes/no)");
    18641866
    18651867        T::AddEvent("SET_TRIGGER_SEQUENCE", "S:3", FTM::kIdle)
    1866             (boost::bind(&StateMachineFTM::SetTriggerSeq, this, _1))
     1868            (bind(&StateMachineFTM::SetTriggerSeq, this, placeholders::_1))
    18671869            ("Setup the sequence of artificial triggers produced by the FTM"
    18681870             "|Ped[short]:number of pedestal triggers in a row"
     
    18711873
    18721874        T::AddEvent("SET_TRIGGER_MULTIPLICITY", "S:1", FTM::kIdle)
    1873             (boost::bind(&StateMachineFTM::SetTriggerMultiplicity, this, _1))
     1875            (bind(&StateMachineFTM::SetTriggerMultiplicity, this, placeholders::_1))
    18741876            ("Setup the Multiplicity condition for physcis triggers"
    18751877             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    18761878
    18771879        T::AddEvent("SET_TRIGGER_WINDOW", "S:1", FTM::kIdle)
    1878             (boost::bind(&StateMachineFTM::SetTriggerWindow, this, _1))
     1880            (bind(&StateMachineFTM::SetTriggerWindow, this, placeholders::_1))
    18791881            ("");
    18801882
    18811883        T::AddEvent("SET_CALIBRATION_MULTIPLICITY", "S:1", FTM::kIdle)
    1882             (boost::bind(&StateMachineFTM::SetCalibMultiplicity, this, _1))
     1884            (bind(&StateMachineFTM::SetCalibMultiplicity, this, placeholders::_1))
    18831885            ("Setup the Multiplicity condition for artificial (calibration) triggers"
    18841886             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    18851887
    18861888        T::AddEvent("SET_CALIBRATION_WINDOW", "S:1", FTM::kIdle)
    1887             (boost::bind(&StateMachineFTM::SetCalibWindow, this, _1))
     1889            (bind(&StateMachineFTM::SetCalibWindow, this, placeholders::_1))
    18881890            ("");
    18891891
    18901892        T::AddEvent("SET_CLOCK_FREQUENCY", "S:1", FTM::kIdle)
    1891             (boost::bind(&StateMachineFTM::SetClockFrequency, this, _1))
     1893            (bind(&StateMachineFTM::SetClockFrequency, this, placeholders::_1))
    18921894            ("");
    18931895
    18941896        T::AddEvent("SET_CLOCK_REGISTER", "X:8", FTM::kIdle)
    1895             (boost::bind(&StateMachineFTM::SetClockRegister, this, _1))
     1897            (bind(&StateMachineFTM::SetClockRegister, this, placeholders::_1))
    18961898            ("");
    18971899
     
    18991901        // we can allow it in idle _and_ taking data
    19001902        T::AddEvent("CONFIGURE", "C", FTM::kIdle, FTM::kTakingData)
    1901             (boost::bind(&StateMachineFTM::ConfigureFTM, this, _1))
     1903            (bind(&StateMachineFTM::ConfigureFTM, this, placeholders::_1))
    19021904            ("");
    19031905
    19041906        T::AddEvent("RESET_CONFIGURE", FTM::kConfiguring1, FTM::kConfiguring2, FTM::kConfigured, FTM::kConfigError1, FTM::kConfigError2)
    1905             (boost::bind(&StateMachineFTM::ResetConfig, this))
     1907            (bind(&StateMachineFTM::ResetConfig, this))
    19061908            ("");
    19071909
     
    19091911
    19101912        T::AddEvent("RESET_CRATE", "S:1", FTM::kIdle)
    1911             (boost::bind(&StateMachineFTM::ResetCrate, this, _1))
     1913            (bind(&StateMachineFTM::ResetCrate, this, placeholders::_1))
    19121914            ("Reset one of the crates 0-3"
    19131915             "|crate[short]:Crate number to be reseted (0-3)");
    19141916
    19151917        T::AddEvent("RESET_CAMERA", FTM::kIdle)
    1916             (Wrapper(boost::bind(&ConnectionFTM::CmdResetCamera, &fFTM)))
     1918            (Wrapper(bind(&ConnectionFTM::CmdResetCamera, &fFTM)))
    19171919            ("Reset all crates. The commands are sent in the order 0,1,2,3");
    19181920
     
    19201922        // Load/save static data block
    19211923        T::AddEvent("SAVE", "C", FTM::kIdle)
    1922             (boost::bind(&StateMachineFTM::SaveStaticData, this, _1))
     1924            (bind(&StateMachineFTM::SaveStaticData, this, placeholders::_1))
    19231925            ("Saves the static data (FTM configuration) from memory to a file"
    19241926             "|filename[string]:Filename (can include a path), .bin is automatically added");
    19251927
    19261928        T::AddEvent("LOAD", "C", FTM::kIdle)
    1927             (boost::bind(&StateMachineFTM::LoadStaticData, this, _1))
     1929            (bind(&StateMachineFTM::LoadStaticData, this, placeholders::_1))
    19281930            ("Loads the static data (FTM configuration) from a file into memory and sends it to the FTM"
    19291931             "|filename[string]:Filename (can include a path), .bin is automatically added");
     
    19331935        // Verbosity commands
    19341936        T::AddEvent("SET_VERBOSE", "B")
    1935             (boost::bind(&StateMachineFTM::SetVerbosity, this, _1))
     1937            (bind(&StateMachineFTM::SetVerbosity, this, placeholders::_1))
    19361938            ("set verbosity state"
    19371939             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    19381940
    19391941        T::AddEvent("SET_HEX_OUTPUT", "B")
    1940             (boost::bind(&StateMachineFTM::SetHexOutput, this, _1))
     1942            (bind(&StateMachineFTM::SetHexOutput, this, placeholders::_1))
    19411943            ("enable or disable hex output for received data"
    19421944             "|hexout[bool]:disable or enable hex output for received data (yes/no)");
    19431945
    19441946        T::AddEvent("SET_DYNAMIC_OUTPUT", "B")
    1945             (boost::bind(&StateMachineFTM::SetDynamicOut, this, _1))
     1947            (bind(&StateMachineFTM::SetDynamicOut, this, placeholders::_1))
    19461948            ("enable or disable output for received dynamic data (data is still broadcasted via Dim)"
    19471949             "|dynout[bool]:disable or enable output for dynamic data (yes/no)");
     
    19501952        // Conenction commands
    19511953        T::AddEvent("DISCONNECT", FTM::kConnected, FTM::kIdle)
    1952             (boost::bind(&StateMachineFTM::Disconnect, this))
     1954            (bind(&StateMachineFTM::Disconnect, this))
    19531955            ("disconnect from ethernet");
    19541956
    19551957        T::AddEvent("RECONNECT", "O", FTM::kDisconnected, FTM::kConnected, FTM::kIdle, FTM::kConfigured)
    1956             (boost::bind(&StateMachineFTM::Reconnect, this, _1))
     1958            (bind(&StateMachineFTM::Reconnect, this, placeholders::_1))
    19571959            ("(Re)connect ethernet connection to FTM, a new address can be given"
    19581960             "|[host][string]:new ethernet address in the form <host:port>");
     
    22382240    shell.SetReceiver(io_service);
    22392241
    2240     boost::thread t(boost::bind(RunThread, &io_service));
    2241     // boost::thread t(boost::bind(&StateMachineFTM<S>::Run, &io_service));
     2242    boost::thread t(bind(RunThread, &io_service));
     2243    // boost::thread t(bind(&StateMachineFTM<S>::Run, &io_service));
    22422244
    22432245    if (conf.Has("cmd"))
  • trunk/FACT++/src/mcp.cc

    r11480 r11481  
    1 #include <boost/bind.hpp>
    2 
    31#include "Dim.h"
    42#include "Event.h"
     
    4240    boost::function<int(const EventImp &)> Wrapper(boost::function<void()> func)
    4341    {
    44         return boost::bind(&StateMachineMCP::Wrap, this, func);
     42        return bind(&StateMachineMCP::Wrap, this, func);
    4543    }*/
    4644
     
    332330
    333331        AddEvent("START", kStateIdle)
    334             (boost::bind(&StateMachineMCP::StartRun, this, _1))
     332            (bind(&StateMachineMCP::StartRun, this, placeholders::_1))
    335333            ("");
    336334
    337335        AddEvent("STOP")
    338             (boost::bind(&StateMachineMCP::StopRun, this, _1))
     336            (bind(&StateMachineMCP::StopRun, this, placeholders::_1))
    339337            ("");
    340338
    341339        AddEvent("RESET", kStateConfiguring1, kStateConfiguring2, kStateConfigured)
    342             (boost::bind(&StateMachineMCP::Reset, this, _1))
     340            (bind(&StateMachineMCP::Reset, this, placeholders::_1))
    343341            ("");
    344342
    345343        // Verbosity commands
    346344        AddEvent("SET_VERBOSE", "B:1")
    347             (boost::bind(&StateMachineMCP::SetVerbosity, this, _1))
     345            (bind(&StateMachineMCP::SetVerbosity, this, placeholders::_1))
    348346            ("set verbosity state"
    349347             "|verbosity[bool]:disable or enable verbosity for received data (yes/no), except dynamic data");
    350348
    351349        AddEvent("PRINT")
    352             (boost::bind(&StateMachineMCP::Print, this))
     350            (bind(&StateMachineMCP::Print, this))
    353351            ("");
    354352    }
     
    422420    shell.SetReceiver(io_service);
    423421
    424     boost::thread t(boost::bind(RunThread, &io_service));
    425     // boost::thread t(boost::bind(&StateMachineMCP<S>::Run, &io_service));
     422    boost::thread t(bind(RunThread, &io_service));
     423    // boost::thread t(bind(&StateMachineMCP<S>::Run, &io_service));
    426424
    427425    if (conf.Has("cmd"))
  • trunk/FACT++/src/scheduler.cc

    r11479 r11481  
    11#include <vector>
    22
    3 #include <boost/bind.hpp>
    43#include <boost/regex.hpp>
    54
Note: See TracChangeset for help on using the changeset viewer.