Changeset 10371 for trunk/FACT++/src


Ignore:
Timestamp:
04/15/11 22:59:07 (14 years ago)
Author:
tbretz
Message:
Changed argeument to AssignFunction to a const reference.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventImp.h

    r10299 r10371  
    2828
    2929    // Function handling
    30     EventImp &AssignFunction(boost::function<int(const EventImp &)> func) { fFunction = func; return *this; }
     30    EventImp &AssignFunction(const boost::function<int(const EventImp &)> &func) { fFunction = func; return *this; }
    3131    bool HasFunc() const { return !fFunction.empty(); }
    3232    int ExecFunc() const { return HasFunc() ? fFunction(*this) : -1; }
    3333
    3434    // Configuration helper
    35     EventImp &operator()(boost::function<int(const EventImp &)> func) { return AssignFunction(func); }
     35    EventImp &operator()(const boost::function<int(const EventImp &)> &func) { return AssignFunction(func); }
    3636    EventImp &operator()(const std::string str) { SetDescription(str); return *this; }
    3737    EventImp &operator()(const char *str) { SetDescription(str); return *this; }
Note: See TracChangeset for help on using the changeset viewer.