Replace boost::bind/boost::function with std::bind/std::function

This commit is contained in:
Gunnar Beutner 2017-11-21 11:52:55 +01:00
parent 6b3931973e
commit 858873b940
113 changed files with 362 additions and 375 deletions

View File

@ -39,7 +39,7 @@ MainForm::MainForm(wxWindow *parent, const Url::Ptr& url)
port = "5665";
m_ApiClient = new ApiClient(url->GetHost(), port, url->GetUsername(), url->GetPassword());
m_ApiClient->GetTypes(boost::bind(&MainForm::TypesCompletionHandler, this, _1, _2, true));
m_ApiClient->GetTypes(std::bind(&MainForm::TypesCompletionHandler, this, _1, _2, true));
std::string title = url->Format() + " - Icinga Studio";
SetTitle(title);
@ -52,7 +52,7 @@ MainForm::MainForm(wxWindow *parent, const Url::Ptr& url)
void MainForm::TypesCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiType::Ptr>& types, bool forward)
{
if (forward) {
CallAfter(boost::bind(&MainForm::TypesCompletionHandler, this, eptr, types, false));
CallAfter(std::bind(&MainForm::TypesCompletionHandler, this, eptr, types, false));
return;
}
@ -113,7 +113,7 @@ void MainForm::OnTypeSelected(wxTreeEvent& event)
std::vector<String> attrs;
attrs.push_back("__name");
m_ApiClient->GetObjects(type->PluralName, boost::bind(&MainForm::ObjectsCompletionHandler, this, _1, _2, true),
m_ApiClient->GetObjects(type->PluralName, std::bind(&MainForm::ObjectsCompletionHandler, this, _1, _2, true),
std::vector<String>(), attrs);
}
@ -125,7 +125,7 @@ static bool ApiObjectLessComparer(const ApiObject::Ptr& o1, const ApiObject::Ptr
void MainForm::ObjectsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
{
if (forward) {
CallAfter(boost::bind(&MainForm::ObjectsCompletionHandler, this, eptr, objects, false));
CallAfter(std::bind(&MainForm::ObjectsCompletionHandler, this, eptr, objects, false));
return;
}
@ -172,7 +172,7 @@ void MainForm::OnObjectSelected(wxListEvent& event)
std::vector<String> names;
names.push_back(objectName);
m_ApiClient->GetObjects(type->PluralName, boost::bind(&MainForm::ObjectDetailsCompletionHandler, this, _1, _2, true),
m_ApiClient->GetObjects(type->PluralName, std::bind(&MainForm::ObjectDetailsCompletionHandler, this, _1, _2, true),
names, std::vector<String>(), std::vector<String>(), true);
}
@ -239,7 +239,7 @@ wxPGProperty *MainForm::ValueToProperty(const String& name, const Value& value)
void MainForm::ObjectDetailsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
{
if (forward) {
CallAfter(boost::bind(&MainForm::ObjectDetailsCompletionHandler, this, eptr, objects, false));
CallAfter(std::bind(&MainForm::ObjectDetailsCompletionHandler, this, eptr, objects, false));
return;
}

View File

@ -394,7 +394,7 @@ static void ReloadProcessCallback(const ProcessResult& pr)
{
l_Restarting = false;
boost::thread t(boost::bind(&ReloadProcessCallbackInternal, pr));
boost::thread t(std::bind(&ReloadProcessCallbackInternal, pr));
t.detach();
}

View File

@ -100,7 +100,7 @@ static Array::Ptr ArraySort(const std::vector<Value>& args)
BOOST_THROW_EXCEPTION(ScriptError("Sort function must be side-effect free."));
ObjectLock olock(arr);
std::sort(arr->Begin(), arr->End(), boost::bind(ArraySortCmp, args[0], _1, _2));
std::sort(arr->Begin(), arr->End(), std::bind(ArraySortCmp, args[0], _1, _2));
}
return arr;

View File

@ -594,7 +594,7 @@ void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)
if (srs != StatusNewItem)
continue;
upq.Enqueue(boost::bind(&ConfigObject::RestoreObject, message, attributeTypes));
upq.Enqueue(std::bind(&ConfigObject::RestoreObject, message, attributeTypes));
restored++;
}
@ -638,7 +638,7 @@ void ConfigObject::StopObjects(void)
}
}
void ConfigObject::DumpModifiedAttributes(const boost::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
{
for (const Type::Ptr& type : Type::GetAllTypes()) {
ConfigType *dtype = dynamic_cast<ConfigType *>(type.get());

View File

@ -92,7 +92,7 @@ public:
static void RestoreObjects(const String& filename, int attributeTypes = FAState);
static void StopObjects(void);
static void DumpModifiedAttributes(const boost::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback);
static void DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback);
static Object::Ptr GetPrototype(void);

View File

@ -50,7 +50,7 @@ void FileLogger::Start(bool runtimeCreated)
ReopenLogFile();
Application::OnReopenLogs.connect(boost::bind(&FileLogger::ReopenLogFile, this));
Application::OnReopenLogs.connect(std::bind(&FileLogger::ReopenLogFile, this));
}
void FileLogger::ReopenLogFile(void)

View File

@ -26,7 +26,6 @@
#include "base/functionwrapper.hpp"
#include "base/scriptglobal.hpp"
#include <vector>
#include <boost/function.hpp>
namespace icinga
{
@ -41,7 +40,7 @@ class I2_BASE_API Function : public ObjectImpl<Function>
public:
DECLARE_OBJECT(Function);
typedef boost::function<Value (const std::vector<Value>& arguments)> Callback;
typedef std::function<Value (const std::vector<Value>& arguments)> Callback;
Function(const String& name, const Callback& function, const std::vector<String>& args = std::vector<String>(),
bool side_effect_free = false, bool deprecated = false);

View File

@ -35,7 +35,7 @@ Value icinga::FunctionWrapperVA(void (*function)(const std::vector<Value>&), con
return Empty;
}
boost::function<Value (const std::vector<Value>& arguments)> icinga::WrapFunction(void (*function)(void))
std::function<Value (const std::vector<Value>& arguments)> icinga::WrapFunction(void (*function)(void))
{
return boost::bind(&FunctionWrapperVV, function, _1);
return std::bind(&FunctionWrapperVV, function, _1);
}

View File

@ -23,8 +23,8 @@
#include "base/i2-base.hpp"
#include "base/value.hpp"
#include <vector>
#include <boost/function.hpp>
#include <boost/bind.hpp>
using namespace std::placeholders;
namespace icinga
{
@ -32,7 +32,7 @@ namespace icinga
Value FunctionWrapperVV(void (*function)(void), const std::vector<Value>& arguments);
Value FunctionWrapperVA(void (*function)(const std::vector<Value>&), const std::vector<Value>& arguments);
boost::function<Value (const std::vector<Value>& arguments)> I2_BASE_API WrapFunction(void (*function)(void));
std::function<Value (const std::vector<Value>& arguments)> I2_BASE_API WrapFunction(void (*function)(void));
template<typename TR>
Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
@ -41,9 +41,9 @@ Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
}
template<typename TR>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(void))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(void))
{
return boost::bind(&FunctionWrapperR<TR>, function, _1);
return std::bind(&FunctionWrapperR<TR>, function, _1);
}
template<typename T0>
@ -60,9 +60,9 @@ Value FunctionWrapperV(void (*function)(T0), const std::vector<Value>& arguments
}
template<typename T0>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0))
{
return boost::bind(&FunctionWrapperV<T0>, function, _1);
return std::bind(&FunctionWrapperV<T0>, function, _1);
}
template<typename TR, typename T0>
@ -77,9 +77,9 @@ Value FunctionWrapperR(TR (*function)(T0), const std::vector<Value>& arguments)
}
template<typename TR, typename T0>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0))
{
return boost::bind(&FunctionWrapperR<TR, T0>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0>, function, _1);
}
template<typename T0, typename T1>
@ -97,9 +97,9 @@ Value FunctionWrapperV(void (*function)(T0, T1), const std::vector<Value>& argum
}
template<typename T0, typename T1>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1))
{
return boost::bind(&FunctionWrapperV<T0, T1>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1>, function, _1);
}
template<typename TR, typename T0, typename T1>
@ -115,9 +115,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1), const std::vector<Value>& argumen
}
template<typename TR, typename T0, typename T1>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1>, function, _1);
}
template<typename T0, typename T1, typename T2>
@ -136,9 +136,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2), const std::vector<Value>& a
}
template<typename T0, typename T1, typename T2>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2>
@ -155,9 +155,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2), const std::vector<Value>& arg
}
template<typename TR, typename T0, typename T1, typename T2>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2>, function, _1);
}
template<typename T0, typename T1, typename T2, typename T3>
@ -177,9 +177,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3), const std::vector<Value
}
template<typename T0, typename T1, typename T2, typename T3>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2, T3>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2, T3>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2, typename T3>
@ -197,9 +197,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3), const std::vector<Value>&
}
template<typename TR, typename T0, typename T1, typename T2, typename T3>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2, T3>, function, _1);
}
template<typename T0, typename T1, typename T2, typename T3, typename T4>
@ -220,9 +220,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4), const std::vector<V
}
template<typename T0, typename T1, typename T2, typename T3, typename T4>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2, T3, T4>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4>
@ -241,9 +241,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4), const std::vector<Val
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4>, function, _1);
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
@ -265,9 +265,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5), const std::vect
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
@ -287,9 +287,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5), const std::vector
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5>, function, _1);
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
@ -312,9 +312,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6), const std::
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
@ -335,9 +335,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6), const std::ve
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6>, function, _1);
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
@ -361,9 +361,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const s
}
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
{
return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
return std::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
@ -385,20 +385,20 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std
}
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
std::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
{
return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
return std::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
}
template<typename TR>
boost::function<TR (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(const std::vector<Value>&))
std::function<TR (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(const std::vector<Value>&))
{
return boost::bind<TR>(function, _1);
return std::bind<TR>(function, _1);
}
inline boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(const std::vector<Value>&))
inline std::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(const std::vector<Value>&))
{
return boost::bind(&FunctionWrapperVA, function, _1);
return std::bind(&FunctionWrapperVA, function, _1);
}
}

View File

@ -105,5 +105,10 @@
# define unlikely(x) (x)
#endif
#define BOOST_BIND_NO_PLACEHOLDERS
#include <functional>
using namespace std::placeholders;
#endif /* I2BASE_H */

View File

@ -81,7 +81,7 @@ void Loader::ExecuteDeferredInitializers(void)
}
}
void Loader::AddDeferredInitializer(const boost::function<void(void)>& callback, int priority)
void Loader::AddDeferredInitializer(const std::function<void(void)>& callback, int priority)
{
if (!GetDeferredInitializers().get())
GetDeferredInitializers().reset(new std::priority_queue<DeferredInitializer>());

View File

@ -23,7 +23,6 @@
#include "base/i2-base.hpp"
#include "base/string.hpp"
#include <boost/thread/tss.hpp>
#include <boost/function.hpp>
#include <queue>
namespace icinga
@ -32,7 +31,7 @@ namespace icinga
struct DeferredInitializer
{
public:
DeferredInitializer(const boost::function<void (void)>& callback, int priority)
DeferredInitializer(const std::function<void (void)>& callback, int priority)
: m_Callback(callback), m_Priority(priority)
{ }
@ -47,7 +46,7 @@ public:
}
private:
boost::function<void (void)> m_Callback;
std::function<void (void)> m_Callback;
int m_Priority;
};
@ -61,7 +60,7 @@ class I2_BASE_API Loader
public:
static void LoadExtensionLibrary(const String& library);
static void AddDeferredInitializer(const boost::function<void(void)>& callback, int priority = 0);
static void AddDeferredInitializer(const std::function<void(void)>& callback, int priority = 0);
static void ExecuteDeferredInitializers(void);
private:

View File

@ -256,7 +256,7 @@ static void TypeInfoTimerHandler(void)
INITIALIZE_ONCE([]() {
l_ObjectCountTimer = new Timer();
l_ObjectCountTimer->SetInterval(10);
l_ObjectCountTimer->OnTimerExpired.connect(boost::bind(TypeInfoTimerHandler));
l_ObjectCountTimer->OnTimerExpired.connect(std::bind(TypeInfoTimerHandler));
l_ObjectCountTimer->Start();
});
#endif /* I2_LEAK_DEBUG */

View File

@ -539,7 +539,7 @@ void Process::ThreadInitialize(void)
{
/* Note to self: Make sure this runs _after_ we've daemonized. */
for (int tid = 0; tid < IOTHREADS; tid++) {
boost::thread t(boost::bind(&Process::IOThreadProc, tid));
boost::thread t(std::bind(&Process::IOThreadProc, tid));
t.detach();
}
}
@ -788,7 +788,7 @@ static BOOL CreatePipeOverlapped(HANDLE *outReadPipe, HANDLE *outWritePipe,
}
#endif /* _WIN32 */
void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
void Process::Run(const std::function<void(const ProcessResult&)>& callback)
{
#ifndef _WIN32
boost::call_once(l_SpawnHelperOnceFlag, &Process::InitializeSpawnHelper);
@ -930,7 +930,7 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
delete [] args;
if (callback)
Utility::QueueAsyncCallback(boost::bind(callback, m_Result));
Utility::QueueAsyncCallback(std::bind(callback, m_Result));
return;
}
@ -1131,7 +1131,7 @@ bool Process::DoEvents(void)
m_Result.Output = output;
if (m_Callback)
Utility::QueueAsyncCallback(boost::bind(m_Callback, m_Result));
Utility::QueueAsyncCallback(std::bind(m_Callback, m_Result));
return false;
}

View File

@ -22,7 +22,6 @@
#include "base/i2-base.hpp"
#include "base/dictionary.hpp"
#include <boost/function.hpp>
#include <sstream>
#include <deque>
#include <vector>
@ -76,7 +75,7 @@ public:
void SetAdjustPriority(bool adjust);
bool GetAdjustPriority(void) const;
void Run(const boost::function<void (const ProcessResult&)>& callback = boost::function<void (const ProcessResult&)>());
void Run(const std::function<void (const ProcessResult&)>& callback = std::function<void (const ProcessResult&)>());
pid_t GetPID(void) const;
@ -109,7 +108,7 @@ private:
#endif /* _WIN32 */
std::ostringstream m_OutputStream;
boost::function<void (const ProcessResult&)> m_Callback;
std::function<void (const ProcessResult&)> m_Callback;
ProcessResult m_Result;
static void IOThreadProc(int tid);

View File

@ -477,7 +477,7 @@ Value ScriptUtils::Glob(const std::vector<Value>& args)
type = args[1];
std::vector<String> paths;
Utility::Glob(pathSpec, boost::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
Utility::Glob(pathSpec, std::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
return Array::FromVector(paths);
}
@ -496,7 +496,7 @@ Value ScriptUtils::GlobRecursive(const std::vector<Value>& args)
type = args[2];
std::vector<String> paths;
Utility::GlobRecursive(path, pattern, boost::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
Utility::GlobRecursive(path, pattern, std::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
return Array::FromVector(paths);
}

View File

@ -50,7 +50,7 @@ void SocketEventEngine::Start(void)
InitializeThread(tid);
m_Threads[tid] = boost::thread(boost::bind(&SocketEventEngine::ThreadProc, this, tid));
m_Threads[tid] = boost::thread(std::bind(&SocketEventEngine::ThreadProc, this, tid));
}
}

View File

@ -25,7 +25,6 @@
#include "base/value.hpp"
#include "base/dictionary.hpp"
#include "base/array.hpp"
#include <boost/function.hpp>
namespace icinga
{
@ -40,7 +39,7 @@ class I2_BASE_API StatsFunction : public Object
public:
DECLARE_PTR_TYPEDEFS(StatsFunction);
typedef boost::function<void (const Dictionary::Ptr& status, const Array::Ptr& perfdata)> Callback;
typedef std::function<void (const Dictionary::Ptr& status, const Array::Ptr& perfdata)> Callback;
StatsFunction(const Callback& function);

View File

@ -22,7 +22,7 @@
using namespace icinga;
void Stream::RegisterDataHandler(const boost::function<void(const Stream::Ptr&)>& handler)
void Stream::RegisterDataHandler(const std::function<void(const Stream::Ptr&)>& handler)
{
if (SupportsWaiting())
OnDataAvailable.connect(handler);
@ -85,7 +85,7 @@ void Stream::Close(void)
/* Force signals2 to remove the slots, see https://stackoverflow.com/questions/2049291/force-deletion-of-slot-in-boostsignals2
* for details. */
OnDataAvailable.connect(boost::bind(&StreamDummyCallback));
OnDataAvailable.connect(std::bind(&StreamDummyCallback));
}
StreamReadStatus Stream::ReadLine(String *line, StreamReadContext& context, bool may_wait)

View File

@ -131,7 +131,7 @@ public:
virtual bool IsDataAvailable(void) const;
void RegisterDataHandler(const boost::function<void(const Stream::Ptr&)>& handler);
void RegisterDataHandler(const std::function<void(const Stream::Ptr&)>& handler);
StreamReadStatus ReadLine(String *line, StreamReadContext& context, bool may_wait = false);

View File

@ -81,7 +81,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
m_FlushLogTimer = new Timer();
m_FlushLogTimer->SetInterval(1);
m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
m_FlushLogTimer->OnTimerExpired.connect(std::bind(&StreamLogger::FlushLogTimerHandler, this));
m_FlushLogTimer->Start();
}

View File

@ -54,7 +54,7 @@ void ThreadPool::Start(void)
for (size_t i = 0; i < sizeof(m_Queues) / sizeof(m_Queues[0]); i++)
m_Queues[i].SpawnWorker(m_ThreadGroup);
m_MgmtThread = boost::thread(boost::bind(&ThreadPool::ManagerThreadProc, this));
m_MgmtThread = boost::thread(std::bind(&ThreadPool::ManagerThreadProc, this));
}
void ThreadPool::Stop(void)

View File

@ -20,7 +20,6 @@
#include "base/timer.hpp"
#include "base/debug.hpp"
#include "base/utility.hpp"
#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
@ -282,6 +281,6 @@ void Timer::TimerThreadProc(void)
lock.unlock();
/* Asynchronously call the timer. */
Utility::QueueAsyncCallback(boost::bind(&Timer::Call, ptimer));
Utility::QueueAsyncCallback(std::bind(&Timer::Call, ptimer));
}
}

View File

@ -21,7 +21,6 @@
#include "base/utility.hpp"
#include "base/exception.hpp"
#include "base/logger.hpp"
#include <boost/bind.hpp>
#include <iostream>
#ifndef _WIN32

View File

@ -24,7 +24,6 @@
#include "base/string.hpp"
#include "base/object.hpp"
#include "base/initialize.hpp"
#include <boost/function.hpp>
#include <vector>
namespace icinga
@ -105,7 +104,7 @@ public:
virtual std::vector<String> GetLoadDependencies(void) const;
typedef boost::function<void (const Object::Ptr&, const Value&)> AttributeHandler;
typedef std::function<void (const Object::Ptr&, const Value&)> AttributeHandler;
virtual void RegisterAttributeHandler(int fieldId, const AttributeHandler& callback);
protected:

View File

@ -39,7 +39,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function
Type::Ptr self = static_cast<Type::Ptr>(vframe->Self);
int fid = self->GetFieldId(fieldName);
self->RegisterAttributeHandler(fid, boost::bind(&InvokeAttributeHandlerHelper, callback, _1, _2));
self->RegisterAttributeHandler(fid, std::bind(&InvokeAttributeHandlerHelper, callback, _1, _2));
}
Object::Ptr TypeType::GetPrototype(void)

View File

@ -36,6 +36,7 @@
#include <ios>
#include <fstream>
#include <iostream>
#include <future>
#ifdef __FreeBSD__
# include <pthread_np.h>
@ -502,7 +503,7 @@ static int GlobErrorHandler(const char *epath, int eerrno)
* @param callback The callback which is invoked for each matching file.
* @param type The file type (a combination of GlobFile and GlobDirectory)
*/
bool Utility::Glob(const String& pathSpec, const boost::function<void (const String&)>& callback, int type)
bool Utility::Glob(const String& pathSpec, const std::function<void (const String&)>& callback, int type)
{
std::vector<String> files, dirs;
@ -609,7 +610,7 @@ bool Utility::Glob(const String& pathSpec, const boost::function<void (const Str
* @param callback The callback which is invoked for each matching file.
* @param type The file type (a combination of GlobFile and GlobDirectory)
*/
bool Utility::GlobRecursive(const String& path, const String& pattern, const boost::function<void (const String&)>& callback, int type)
bool Utility::GlobRecursive(const String& path, const String& pattern, const std::function<void (const String&)>& callback, int type)
{
std::vector<String> files, dirs, alldirs;
@ -768,7 +769,7 @@ void Utility::MkDirP(const String& path, int mode)
void Utility::RemoveDirRecursive(const String& path)
{
std::vector<String> paths;
Utility::GlobRecursive(path, "*", boost::bind(&Utility::CollectPaths, _1, boost::ref(paths)), GlobFile | GlobDirectory);
Utility::GlobRecursive(path, "*", std::bind(&Utility::CollectPaths, _1, boost::ref(paths)), GlobFile | GlobDirectory);
/* This relies on the fact that GlobRecursive lists the parent directory
first before recursing into subdirectories. */

View File

@ -24,7 +24,6 @@
#include "base/string.hpp"
#include "base/array.hpp"
#include "base/threadpool.hpp"
#include <boost/function.hpp>
#include <boost/thread/tss.hpp>
#include <typeinfo>
#include <vector>
@ -80,8 +79,8 @@ public:
static String NewUniqueID(void);
static bool Glob(const String& pathSpec, const boost::function<void (const String&)>& callback, int type = GlobFile | GlobDirectory);
static bool GlobRecursive(const String& path, const String& pattern, const boost::function<void (const String&)>& callback, int type = GlobFile | GlobDirectory);
static bool Glob(const String& pathSpec, const std::function<void (const String&)>& callback, int type = GlobFile | GlobDirectory);
static bool GlobRecursive(const String& path, const String& pattern, const std::function<void (const String&)>& callback, int type = GlobFile | GlobDirectory);
static void MkDir(const String& path, int mode);
static void MkDirP(const String& path, int mode);
static bool SetFileOwnership(const String& file, const String& user, const String& group);

View File

@ -23,7 +23,6 @@
#include "base/convert.hpp"
#include "base/application.hpp"
#include "base/exception.hpp"
#include <boost/bind.hpp>
#include <boost/thread/tss.hpp>
using namespace icinga;
@ -40,7 +39,7 @@ WorkQueue::WorkQueue(size_t maxItems, int threadCount)
m_StatusTimer = new Timer();
m_StatusTimer->SetInterval(10);
m_StatusTimer->OnTimerExpired.connect(boost::bind(&WorkQueue::StatusTimerHandler, this));
m_StatusTimer->OnTimerExpired.connect(std::bind(&WorkQueue::StatusTimerHandler, this));
m_StatusTimer->Start();
}
@ -67,7 +66,7 @@ String WorkQueue::GetName(void) const
* allowInterleaved is true in which case the new task might be run
* immediately if it's being enqueued from within the WorkQueue thread.
*/
void WorkQueue::Enqueue(boost::function<void (void)>&& function, WorkQueuePriority priority,
void WorkQueue::Enqueue(std::function<void (void)>&& function, WorkQueuePriority priority,
bool allowInterleaved)
{
bool wq_thread = IsWorkerThread();
@ -85,7 +84,7 @@ void WorkQueue::Enqueue(boost::function<void (void)>&& function, WorkQueuePriori
<< "Spawning WorkQueue threads for '" << m_Name << "'";
for (int i = 0; i < m_ThreadCount; i++) {
m_Threads.create_thread(boost::bind(&WorkQueue::WorkerThreadProc, this));
m_Threads.create_thread(std::bind(&WorkQueue::WorkerThreadProc, this));
}
m_Spawned = true;

View File

@ -23,7 +23,6 @@
#include "base/i2-base.hpp"
#include "base/timer.hpp"
#include "base/ringbuffer.hpp"
#include <boost/function.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
@ -47,11 +46,11 @@ struct Task
: Priority(PriorityNormal), ID(-1)
{ }
Task(boost::function<void (void)>&& function, WorkQueuePriority priority, int id)
Task(std::function<void (void)>&& function, WorkQueuePriority priority, int id)
: Function(std::move(function)), Priority(priority), ID(id)
{ }
boost::function<void (void)> Function;
std::function<void (void)> Function;
WorkQueuePriority Priority;
int ID;
};
@ -79,7 +78,7 @@ inline bool operator<(const Task& a, const Task& b)
class I2_BASE_API WorkQueue
{
public:
typedef boost::function<void (boost::exception_ptr)> ExceptionCallback;
typedef std::function<void (boost::exception_ptr)> ExceptionCallback;
WorkQueue(size_t maxItems = 0, int threadCount = 1);
~WorkQueue(void);
@ -87,7 +86,7 @@ public:
void SetName(const String& name);
String GetName(void) const;
void Enqueue(boost::function<void (void)>&& function, WorkQueuePriority priority = PriorityNormal,
void Enqueue(std::function<void (void)>&& function, WorkQueuePriority priority = PriorityNormal,
bool allowInterleaved = false);
void Join(bool stop = false);

View File

@ -65,10 +65,10 @@ CheckerComponent::CheckerComponent(void)
void CheckerComponent::OnConfigLoaded(void)
{
ConfigObject::OnActiveChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
ConfigObject::OnPausedChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
ConfigObject::OnActiveChanged.connect(std::bind(&CheckerComponent::ObjectHandler, this, _1));
ConfigObject::OnPausedChanged.connect(std::bind(&CheckerComponent::ObjectHandler, this, _1));
Checkable::OnNextCheckChanged.connect(bind(&CheckerComponent::NextCheckChangedHandler, this, _1));
Checkable::OnNextCheckChanged.connect(std::bind(&CheckerComponent::NextCheckChangedHandler, this, _1));
}
void CheckerComponent::Start(bool runtimeCreated)
@ -79,11 +79,11 @@ void CheckerComponent::Start(bool runtimeCreated)
<< "'" << GetName() << "' started.";
m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
m_Thread = boost::thread(std::bind(&CheckerComponent::CheckThreadProc, this));
m_ResultTimer = new Timer();
m_ResultTimer->SetInterval(5);
m_ResultTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::ResultTimerHandler, this));
m_ResultTimer->OnTimerExpired.connect(std::bind(&CheckerComponent::ResultTimerHandler, this));
m_ResultTimer->Start();
}
@ -200,7 +200,7 @@ void CheckerComponent::CheckThreadProc(void)
Checkable::IncreasePendingChecks();
Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
Utility::QueueAsyncCallback(std::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
lock.lock();
}

View File

@ -195,7 +195,7 @@ char *ConsoleCommand::ConsoleCompleteHelper(const char *word, int state)
Array::Ptr suggestions;
l_ApiClient->AutocompleteScript(l_Session, word, l_ScriptFrame->Sandboxed,
boost::bind(&ConsoleCommand::AutocompleteScriptCompletionHandler,
std::bind(&ConsoleCommand::AutocompleteScriptCompletionHandler,
boost::ref(mutex), boost::ref(cv), boost::ref(ready),
_1, _2,
boost::ref(suggestions)));
@ -425,7 +425,7 @@ incomplete:
boost::exception_ptr eptr;
l_ApiClient->ExecuteScript(l_Session, command, scriptFrame.Sandboxed,
boost::bind(&ConsoleCommand::ExecuteScriptCompletionHandler,
std::bind(&ConsoleCommand::ExecuteScriptCompletionHandler,
boost::ref(mutex), boost::ref(cv), boost::ref(ready),
_1, _2,
boost::ref(result), boost::ref(eptr)));

View File

@ -52,7 +52,7 @@ static void IncludeZoneDirRecursive(const String& path, const String& package, b
ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
std::vector<Expression *> expressions;
Utility::GlobRecursive(path, "*.conf", boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
Utility::GlobRecursive(path, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
DictExpression expr(expressions);
if (!ExecuteExpression(&expr))
success = false;
@ -75,7 +75,7 @@ static void IncludeNonLocalZone(const String& zonePath, const String& package, b
}
std::vector<Expression *> expressions;
Utility::GlobRecursive(zonePath, "*.conf", boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
Utility::GlobRecursive(zonePath, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
DictExpression expr(expressions);
if (!ExecuteExpression(&expr))
success = false;
@ -126,7 +126,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
String zonesEtcDir = Application::GetZonesDir();
if (!zonesEtcDir.IsEmpty() && Utility::PathExists(zonesEtcDir))
Utility::Glob(zonesEtcDir + "/*", boost::bind(&IncludeZoneDirRecursive, _1, "_etc", boost::ref(success)), GlobDirectory);
Utility::Glob(zonesEtcDir + "/*", std::bind(&IncludeZoneDirRecursive, _1, "_etc", boost::ref(success)), GlobDirectory);
if (!success)
return false;
@ -135,7 +135,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
* are authoritative on this node and are checked in HasZoneConfigAuthority(). */
String packagesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/packages";
if (Utility::PathExists(packagesVarDir))
Utility::Glob(packagesVarDir + "/*", boost::bind(&IncludePackage, _1, boost::ref(success)), GlobDirectory);
Utility::Glob(packagesVarDir + "/*", std::bind(&IncludePackage, _1, boost::ref(success)), GlobDirectory);
if (!success)
return false;
@ -143,7 +143,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
/* Load cluster synchronized configuration files */
String zonesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
if (Utility::PathExists(zonesVarDir))
Utility::Glob(zonesVarDir + "/*", boost::bind(&IncludeNonLocalZone, _1, "_cluster", boost::ref(success)), GlobDirectory);
Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", boost::ref(success)), GlobDirectory);
if (!success)
return false;

View File

@ -200,11 +200,11 @@ bool FeatureUtility::GetFeatures(std::vector<String>& features, bool get_disable
/* disable = available-enabled */
String available_pattern = GetFeaturesAvailablePath() + "/*.conf";
std::vector<String> available;
Utility::Glob(available_pattern, boost::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(available)), GlobFile);
Utility::Glob(available_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(available)), GlobFile);
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
std::vector<String> enabled;
Utility::Glob(enabled_pattern, boost::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(enabled)), GlobFile);
Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(enabled)), GlobFile);
std::sort(available.begin(), available.end());
std::sort(enabled.begin(), enabled.end());
@ -217,7 +217,7 @@ bool FeatureUtility::GetFeatures(std::vector<String>& features, bool get_disable
/* all enabled features */
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
Utility::Glob(enabled_pattern, boost::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(features)), GlobFile);
Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(features)), GlobFile);
}
return true;

View File

@ -375,7 +375,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
String bestFilename;
try {
Utility::Glob(spath, boost::bind(&GetLatestReport, _1, boost::ref(bestTimestamp),
Utility::Glob(spath, std::bind(&GetLatestReport, _1, boost::ref(bestTimestamp),
boost::ref(bestFilename)), GlobFile);
}
#ifdef _WIN32

View File

@ -63,7 +63,7 @@ void CheckResultReader::Start(bool runtimeCreated)
#ifndef _WIN32
m_ReadTimer = new Timer();
m_ReadTimer->OnTimerExpired.connect(boost::bind(&CheckResultReader::ReadTimerHandler, this));
m_ReadTimer->OnTimerExpired.connect(std::bind(&CheckResultReader::ReadTimerHandler, this));
m_ReadTimer->SetInterval(5);
m_ReadTimer->Start();
#endif /* _WIN32 */
@ -87,7 +87,7 @@ void CheckResultReader::ReadTimerHandler(void) const
{
CONTEXT("Processing check result files in '" + GetSpoolDir() + "'");
Utility::Glob(GetSpoolDir() + "/c??????.ok", boost::bind(&CheckResultReader::ProcessCheckResultFile, this, _1), GlobFile);
Utility::Glob(GetSpoolDir() + "/c??????.ok", std::bind(&CheckResultReader::ProcessCheckResultFile, this, _1), GlobFile);
}
void CheckResultReader::ProcessCheckResultFile(const String& path) const

View File

@ -63,19 +63,19 @@ void CompatLogger::Start(bool runtimeCreated)
Log(LogInformation, "CompatLogger")
<< "'" << GetName() << "' started.";
Checkable::OnNewCheckResult.connect(bind(&CompatLogger::CheckResultHandler, this, _1, _2));
Checkable::OnNotificationSentToUser.connect(bind(&CompatLogger::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
Downtime::OnDowntimeTriggered.connect(boost::bind(&CompatLogger::TriggerDowntimeHandler, this, _1));
Downtime::OnDowntimeRemoved.connect(boost::bind(&CompatLogger::RemoveDowntimeHandler, this, _1));
Checkable::OnEventCommandExecuted.connect(bind(&CompatLogger::EventCommandHandler, this, _1));
Checkable::OnNewCheckResult.connect(std::bind(&CompatLogger::CheckResultHandler, this, _1, _2));
Checkable::OnNotificationSentToUser.connect(std::bind(&CompatLogger::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
Downtime::OnDowntimeTriggered.connect(std::bind(&CompatLogger::TriggerDowntimeHandler, this, _1));
Downtime::OnDowntimeRemoved.connect(std::bind(&CompatLogger::RemoveDowntimeHandler, this, _1));
Checkable::OnEventCommandExecuted.connect(std::bind(&CompatLogger::EventCommandHandler, this, _1));
Checkable::OnFlappingChanged.connect(boost::bind(&CompatLogger::FlappingChangedHandler, this, _1));
Checkable::OnEnableFlappingChanged.connect(boost::bind(&CompatLogger::EnableFlappingChangedHandler, this, _1));
Checkable::OnFlappingChanged.connect(std::bind(&CompatLogger::FlappingChangedHandler, this, _1));
Checkable::OnEnableFlappingChanged.connect(std::bind(&CompatLogger::EnableFlappingChangedHandler, this, _1));
ExternalCommandProcessor::OnNewExternalCommand.connect(boost::bind(&CompatLogger::ExternalCommandHandler, this, _2, _3));
ExternalCommandProcessor::OnNewExternalCommand.connect(std::bind(&CompatLogger::ExternalCommandHandler, this, _2, _3));
m_RotationTimer = new Timer();
m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this));
m_RotationTimer->OnTimerExpired.connect(std::bind(&CompatLogger::RotationTimerHandler, this));
m_RotationTimer->Start();
ReopenFile(false);

View File

@ -54,7 +54,7 @@ void ExternalCommandListener::Start(bool runtimeCreated)
<< "'" << GetName() << "' started.";
#ifndef _WIN32
m_CommandThread = boost::thread(boost::bind(&ExternalCommandListener::CommandPipeThread, this, GetCommandPath()));
m_CommandThread = boost::thread(std::bind(&ExternalCommandListener::CommandPipeThread, this, GetCommandPath()));
m_CommandThread.detach();
#endif /* _WIN32 */
}

View File

@ -80,12 +80,12 @@ void StatusDataWriter::Start(bool runtimeCreated)
m_StatusTimer = new Timer();
m_StatusTimer->SetInterval(GetUpdateInterval());
m_StatusTimer->OnTimerExpired.connect(boost::bind(&StatusDataWriter::StatusTimerHandler, this));
m_StatusTimer->OnTimerExpired.connect(std::bind(&StatusDataWriter::StatusTimerHandler, this));
m_StatusTimer->Start();
m_StatusTimer->Reschedule(0);
ConfigObject::OnVersionChanged.connect(boost::bind(&StatusDataWriter::ObjectHandler, this));
ConfigObject::OnActiveChanged.connect(boost::bind(&StatusDataWriter::ObjectHandler, this));
ConfigObject::OnVersionChanged.connect(std::bind(&StatusDataWriter::ObjectHandler, this));
ConfigObject::OnActiveChanged.connect(std::bind(&StatusDataWriter::ObjectHandler, this));
}
/**

View File

@ -23,7 +23,6 @@
#include "config/i2-config.hpp"
#include "config/expression.hpp"
#include "base/debuginfo.hpp"
#include <boost/function.hpp>
namespace icinga
{

View File

@ -155,7 +155,7 @@ Expression *ConfigCompiler::HandleInclude(const String& relativeBase, const Stri
std::vector<Expression *> expressions;
if (!Utility::Glob(includePath, boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile) && includePath.FindFirstOf("*?") == String::NPos) {
if (!Utility::Glob(includePath, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile) && includePath.FindFirstOf("*?") == String::NPos) {
std::ostringstream msgbuf;
msgbuf << "Include file '" + path + "' does not exist";
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), debuginfo));
@ -185,7 +185,7 @@ Expression *ConfigCompiler::HandleIncludeRecursive(const String& relativeBase, c
ppath = relativeBase + "/" + path;
std::vector<Expression *> expressions;
Utility::GlobRecursive(ppath, pattern, boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile);
Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile);
DictExpression *dict = new DictExpression(expressions);
dict->MakeInline();
@ -205,7 +205,7 @@ void ConfigCompiler::HandleIncludeZone(const String& relativeBase, const String&
RegisterZoneDir(tag, ppath, zoneName);
Utility::GlobRecursive(ppath, pattern, boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
}
/**
@ -231,7 +231,7 @@ Expression *ConfigCompiler::HandleIncludeZones(const String& relativeBase, const
}
std::vector<Expression *> expressions;
Utility::Glob(ppath + "/*", boost::bind(&ConfigCompiler::HandleIncludeZone, newRelativeBase, tag, _1, pattern, package, boost::ref(expressions)), GlobDirectory);
Utility::Glob(ppath + "/*", std::bind(&ConfigCompiler::HandleIncludeZone, newRelativeBase, tag, _1, pattern, package, boost::ref(expressions)), GlobDirectory);
return new DictExpression(expressions);
}

View File

@ -26,7 +26,6 @@
#include "base/registry.hpp"
#include "base/initialize.hpp"
#include "base/singleton.hpp"
#include <boost/function.hpp>
#include <iostream>
#include <stack>

View File

@ -608,7 +608,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr
Log(LogDebug, "ConfigItem")
<< "Setting 'active' to true for object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
#endif /* I2_DEBUG */
upq.Enqueue(boost::bind(&ConfigObject::PreActivate, object));
upq.Enqueue(std::bind(&ConfigObject::PreActivate, object));
}
upq.Join();
@ -631,7 +631,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr
Log(LogDebug, "ConfigItem")
<< "Activating object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
#endif /* I2_DEBUG */
upq.Enqueue(boost::bind(&ConfigObject::Activate, object, runtimeCreated));
upq.Enqueue(std::bind(&ConfigObject::Activate, object, runtimeCreated));
}
upq.Join();

View File

@ -112,7 +112,7 @@ public:
static inline Value NewFunction(ScriptFrame& frame, const String& name, const std::vector<String>& args,
std::map<String, Expression *> *closedVars, const boost::shared_ptr<Expression>& expression)
{
return new Function(name, boost::bind(&FunctionWrapper, _1, args,
return new Function(name, std::bind(&FunctionWrapper, _1, args,
EvaluateClosedVars(frame, closedVars), expression), args);
}

View File

@ -66,8 +66,8 @@ void DbConnection::Start(bool runtimeCreated)
Log(LogInformation, "DbConnection")
<< "'" << GetName() << "' started.";
DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
DbObject::OnMultipleQueries.connect(boost::bind(&DbConnection::ExecuteMultipleQueries, this, _1));
DbObject::OnQuery.connect(std::bind(&DbConnection::ExecuteQuery, this, _1));
DbObject::OnMultipleQueries.connect(std::bind(&DbConnection::ExecuteMultipleQueries, this, _1));
}
void DbConnection::Stop(bool runtimeRemoved)
@ -81,7 +81,7 @@ void DbConnection::Stop(bool runtimeRemoved)
void DbConnection::EnableActiveChangedHandler(void)
{
if (!m_ActiveChangedHandler) {
ConfigObject::OnActiveChanged.connect(boost::bind(&DbConnection::UpdateObject, this, _1));
ConfigObject::OnActiveChanged.connect(std::bind(&DbConnection::UpdateObject, this, _1));
m_ActiveChangedHandler = true;
}
}
@ -95,7 +95,7 @@ void DbConnection::Resume(void)
m_CleanUpTimer = new Timer();
m_CleanUpTimer->SetInterval(60);
m_CleanUpTimer->OnTimerExpired.connect(boost::bind(&DbConnection::CleanUpHandler, this));
m_CleanUpTimer->OnTimerExpired.connect(std::bind(&DbConnection::CleanUpHandler, this));
m_CleanUpTimer->Start();
}
@ -131,7 +131,7 @@ void DbConnection::InitializeDbTimer(void)
{
m_ProgramStatusTimer = new Timer();
m_ProgramStatusTimer->SetInterval(10);
m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&DbConnection::UpdateProgramStatus));
m_ProgramStatusTimer->OnTimerExpired.connect(std::bind(&DbConnection::UpdateProgramStatus));
m_ProgramStatusTimer->Start();
}

View File

@ -42,49 +42,49 @@ INITIALIZE_ONCE(&DbEvents::StaticInitialize);
void DbEvents::StaticInitialize(void)
{
/* Status */
Comment::OnCommentAdded.connect(boost::bind(&DbEvents::AddComment, _1));
Comment::OnCommentRemoved.connect(boost::bind(&DbEvents::RemoveComment, _1));
Downtime::OnDowntimeAdded.connect(boost::bind(&DbEvents::AddDowntime, _1));
Downtime::OnDowntimeRemoved.connect(boost::bind(&DbEvents::RemoveDowntime, _1));
Downtime::OnDowntimeTriggered.connect(boost::bind(&DbEvents::TriggerDowntime, _1));
Checkable::OnAcknowledgementSet.connect(boost::bind(&DbEvents::AddAcknowledgement, _1, _4));
Checkable::OnAcknowledgementCleared.connect(boost::bind(&DbEvents::RemoveAcknowledgement, _1));
Comment::OnCommentAdded.connect(std::bind(&DbEvents::AddComment, _1));
Comment::OnCommentRemoved.connect(std::bind(&DbEvents::RemoveComment, _1));
Downtime::OnDowntimeAdded.connect(std::bind(&DbEvents::AddDowntime, _1));
Downtime::OnDowntimeRemoved.connect(std::bind(&DbEvents::RemoveDowntime, _1));
Downtime::OnDowntimeTriggered.connect(std::bind(&DbEvents::TriggerDowntime, _1));
Checkable::OnAcknowledgementSet.connect(std::bind(&DbEvents::AddAcknowledgement, _1, _4));
Checkable::OnAcknowledgementCleared.connect(std::bind(&DbEvents::RemoveAcknowledgement, _1));
Checkable::OnNextCheckUpdated.connect(boost::bind(&DbEvents::NextCheckUpdatedHandler, _1));
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::FlappingChangedHandler, _1));
Checkable::OnNotificationSentToAllUsers.connect(boost::bind(&DbEvents::LastNotificationChangedHandler, _1, _2));
Checkable::OnNextCheckUpdated.connect(std::bind(&DbEvents::NextCheckUpdatedHandler, _1));
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::FlappingChangedHandler, _1));
Checkable::OnNotificationSentToAllUsers.connect(std::bind(&DbEvents::LastNotificationChangedHandler, _1, _2));
Checkable::OnEnableActiveChecksChanged.connect(boost::bind(&DbEvents::EnableActiveChecksChangedHandler, _1));
Checkable::OnEnablePassiveChecksChanged.connect(boost::bind(&DbEvents::EnablePassiveChecksChangedHandler, _1));
Checkable::OnEnableNotificationsChanged.connect(boost::bind(&DbEvents::EnableNotificationsChangedHandler, _1));
Checkable::OnEnablePerfdataChanged.connect(boost::bind(&DbEvents::EnablePerfdataChangedHandler, _1));
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::EnableFlappingChangedHandler, _1));
Checkable::OnEnableActiveChecksChanged.connect(std::bind(&DbEvents::EnableActiveChecksChangedHandler, _1));
Checkable::OnEnablePassiveChecksChanged.connect(std::bind(&DbEvents::EnablePassiveChecksChangedHandler, _1));
Checkable::OnEnableNotificationsChanged.connect(std::bind(&DbEvents::EnableNotificationsChangedHandler, _1));
Checkable::OnEnablePerfdataChanged.connect(std::bind(&DbEvents::EnablePerfdataChangedHandler, _1));
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::EnableFlappingChangedHandler, _1));
Checkable::OnReachabilityChanged.connect(boost::bind(&DbEvents::ReachabilityChangedHandler, _1, _2, _3));
Checkable::OnReachabilityChanged.connect(std::bind(&DbEvents::ReachabilityChangedHandler, _1, _2, _3));
/* History */
Comment::OnCommentAdded.connect(boost::bind(&DbEvents::AddCommentHistory, _1));
Downtime::OnDowntimeAdded.connect(boost::bind(&DbEvents::AddDowntimeHistory, _1));
Checkable::OnAcknowledgementSet.connect(boost::bind(&DbEvents::AddAcknowledgementHistory, _1, _2, _3, _4, _5, _6));
Comment::OnCommentAdded.connect(std::bind(&DbEvents::AddCommentHistory, _1));
Downtime::OnDowntimeAdded.connect(std::bind(&DbEvents::AddDowntimeHistory, _1));
Checkable::OnAcknowledgementSet.connect(std::bind(&DbEvents::AddAcknowledgementHistory, _1, _2, _3, _4, _5, _6));
Checkable::OnNotificationSentToAllUsers.connect(boost::bind(&DbEvents::AddNotificationHistory, _1, _2, _3, _4, _5, _6, _7));
Checkable::OnNotificationSentToAllUsers.connect(std::bind(&DbEvents::AddNotificationHistory, _1, _2, _3, _4, _5, _6, _7));
Checkable::OnStateChange.connect(boost::bind(&DbEvents::AddStateChangeHistory, _1, _2, _3));
Checkable::OnStateChange.connect(std::bind(&DbEvents::AddStateChangeHistory, _1, _2, _3));
Checkable::OnNewCheckResult.connect(boost::bind(&DbEvents::AddCheckResultLogHistory, _1, _2));
Checkable::OnNotificationSentToUser.connect(boost::bind(&DbEvents::AddNotificationSentLogHistory, _1, _2, _3, _4, _5, _6, _7));
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::AddFlappingChangedLogHistory, _1));
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::AddEnableFlappingChangedLogHistory, _1));
Downtime::OnDowntimeTriggered.connect(boost::bind(&DbEvents::AddTriggerDowntimeLogHistory, _1));
Downtime::OnDowntimeRemoved.connect(boost::bind(&DbEvents::AddRemoveDowntimeLogHistory, _1));
Checkable::OnNewCheckResult.connect(std::bind(&DbEvents::AddCheckResultLogHistory, _1, _2));
Checkable::OnNotificationSentToUser.connect(std::bind(&DbEvents::AddNotificationSentLogHistory, _1, _2, _3, _4, _5, _6, _7));
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::AddFlappingChangedLogHistory, _1));
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::AddEnableFlappingChangedLogHistory, _1));
Downtime::OnDowntimeTriggered.connect(std::bind(&DbEvents::AddTriggerDowntimeLogHistory, _1));
Downtime::OnDowntimeRemoved.connect(std::bind(&DbEvents::AddRemoveDowntimeLogHistory, _1));
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::AddFlappingChangedHistory, _1));
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::AddEnableFlappingChangedHistory, _1));
Checkable::OnNewCheckResult.connect(boost::bind(&DbEvents::AddCheckableCheckHistory, _1, _2));
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::AddFlappingChangedHistory, _1));
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::AddEnableFlappingChangedHistory, _1));
Checkable::OnNewCheckResult.connect(std::bind(&DbEvents::AddCheckableCheckHistory, _1, _2));
Checkable::OnEventCommandExecuted.connect(boost::bind(&DbEvents::AddEventHandlerHistory, _1));
Checkable::OnEventCommandExecuted.connect(std::bind(&DbEvents::AddEventHandlerHistory, _1));
ExternalCommandProcessor::OnNewExternalCommand.connect(boost::bind(&DbEvents::AddExternalCommandHistory, _1, _2, _3));
ExternalCommandProcessor::OnNewExternalCommand.connect(std::bind(&DbEvents::AddExternalCommandHistory, _1, _2, _3));
}
/* check events */

View File

@ -52,11 +52,11 @@ DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const
void DbObject::StaticInitialize(void)
{
/* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
ConfigObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
CustomVarObject::OnVarsChanged.connect(boost::bind(&DbObject::VarsChangedHandler, _1));
ConfigObject::OnStateChanged.connect(std::bind(&DbObject::StateChangedHandler, _1));
CustomVarObject::OnVarsChanged.connect(std::bind(&DbObject::VarsChangedHandler, _1));
/* triggered on create, update and delete objects */
ConfigObject::OnVersionChanged.connect(boost::bind(&DbObject::VersionChangedHandler, _1));
ConfigObject::OnVersionChanged.connect(std::bind(&DbObject::VersionChangedHandler, _1));
}
void DbObject::SetObject(const ConfigObject::Ptr& object)

View File

@ -41,7 +41,7 @@ class I2_DB_IDO_API DbType : public Object
public:
DECLARE_PTR_TYPEDEFS(DbType);
typedef boost::function<intrusive_ptr<DbObject> (const intrusive_ptr<DbType>&, const String&, const String&)> ObjectFactory;
typedef std::function<intrusive_ptr<DbObject> (const intrusive_ptr<DbType>&, const String&, const String&)> ObjectFactory;
typedef std::map<String, DbType::Ptr> TypeMap;
typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap;

View File

@ -36,8 +36,8 @@ INITIALIZE_ONCE(&EndpointDbObject::StaticInitialize);
void EndpointDbObject::StaticInitialize(void)
{
Endpoint::OnConnected.connect(boost::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
Endpoint::OnDisconnected.connect(boost::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
Endpoint::OnConnected.connect(std::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
Endpoint::OnDisconnected.connect(std::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
}
EndpointDbObject::EndpointDbObject(const DbType::Ptr& type, const String& name1, const String& name2)

View File

@ -85,16 +85,16 @@ void IdoMysqlConnection::Resume(void)
SetConnected(false);
m_QueryQueue.SetExceptionCallback(boost::bind(&IdoMysqlConnection::ExceptionHandler, this, _1));
m_QueryQueue.SetExceptionCallback(std::bind(&IdoMysqlConnection::ExceptionHandler, this, _1));
m_TxTimer = new Timer();
m_TxTimer->SetInterval(1);
m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::TxTimerHandler, this));
m_TxTimer->OnTimerExpired.connect(std::bind(&IdoMysqlConnection::TxTimerHandler, this));
m_TxTimer->Start();
m_ReconnectTimer = new Timer();
m_ReconnectTimer->SetInterval(10);
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::ReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&IdoMysqlConnection::ReconnectTimerHandler, this));
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
@ -115,7 +115,7 @@ void IdoMysqlConnection::Pause(void)
<< "Rescheduling disconnect task.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::Disconnect, this), PriorityHigh);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::Disconnect, this), PriorityHigh);
m_QueryQueue.Join();
}
@ -163,8 +163,8 @@ void IdoMysqlConnection::NewTransaction(void)
<< "Scheduling new transaction and finishing async queries.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalNewTransaction, this), PriorityHigh);
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::FinishAsyncQueries, this), PriorityHigh);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalNewTransaction, this), PriorityHigh);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::FinishAsyncQueries, this), PriorityHigh);
}
void IdoMysqlConnection::InternalNewTransaction(void)
@ -185,7 +185,7 @@ void IdoMysqlConnection::ReconnectTimerHandler(void)
<< "Scheduling reconnect task.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::Reconnect, this), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::Reconnect, this), PriorityLow);
}
void IdoMysqlConnection::Reconnect(void)
@ -444,9 +444,9 @@ void IdoMysqlConnection::Reconnect(void)
<< "Scheduling session table clear and finish connect task.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::ClearTablesBySession, this), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::ClearTablesBySession, this), PriorityLow);
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::FinishConnect, this, startTime), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::FinishConnect, this, startTime), PriorityLow);
}
void IdoMysqlConnection::FinishConnect(double startTime)
@ -479,7 +479,7 @@ void IdoMysqlConnection::ClearTableBySession(const String& table)
Convert::ToString(GetSessionToken()));
}
void IdoMysqlConnection::AsyncQuery(const String& query, const boost::function<void (const IdoMysqlResult&)>& callback)
void IdoMysqlConnection::AsyncQuery(const String& query, const std::function<void (const IdoMysqlResult&)>& callback)
{
AssertOnWorkQueue();
@ -715,7 +715,7 @@ void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
<< "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalActivateObject, this, dbobj), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalActivateObject, this, dbobj), PriorityLow);
}
void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj)
@ -754,7 +754,7 @@ void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj)
<< "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow);
}
void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
@ -859,7 +859,7 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
<< "Scheduling execute query task, type " << query.Type << ", table '" << query.Table << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true);
}
void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
@ -872,7 +872,7 @@ void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& quer
<< "Scheduling multiple execute query task, type " << queries[0].Type << ", table '" << queries[0].Table << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), queries[0].Priority, true);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), queries[0].Priority, true);
}
bool IdoMysqlConnection::CanExecuteQuery(const DbQuery& query)
@ -925,7 +925,7 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
<< query.Type << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
return;
}
}
@ -963,7 +963,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
return;
}
@ -986,7 +986,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
return;
}
@ -1065,7 +1065,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
<< kv.first << "', val '" << kv.second << "', type " << typeOverride << ", table '" << query.Table << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
return;
}
@ -1095,7 +1095,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
if (type != DbQueryInsert)
qbuf << where.str();
AsyncQuery(qbuf.str(), boost::bind(&IdoMysqlConnection::FinishExecuteQuery, this, query, type, upsert));
AsyncQuery(qbuf.str(), std::bind(&IdoMysqlConnection::FinishExecuteQuery, this, query, type, upsert));
}
void IdoMysqlConnection::FinishExecuteQuery(const DbQuery& query, int type, bool upsert)
@ -1107,7 +1107,7 @@ void IdoMysqlConnection::FinishExecuteQuery(const DbQuery& query, int type, bool
<< "Rescheduling DELETE/INSERT query: Upsert UPDATE did not affect rows, type " << type << ", table '" << query.Table << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, DbQueryDelete | DbQueryInsert), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, DbQueryDelete | DbQueryInsert), query.Priority);
return;
}
@ -1132,7 +1132,7 @@ void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String&
<< time_column << "'. max_age is set to '" << max_age << "'.";
#endif /* I2_DEBUG */
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true);
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true);
}
void IdoMysqlConnection::InternalCleanUpExecuteQuery(const String& table, const String& time_column, double max_age)

View File

@ -31,7 +31,7 @@ namespace icinga
typedef boost::shared_ptr<MYSQL_RES> IdoMysqlResult;
typedef boost::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
typedef std::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
struct IdoAsyncQuery
{

View File

@ -89,16 +89,16 @@ void IdoPgsqlConnection::Resume(void)
SetConnected(false);
m_QueryQueue.SetExceptionCallback(boost::bind(&IdoPgsqlConnection::ExceptionHandler, this, _1));
m_QueryQueue.SetExceptionCallback(std::bind(&IdoPgsqlConnection::ExceptionHandler, this, _1));
m_TxTimer = new Timer();
m_TxTimer->SetInterval(1);
m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::TxTimerHandler, this));
m_TxTimer->OnTimerExpired.connect(std::bind(&IdoPgsqlConnection::TxTimerHandler, this));
m_TxTimer->Start();
m_ReconnectTimer = new Timer();
m_ReconnectTimer->SetInterval(10);
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::ReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&IdoPgsqlConnection::ReconnectTimerHandler, this));
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
@ -114,7 +114,7 @@ void IdoPgsqlConnection::Pause(void)
DbConnection::Pause();
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
m_QueryQueue.Join();
}
@ -156,7 +156,7 @@ void IdoPgsqlConnection::TxTimerHandler(void)
void IdoPgsqlConnection::NewTransaction(void)
{
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true);
}
void IdoPgsqlConnection::InternalNewTransaction(void)
@ -172,7 +172,7 @@ void IdoPgsqlConnection::InternalNewTransaction(void)
void IdoPgsqlConnection::ReconnectTimerHandler(void)
{
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::Reconnect, this), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::Reconnect, this), PriorityLow);
}
void IdoPgsqlConnection::Reconnect(void)
@ -395,9 +395,9 @@ void IdoPgsqlConnection::Reconnect(void)
UpdateAllObjects();
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::ClearTablesBySession, this), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::ClearTablesBySession, this), PriorityLow);
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::FinishConnect, this, startTime), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::FinishConnect, this, startTime), PriorityLow);
}
void IdoPgsqlConnection::FinishConnect(double startTime)
@ -542,7 +542,7 @@ Dictionary::Ptr IdoPgsqlConnection::FetchRow(const IdoPgsqlResult& result, int r
void IdoPgsqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
{
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalActivateObject, this, dbobj), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalActivateObject, this, dbobj), PriorityLow);
}
void IdoPgsqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj)
@ -576,7 +576,7 @@ void IdoPgsqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj)
void IdoPgsqlConnection::DeactivateObject(const DbObject::Ptr& dbobj)
{
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow);
}
void IdoPgsqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
@ -676,7 +676,7 @@ void IdoPgsqlConnection::ExecuteQuery(const DbQuery& query)
{
ASSERT(query.Category != DbCatInvalid);
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true);
}
void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
@ -684,7 +684,7 @@ void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& quer
if (queries.empty())
return;
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteMultipleQueries, this, queries), queries[0].Priority, true);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteMultipleQueries, this, queries), queries[0].Priority, true);
}
bool IdoPgsqlConnection::CanExecuteQuery(const DbQuery& query)
@ -730,7 +730,7 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
if (!CanExecuteQuery(query)) {
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteMultipleQueries, this, queries), query.Priority);
return;
}
}
@ -761,7 +761,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
/* check if there are missing object/insert ids and re-enqueue the query */
if (!CanExecuteQuery(query)) {
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, typeOverride), query.Priority);
return;
}
@ -777,7 +777,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
for (const Dictionary::Pair& kv : query.WhereCriteria) {
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
return;
}
@ -848,7 +848,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
continue;
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority);
return;
}
@ -908,7 +908,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
void IdoPgsqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
{
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true);
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true);
}
void IdoPgsqlConnection::InternalCleanUpExecuteQuery(const String& table, const String& time_column, double max_age)

View File

@ -39,7 +39,7 @@ void Demo::Start(bool runtimeCreated)
m_DemoTimer = new Timer();
m_DemoTimer->SetInterval(5);
m_DemoTimer->OnTimerExpired.connect(boost::bind(&Demo::DemoTimerHandler, this));
m_DemoTimer->OnTimerExpired.connect(std::bind(&Demo::DemoTimerHandler, this));
m_DemoTimer->Start();
}

View File

@ -36,11 +36,11 @@ boost::signals2::signal<void (const Checkable::Ptr&, const MessageOrigin::Ptr&)>
void Checkable::StaticInitialize(void)
{
/* fixed downtime start */
Downtime::OnDowntimeStarted.connect(boost::bind(&Checkable::NotifyFixedDowntimeStart, _1));
Downtime::OnDowntimeStarted.connect(std::bind(&Checkable::NotifyFixedDowntimeStart, _1));
/* flexible downtime start */
Downtime::OnDowntimeTriggered.connect(boost::bind(&Checkable::NotifyFlexibleDowntimeStart, _1));
Downtime::OnDowntimeTriggered.connect(std::bind(&Checkable::NotifyFlexibleDowntimeStart, _1));
/* fixed/flexible downtime end */
Downtime::OnDowntimeRemoved.connect(boost::bind(&Checkable::NotifyDowntimeEnd, _1));
Downtime::OnDowntimeRemoved.connect(std::bind(&Checkable::NotifyDowntimeEnd, _1));
}
Checkable::Checkable(void)

View File

@ -45,7 +45,7 @@ void Comment::StaticInitialize(void)
{
l_CommentsExpireTimer = new Timer();
l_CommentsExpireTimer->SetInterval(60);
l_CommentsExpireTimer->OnTimerExpired.connect(boost::bind(&Comment::CommentsExpireTimerHandler));
l_CommentsExpireTimer->OnTimerExpired.connect(std::bind(&Comment::CommentsExpireTimerHandler));
l_CommentsExpireTimer->Start();
}

View File

@ -49,12 +49,12 @@ void Downtime::StaticInitialize(void)
{
l_DowntimesStartTimer = new Timer();
l_DowntimesStartTimer->SetInterval(5);
l_DowntimesStartTimer->OnTimerExpired.connect(boost::bind(&Downtime::DowntimesStartTimerHandler));
l_DowntimesStartTimer->OnTimerExpired.connect(std::bind(&Downtime::DowntimesStartTimerHandler));
l_DowntimesStartTimer->Start();
l_DowntimesExpireTimer = new Timer();
l_DowntimesExpireTimer->SetInterval(60);
l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Downtime::DowntimesExpireTimerHandler));
l_DowntimesExpireTimer->OnTimerExpired.connect(std::bind(&Downtime::DowntimesExpireTimerHandler));
l_DowntimesExpireTimer->Start();
}

View File

@ -44,7 +44,7 @@ using namespace icinga;
INITIALIZE_ONCE(&ExternalCommandProcessor::StaticInitialize);
typedef boost::function<void (double, const std::vector<String>& arguments)> ExternalCommandCallback;
typedef std::function<void (double, const std::vector<String>& arguments)> ExternalCommandCallback;
struct ExternalCommandInfo
{

View File

@ -23,7 +23,6 @@
#include "icinga/i2-icinga.hpp"
#include "icinga/command.hpp"
#include "base/string.hpp"
#include <boost/function.hpp>
#include <boost/signals2.hpp>
#include <vector>

View File

@ -100,7 +100,7 @@ int IcingaApplication::Main(void)
/* periodically dump the program state */
l_RetentionTimer = new Timer();
l_RetentionTimer->SetInterval(300);
l_RetentionTimer->OnTimerExpired.connect(boost::bind(&IcingaApplication::DumpProgramState, this));
l_RetentionTimer->OnTimerExpired.connect(std::bind(&IcingaApplication::DumpProgramState, this));
l_RetentionTimer->Start();
RunEventLoop();
@ -166,7 +166,7 @@ void IcingaApplication::DumpModifiedAttributes(void)
fp.exceptions(std::ofstream::failbit | std::ofstream::badbit);
ConfigObject::Ptr previousObject;
ConfigObject::DumpModifiedAttributes(boost::bind(&PersistModAttrHelper, boost::ref(fp), boost::ref(previousObject), _1, _2, _3));
ConfigObject::DumpModifiedAttributes(std::bind(&PersistModAttrHelper, boost::ref(fp), boost::ref(previousObject), _1, _2, _3));
if (previousObject) {
ConfigWriter::EmitRaw(fp, "\tobj.version = ");

View File

@ -215,10 +215,10 @@ Value MacroProcessor::EvaluateFunction(const Function::Ptr& func, const Resolver
resolvers_this->Set(resolver.first, resolver.second);
}
resolvers_this->Set("macro", new Function("macro (temporary)", boost::bind(&MacroProcessor::InternalResolveMacrosShim,
resolvers_this->Set("macro", new Function("macro (temporary)", std::bind(&MacroProcessor::InternalResolveMacrosShim,
_1, boost::cref(resolvers), cr, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros,
recursionLevel + 1), { "str" }));
resolvers_this->Set("resolve_arguments", new Function("resolve_arguments (temporary)", boost::bind(&MacroProcessor::InternalResolveArgumentsShim,
resolvers_this->Set("resolve_arguments", new Function("resolve_arguments (temporary)", std::bind(&MacroProcessor::InternalResolveArgumentsShim,
_1, boost::cref(resolvers), cr, resolvedMacros, useResolvedMacros,
recursionLevel + 1)));

View File

@ -23,7 +23,6 @@
#include "icinga/i2-icinga.hpp"
#include "icinga/checkable.hpp"
#include "base/value.hpp"
#include <boost/function.hpp>
#include <vector>
namespace icinga
@ -37,7 +36,7 @@ namespace icinga
class I2_ICINGA_API MacroProcessor
{
public:
typedef boost::function<Value (const Value&)> EscapeCallback;
typedef std::function<Value (const Value&)> EscapeCallback;
typedef std::pair<String, Object::Ptr> ResolverSpec;
typedef std::vector<ResolverSpec> ResolverList;

View File

@ -416,7 +416,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
<< "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '"
<< GetName() << "' for user '" << userName << "'";
Utility::QueueAsyncCallback(boost::bind(&Notification::ExecuteNotificationHelper, this, type, user, cr, force, author, text));
Utility::QueueAsyncCallback(std::bind(&Notification::ExecuteNotificationHelper, this, type, user, cr, force, author, text));
/* collect all notified users */
allNotifiedUsers.insert(user);

View File

@ -35,7 +35,7 @@ using namespace icinga;
void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros,
const boost::function<void(const Value& commandLine, const ProcessResult&)>& callback)
const std::function<void(const Value& commandLine, const ProcessResult&)>& callback)
{
Value raw_command = commandObj->GetCommandLine();
Dictionary::Ptr raw_arguments = commandObj->GetArguments();
@ -95,7 +95,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
process->SetAdjustPriority(true);
process->Run(boost::bind(callback, command, _1));
process->Run(std::bind(callback, command, _1));
}
ServiceState PluginUtility::ExitStatusToState(int exitStatus)

View File

@ -42,7 +42,7 @@ public:
static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros,
const boost::function<void(const Value& commandLine, const ProcessResult&)>& callback = boost::function<void(const Value& commandLine, const ProcessResult&)>());
const std::function<void(const Value& commandLine, const ProcessResult&)>& callback = std::function<void(const Value& commandLine, const ProcessResult&)>());
static ServiceState ExitStatusToState(int exitStatus);
static std::pair<String, String> ParseCheckOutput(const String& output);

View File

@ -83,7 +83,7 @@ void ScheduledDowntime::StaticInitialize(void)
{
l_Timer = new Timer();
l_Timer->SetInterval(60);
l_Timer->OnTimerExpired.connect(boost::bind(&ScheduledDowntime::TimerProc));
l_Timer->OnTimerExpired.connect(std::bind(&ScheduledDowntime::TimerProc));
l_Timer->Start();
}
@ -99,7 +99,7 @@ void ScheduledDowntime::Start(bool runtimeCreated)
{
ObjectImpl<ScheduledDowntime>::Start(runtimeCreated);
Utility::QueueAsyncCallback(boost::bind(&ScheduledDowntime::CreateNextDowntime, this));
Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
}
void ScheduledDowntime::TimerProc(void)

View File

@ -39,7 +39,7 @@ void TimePeriod::StaticInitialize(void)
{
l_UpdateTimer = new Timer();
l_UpdateTimer->SetInterval(300);
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
l_UpdateTimer->OnTimerExpired.connect(std::bind(&TimePeriod::UpdateTimerHandler));
l_UpdateTimer->Start();
}

View File

@ -29,7 +29,7 @@ Value Column::ExtractValue(const Value& urow, LivestatusGroupByType groupByType,
{
Value row;
if (!m_ObjectAccessor.empty())
if (m_ObjectAccessor)
row = m_ObjectAccessor(urow, groupByType, groupByObject);
else
row = urow;

View File

@ -22,7 +22,6 @@
#include "livestatus/i2-livestatus.hpp"
#include "base/value.hpp"
#include <boost/function.hpp>
using namespace icinga;
@ -38,8 +37,8 @@ enum LivestatusGroupByType {
class I2_LIVESTATUS_API Column
{
public:
typedef boost::function<Value (const Value&)> ValueAccessor;
typedef boost::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
typedef std::function<Value (const Value&)> ValueAccessor;
typedef std::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor);

View File

@ -48,8 +48,8 @@ void CommentsTable::AddColumns(Table *table, const String& prefix,
table->AddColumn(prefix + "expire_time", Column(&CommentsTable::ExpireTimeAccessor, objectAccessor));
/* order is important - host w/o services must not be empty */
ServicesTable::AddColumns(table, "service_", boost::bind(&CommentsTable::ServiceAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "host_", boost::bind(&CommentsTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "service_", std::bind(&CommentsTable::ServiceAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "host_", std::bind(&CommentsTable::HostAccessor, _1, objectAccessor));
}
String CommentsTable::GetName(void) const

View File

@ -48,8 +48,8 @@ void DowntimesTable::AddColumns(Table *table, const String& prefix,
table->AddColumn(prefix + "triggered_by", Column(&DowntimesTable::TriggeredByAccessor, objectAccessor));
/* order is important - host w/o services must not be empty */
ServicesTable::AddColumns(table, "service_", boost::bind(&DowntimesTable::ServiceAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "host_", boost::bind(&DowntimesTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "service_", std::bind(&DowntimesTable::ServiceAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "host_", std::bind(&DowntimesTable::HostAccessor, _1, objectAccessor));
}
String DowntimesTable::GetName(void) const

View File

@ -170,7 +170,7 @@ void HostsTable::AddColumns(Table *table, const String& prefix,
/* _1 = row, _2 = groupByType, _3 = groupByObject */
Log(LogDebug, "Livestatus")
<< "Processing hosts group by hostgroup table.";
HostGroupsTable::AddColumns(table, "hostgroup_", boost::bind(&HostsTable::HostGroupAccessor, _1, _2, _3));
HostGroupsTable::AddColumns(table, "hostgroup_", std::bind(&HostsTable::HostGroupAccessor, _1, _2, _3));
}
}

View File

@ -82,7 +82,7 @@ void LivestatusListener::Start(bool runtimeCreated)
m_Listener = socket;
m_Thread = boost::thread(boost::bind(&LivestatusListener::ServerThreadProc, this));
m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
Log(LogInformation, "LivestatusListener")
<< "Created TCP socket listening on host '" << GetBindHost() << "' port '" << GetBindPort() << "'.";
@ -110,7 +110,7 @@ void LivestatusListener::Start(bool runtimeCreated)
m_Listener = socket;
m_Thread = boost::thread(boost::bind(&LivestatusListener::ServerThreadProc, this));
m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
Log(LogInformation, "LivestatusListener")
<< "Created UNIX socket in '" << GetSocketPath() << "'.";
@ -160,7 +160,7 @@ void LivestatusListener::ServerThreadProc(void)
if (m_Listener->Poll(true, false, &tv)) {
Socket::Ptr client = m_Listener->Accept();
Log(LogNotice, "LivestatusListener", "Client connected");
Utility::QueueAsyncCallback(boost::bind(&LivestatusListener::ClientHandler, this, client), LowLatencyScheduler);
Utility::QueueAsyncCallback(std::bind(&LivestatusListener::ClientHandler, this, client), LowLatencyScheduler);
}
if (!IsActive())

View File

@ -39,8 +39,8 @@ using namespace icinga;
void LivestatusLogUtility::CreateLogIndex(const String& path, std::map<time_t, String>& index)
{
Utility::Glob(path + "/icinga.log", boost::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
Utility::Glob(path + "/archives/*.log", boost::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
Utility::Glob(path + "/icinga.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
Utility::Glob(path + "/archives/*.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
}
void LivestatusLogUtility::CreateLogIndexFileHandler(const String& path, std::map<time_t, String>& index)

View File

@ -75,10 +75,10 @@ void LogTable::AddColumns(Table *table, const String& prefix,
table->AddColumn(prefix + "contact_name", Column(&LogTable::ContactNameAccessor, objectAccessor));
table->AddColumn(prefix + "command_name", Column(&LogTable::CommandNameAccessor, objectAccessor));
HostsTable::AddColumns(table, "current_host_", boost::bind(&LogTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "current_service_", boost::bind(&LogTable::ServiceAccessor, _1, objectAccessor));
ContactsTable::AddColumns(table, "current_contact_", boost::bind(&LogTable::ContactAccessor, _1, objectAccessor));
CommandsTable::AddColumns(table, "current_command_", boost::bind(&LogTable::CommandAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "current_host_", std::bind(&LogTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "current_service_", std::bind(&LogTable::ServiceAccessor, _1, objectAccessor));
ContactsTable::AddColumns(table, "current_contact_", std::bind(&LogTable::ContactAccessor, _1, objectAccessor));
CommandsTable::AddColumns(table, "current_command_", std::bind(&LogTable::CommandAccessor, _1, objectAccessor));
}
String LogTable::GetName(void) const

View File

@ -138,19 +138,19 @@ void ServicesTable::AddColumns(Table *table, const String& prefix,
table->AddColumn(prefix + "cv_is_json", Column(&ServicesTable::CVIsJsonAccessor, objectAccessor));
table->AddColumn(prefix + "original_attributes", Column(&ServicesTable::OriginalAttributesAccessor, objectAccessor));
HostsTable::AddColumns(table, "host_", boost::bind(&ServicesTable::HostAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "host_", std::bind(&ServicesTable::HostAccessor, _1, objectAccessor));
/* add additional group by values received through the object accessor */
if (table->GetGroupByType() == LivestatusGroupByServiceGroup) {
/* _1 = row, _2 = groupByType, _3 = groupByObject */
Log(LogDebug, "Livestatus")
<< "Processing services group by servicegroup table.";
ServiceGroupsTable::AddColumns(table, "servicegroup_", boost::bind(&ServicesTable::ServiceGroupAccessor, _1, _2, _3));
ServiceGroupsTable::AddColumns(table, "servicegroup_", std::bind(&ServicesTable::ServiceGroupAccessor, _1, _2, _3));
} else if (table->GetGroupByType() == LivestatusGroupByHostGroup) {
/* _1 = row, _2 = groupByType, _3 = groupByObject */
Log(LogDebug, "Livestatus")
<< "Processing services group by hostgroup table.";
HostGroupsTable::AddColumns(table, "hostgroup_", boost::bind(&ServicesTable::HostGroupAccessor, _1, _2, _3));
HostGroupsTable::AddColumns(table, "hostgroup_", std::bind(&ServicesTable::HostGroupAccessor, _1, _2, _3));
}
}

View File

@ -240,8 +240,8 @@ void StateHistTable::AddColumns(Table *table, const String& prefix,
table->AddColumn(prefix + "duration_unmonitored", Column(&StateHistTable::DurationUnmonitoredAccessor, objectAccessor));
table->AddColumn(prefix + "duration_part_unmonitored", Column(&StateHistTable::DurationPartUnmonitoredAccessor, objectAccessor));
HostsTable::AddColumns(table, "current_host_", boost::bind(&StateHistTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "current_service_", boost::bind(&StateHistTable::ServiceAccessor, _1, objectAccessor));
HostsTable::AddColumns(table, "current_host_", std::bind(&StateHistTable::HostAccessor, _1, objectAccessor));
ServicesTable::AddColumns(table, "current_service_", std::bind(&StateHistTable::ServiceAccessor, _1, objectAccessor));
}
String StateHistTable::GetName(void) const

View File

@ -38,7 +38,6 @@
#include "base/dictionary.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/bind.hpp>
using namespace icinga;
@ -129,7 +128,7 @@ std::vector<LivestatusRowValue> Table::FilterRows(const Filter::Ptr& filter, int
{
std::vector<LivestatusRowValue> rs;
FetchRows(boost::bind(&Table::FilteredAddRow, this, boost::ref(rs), filter, limit, _1, _2, _3));
FetchRows(std::bind(&Table::FilteredAddRow, this, boost::ref(rs), filter, limit, _1, _2, _3));
return rs;
}

View File

@ -35,8 +35,7 @@ struct LivestatusRowValue {
Value GroupByObject;
};
typedef boost::function<bool (const Value&, LivestatusGroupByType, const Object::Ptr&)> AddRowFunction;
typedef std::function<bool (const Value&, LivestatusGroupByType, const Object::Ptr&)> AddRowFunction;
class Filter;

View File

@ -53,7 +53,7 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
resolvers, resolvedMacros, useResolvedMacros,
boost::bind(&PluginCheckTask::ProcessFinishedHandler, checkable, cr, _1, _2));
std::bind(&PluginCheckTask::ProcessFinishedHandler, checkable, cr, _1, _2));
if (!resolvedMacros || useResolvedMacros)
Checkable::IncreasePendingChecks();

View File

@ -51,7 +51,7 @@ void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable,
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
resolvers, resolvedMacros, useResolvedMacros,
boost::bind(&PluginEventTask::ProcessFinishedHandler, checkable, _1, _2));
std::bind(&PluginEventTask::ProcessFinishedHandler, checkable, _1, _2));
}
void PluginEventTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& commandLine, const ProcessResult& pr)

View File

@ -66,7 +66,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification,
PluginUtility::ExecuteCommand(commandObj, checkable, cr, resolvers,
resolvedMacros, useResolvedMacros,
boost::bind(&PluginNotificationTask::ProcessFinishedHandler, checkable, _1, _2));
std::bind(&PluginNotificationTask::ProcessFinishedHandler, checkable, _1, _2));
}
void PluginNotificationTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& commandLine, const ProcessResult& pr)

View File

@ -55,12 +55,12 @@ void NotificationComponent::Start(bool runtimeCreated)
Log(LogInformation, "NotificationComponent")
<< "'" << GetName() << "' started.";
Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
Checkable::OnNotificationsRequested.connect(std::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
_2, _3, _4, _5));
m_NotificationTimer = new Timer();
m_NotificationTimer->SetInterval(5);
m_NotificationTimer->OnTimerExpired.connect(boost::bind(&NotificationComponent::NotificationTimerHandler, this));
m_NotificationTimer->OnTimerExpired.connect(std::bind(&NotificationComponent::NotificationTimerHandler, this));
m_NotificationTimer->Start();
}

View File

@ -35,6 +35,7 @@
#include "base/exception.hpp"
#include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
using namespace icinga;
@ -83,19 +84,19 @@ void ElasticsearchWriter::Start(bool runtimeCreated)
Log(LogInformation, "ElasticsearchWriter")
<< "'" << GetName() << "' started.";
m_WorkQueue.SetExceptionCallback(boost::bind(&ElasticsearchWriter::ExceptionHandler, this, _1));
m_WorkQueue.SetExceptionCallback(std::bind(&ElasticsearchWriter::ExceptionHandler, this, _1));
/* Setup timer for periodically flushing m_DataBuffer */
m_FlushTimer = new Timer();
m_FlushTimer->SetInterval(GetFlushInterval());
m_FlushTimer->OnTimerExpired.connect(boost::bind(&ElasticsearchWriter::FlushTimeout, this));
m_FlushTimer->OnTimerExpired.connect(std::bind(&ElasticsearchWriter::FlushTimeout, this));
m_FlushTimer->Start();
m_FlushTimer->Reschedule(0);
/* Register for new metrics. */
Checkable::OnNewCheckResult.connect(boost::bind(&ElasticsearchWriter::CheckResultHandler, this, _1, _2));
Checkable::OnStateChange.connect(boost::bind(&ElasticsearchWriter::StateChangeHandler, this, _1, _2, _3));
Checkable::OnNotificationSentToAllUsers.connect(boost::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandler, this, _1, _2, _3, _4, _5, _6, _7));
Checkable::OnNewCheckResult.connect(std::bind(&ElasticsearchWriter::CheckResultHandler, this, _1, _2));
Checkable::OnStateChange.connect(std::bind(&ElasticsearchWriter::StateChangeHandler, this, _1, _2, _3));
Checkable::OnNotificationSentToAllUsers.connect(std::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandler, this, _1, _2, _3, _4, _5, _6, _7));
}
void ElasticsearchWriter::Stop(bool runtimeRemoved)
@ -175,7 +176,7 @@ void ElasticsearchWriter::AddCheckResult(const Dictionary::Ptr& fields, const Ch
void ElasticsearchWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
m_WorkQueue.Enqueue(boost::bind(&ElasticsearchWriter::InternalCheckResultHandler, this, checkable, cr));
m_WorkQueue.Enqueue(std::bind(&ElasticsearchWriter::InternalCheckResultHandler, this, checkable, cr));
}
void ElasticsearchWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
@ -229,7 +230,7 @@ void ElasticsearchWriter::InternalCheckResultHandler(const Checkable::Ptr& check
void ElasticsearchWriter::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
{
m_WorkQueue.Enqueue(boost::bind(&ElasticsearchWriter::StateChangeHandlerInternal, this, checkable, cr, type));
m_WorkQueue.Enqueue(std::bind(&ElasticsearchWriter::StateChangeHandlerInternal, this, checkable, cr, type));
}
void ElasticsearchWriter::StateChangeHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
@ -278,7 +279,7 @@ void ElasticsearchWriter::NotificationSentToAllUsersHandler(const Notification::
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
const CheckResult::Ptr& cr, const String& author, const String& text)
{
m_WorkQueue.Enqueue(boost::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandlerInternal, this,
m_WorkQueue.Enqueue(std::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandlerInternal, this,
notification, checkable, users, type, cr, author, text));
}

View File

@ -87,19 +87,19 @@ void GelfWriter::Start(bool runtimeCreated)
<< "'" << GetName() << "' started.";
/* Register exception handler for WQ tasks. */
m_WorkQueue.SetExceptionCallback(boost::bind(&GelfWriter::ExceptionHandler, this, _1));
m_WorkQueue.SetExceptionCallback(std::bind(&GelfWriter::ExceptionHandler, this, _1));
/* Timer for reconnecting */
m_ReconnectTimer = new Timer();
m_ReconnectTimer->SetInterval(10);
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&GelfWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&GelfWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
/* Register event handlers. */
Checkable::OnNewCheckResult.connect(boost::bind(&GelfWriter::CheckResultHandler, this, _1, _2));
Checkable::OnNotificationSentToUser.connect(boost::bind(&GelfWriter::NotificationToUserHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
Checkable::OnStateChange.connect(boost::bind(&GelfWriter::StateChangeHandler, this, _1, _2, _3));
Checkable::OnNewCheckResult.connect(std::bind(&GelfWriter::CheckResultHandler, this, _1, _2));
Checkable::OnNotificationSentToUser.connect(std::bind(&GelfWriter::NotificationToUserHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
Checkable::OnStateChange.connect(std::bind(&GelfWriter::StateChangeHandler, this, _1, _2, _3));
}
void GelfWriter::Stop(bool runtimeRemoved)
@ -167,7 +167,7 @@ void GelfWriter::Reconnect(void)
void GelfWriter::ReconnectTimerHandler(void)
{
m_WorkQueue.Enqueue(boost::bind(&GelfWriter::Reconnect, this), PriorityNormal);
m_WorkQueue.Enqueue(std::bind(&GelfWriter::Reconnect, this), PriorityNormal);
}
void GelfWriter::Disconnect(void)
@ -184,7 +184,7 @@ void GelfWriter::Disconnect(void)
void GelfWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
m_WorkQueue.Enqueue(boost::bind(&GelfWriter::CheckResultHandlerInternal, this, checkable, cr));
m_WorkQueue.Enqueue(std::bind(&GelfWriter::CheckResultHandlerInternal, this, checkable, cr));
}
void GelfWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
@ -284,7 +284,7 @@ void GelfWriter::NotificationToUserHandler(const Notification::Ptr& notification
const User::Ptr& user, NotificationType notificationType, CheckResult::Ptr const& cr,
const String& author, const String& commentText, const String& commandName)
{
m_WorkQueue.Enqueue(boost::bind(&GelfWriter::NotificationToUserHandlerInternal, this,
m_WorkQueue.Enqueue(std::bind(&GelfWriter::NotificationToUserHandlerInternal, this,
notification, checkable, user, notificationType, cr, author, commentText, commandName));
}
@ -349,7 +349,7 @@ void GelfWriter::NotificationToUserHandlerInternal(const Notification::Ptr& noti
void GelfWriter::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
{
m_WorkQueue.Enqueue(boost::bind(&GelfWriter::StateChangeHandlerInternal, this, checkable, cr, type));
m_WorkQueue.Enqueue(std::bind(&GelfWriter::StateChangeHandlerInternal, this, checkable, cr, type));
}
void GelfWriter::StateChangeHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)

View File

@ -86,17 +86,17 @@ void GraphiteWriter::Start(bool runtimeCreated)
<< "'" << GetName() << "' started.";
/* Register exception handler for WQ tasks. */
m_WorkQueue.SetExceptionCallback(boost::bind(&GraphiteWriter::ExceptionHandler, this, _1));
m_WorkQueue.SetExceptionCallback(std::bind(&GraphiteWriter::ExceptionHandler, this, _1));
/* Timer for reconnecting */
m_ReconnectTimer = new Timer();
m_ReconnectTimer->SetInterval(10);
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&GraphiteWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&GraphiteWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
/* Register event handlers. */
Checkable::OnNewCheckResult.connect(boost::bind(&GraphiteWriter::CheckResultHandler, this, _1, _2));
Checkable::OnNewCheckResult.connect(std::bind(&GraphiteWriter::CheckResultHandler, this, _1, _2));
}
void GraphiteWriter::Stop(bool runtimeRemoved)
@ -164,7 +164,7 @@ void GraphiteWriter::Reconnect(void)
void GraphiteWriter::ReconnectTimerHandler(void)
{
m_WorkQueue.Enqueue(boost::bind(&GraphiteWriter::Reconnect, this), PriorityNormal);
m_WorkQueue.Enqueue(std::bind(&GraphiteWriter::Reconnect, this), PriorityNormal);
}
void GraphiteWriter::Disconnect(void)
@ -181,7 +181,7 @@ void GraphiteWriter::Disconnect(void)
void GraphiteWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
m_WorkQueue.Enqueue(boost::bind(&GraphiteWriter::CheckResultHandlerInternal, this, checkable, cr));
m_WorkQueue.Enqueue(std::bind(&GraphiteWriter::CheckResultHandlerInternal, this, checkable, cr));
}
void GraphiteWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
@ -206,9 +206,9 @@ void GraphiteWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable,
String prefix;
if (service) {
prefix = MacroProcessor::ResolveMacros(GetServiceNameTemplate(), resolvers, cr, NULL, boost::bind(&GraphiteWriter::EscapeMacroMetric, _1));
prefix = MacroProcessor::ResolveMacros(GetServiceNameTemplate(), resolvers, cr, NULL, std::bind(&GraphiteWriter::EscapeMacroMetric, _1));
} else {
prefix = MacroProcessor::ResolveMacros(GetHostNameTemplate(), resolvers, cr, NULL, boost::bind(&GraphiteWriter::EscapeMacroMetric, _1));
prefix = MacroProcessor::ResolveMacros(GetHostNameTemplate(), resolvers, cr, NULL, std::bind(&GraphiteWriter::EscapeMacroMetric, _1));
}
String prefixPerfdata = prefix + ".perfdata";

View File

@ -96,17 +96,17 @@ void InfluxdbWriter::Start(bool runtimeCreated)
<< "'" << GetName() << "' started.";
/* Register exception handler for WQ tasks. */
m_WorkQueue.SetExceptionCallback(boost::bind(&InfluxdbWriter::ExceptionHandler, this, _1));
m_WorkQueue.SetExceptionCallback(std::bind(&InfluxdbWriter::ExceptionHandler, this, _1));
/* Setup timer for periodically flushing m_DataBuffer */
m_FlushTimer = new Timer();
m_FlushTimer->SetInterval(GetFlushInterval());
m_FlushTimer->OnTimerExpired.connect(boost::bind(&InfluxdbWriter::FlushTimeout, this));
m_FlushTimer->OnTimerExpired.connect(std::bind(&InfluxdbWriter::FlushTimeout, this));
m_FlushTimer->Start();
m_FlushTimer->Reschedule(0);
/* Register for new metrics. */
Service::OnNewCheckResult.connect(boost::bind(&InfluxdbWriter::CheckResultHandler, this, _1, _2));
Service::OnNewCheckResult.connect(std::bind(&InfluxdbWriter::CheckResultHandler, this, _1, _2));
}
void InfluxdbWriter::Stop(bool runtimeRemoved)
@ -176,7 +176,7 @@ Stream::Ptr InfluxdbWriter::Connect()
void InfluxdbWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
{
m_WorkQueue.Enqueue(boost::bind(&InfluxdbWriter::InternalCheckResultHandler, this, checkable, cr));
m_WorkQueue.Enqueue(std::bind(&InfluxdbWriter::InternalCheckResultHandler, this, checkable, cr));
}
void InfluxdbWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)

View File

@ -66,11 +66,11 @@ void OpenTsdbWriter::Start(bool runtimeCreated)
m_ReconnectTimer = new Timer();
m_ReconnectTimer->SetInterval(10);
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&OpenTsdbWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&OpenTsdbWriter::ReconnectTimerHandler, this));
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
Service::OnNewCheckResult.connect(boost::bind(&OpenTsdbWriter::CheckResultHandler, this, _1, _2));
Service::OnNewCheckResult.connect(std::bind(&OpenTsdbWriter::CheckResultHandler, this, _1, _2));
}
void OpenTsdbWriter::Stop(bool runtimeRemoved)

View File

@ -56,10 +56,10 @@ void PerfdataWriter::Start(bool runtimeCreated)
Log(LogInformation, "PerfdataWriter")
<< "'" << GetName() << "' started.";
Checkable::OnNewCheckResult.connect(boost::bind(&PerfdataWriter::CheckResultHandler, this, _1, _2));
Checkable::OnNewCheckResult.connect(std::bind(&PerfdataWriter::CheckResultHandler, this, _1, _2));
m_RotationTimer = new Timer();
m_RotationTimer->OnTimerExpired.connect(boost::bind(&PerfdataWriter::RotationTimerHandler, this));
m_RotationTimer->OnTimerExpired.connect(std::bind(&PerfdataWriter::RotationTimerHandler, this));
m_RotationTimer->SetInterval(GetRotationInterval());
m_RotationTimer->Start();

View File

@ -26,7 +26,6 @@
#include "base/dictionary.hpp"
#include "base/configobject.hpp"
#include <vector>
#include <boost/function.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
@ -44,7 +43,7 @@ class I2_REMOTE_API ApiAction : public Object
public:
DECLARE_PTR_TYPEDEFS(ApiAction);
typedef boost::function<Value(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)> Callback;
typedef std::function<Value(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)> Callback;
ApiAction(const std::vector<String>& registerTypes, const Callback& function);

View File

@ -51,7 +51,7 @@ void ApiClient::GetTypes(const TypesCompletionCallback& callback) const
req->RequestUrl = url;
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
req->AddHeader("Accept", "application/json");
m_Connection->SubmitRequest(req, boost::bind(TypesHttpCompletionCallback, _1, _2, callback));
m_Connection->SubmitRequest(req, std::bind(TypesHttpCompletionCallback, _1, _2, callback));
} catch (const std::exception& ex) {
callback(boost::current_exception(), std::vector<ApiType::Ptr>());
}
@ -141,7 +141,7 @@ void ApiClient::GetObjects(const String& pluralType, const ObjectsCompletionCall
req->RequestUrl = url;
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
req->AddHeader("Accept", "application/json");
m_Connection->SubmitRequest(req, boost::bind(ObjectsHttpCompletionCallback, _1, _2, callback));
m_Connection->SubmitRequest(req, std::bind(ObjectsHttpCompletionCallback, _1, _2, callback));
} catch (const std::exception& ex) {
callback(boost::current_exception(), std::vector<ApiObject::Ptr>());
}
@ -255,7 +255,7 @@ void ApiClient::ExecuteScript(const String& session, const String& command, bool
req->RequestUrl = url;
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
req->AddHeader("Accept", "application/json");
m_Connection->SubmitRequest(req, boost::bind(ExecuteScriptHttpCompletionCallback, _1, _2, callback));
m_Connection->SubmitRequest(req, std::bind(ExecuteScriptHttpCompletionCallback, _1, _2, callback));
} catch (const std::exception& ex) {
callback(boost::current_exception(), Empty);
}
@ -339,7 +339,7 @@ void ApiClient::AutocompleteScript(const String& session, const String& command,
req->RequestUrl = url;
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
req->AddHeader("Accept", "application/json");
m_Connection->SubmitRequest(req, boost::bind(AutocompleteScriptHttpCompletionCallback, _1, _2, callback));
m_Connection->SubmitRequest(req, std::bind(AutocompleteScriptHttpCompletionCallback, _1, _2, callback));
} catch (const std::exception& ex) {
callback(boost::current_exception(), Array::Ptr());
}

View File

@ -92,20 +92,20 @@ public:
ApiClient(const String& host, const String& port,
const String& user, const String& password);
typedef boost::function<void(boost::exception_ptr, const std::vector<ApiType::Ptr>&)> TypesCompletionCallback;
typedef std::function<void(boost::exception_ptr, const std::vector<ApiType::Ptr>&)> TypesCompletionCallback;
void GetTypes(const TypesCompletionCallback& callback) const;
typedef boost::function<void(boost::exception_ptr, const std::vector<ApiObject::Ptr>&)> ObjectsCompletionCallback;
typedef std::function<void(boost::exception_ptr, const std::vector<ApiObject::Ptr>&)> ObjectsCompletionCallback;
void GetObjects(const String& pluralType, const ObjectsCompletionCallback& callback,
const std::vector<String>& names = std::vector<String>(),
const std::vector<String>& attrs = std::vector<String>(),
const std::vector<String>& joins = std::vector<String>(), bool all_joins = false) const;
typedef boost::function<void(boost::exception_ptr, const Value&)> ExecuteScriptCompletionCallback;
typedef std::function<void(boost::exception_ptr, const Value&)> ExecuteScriptCompletionCallback;
void ExecuteScript(const String& session, const String& command, bool sandboxed,
const ExecuteScriptCompletionCallback& callback) const;
typedef boost::function<void(boost::exception_ptr, const Array::Ptr&)> AutocompleteScriptCompletionCallback;
typedef std::function<void(boost::exception_ptr, const Array::Ptr&)> AutocompleteScriptCompletionCallback;
void AutocompleteScript(const String& session, const String& command, bool sandboxed,
const AutocompleteScriptCompletionCallback& callback) const;

View File

@ -26,7 +26,6 @@
#include "base/value.hpp"
#include "base/dictionary.hpp"
#include <vector>
#include <boost/function.hpp>
namespace icinga
{
@ -41,7 +40,7 @@ class I2_REMOTE_API ApiFunction : public Object
public:
DECLARE_PTR_TYPEDEFS(ApiFunction);
typedef boost::function<Value(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&)> Callback;
typedef std::function<Value(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&)> Callback;
ApiFunction(const Callback& function);

View File

@ -72,7 +72,7 @@ ConfigDirInformation ApiListener::LoadConfigDir(const String& dir)
ConfigDirInformation config;
config.UpdateV1 = new Dictionary();
config.UpdateV2 = new Dictionary();
Utility::GlobRecursive(dir, "*", boost::bind(&ApiListener::ConfigGlobHandler, boost::ref(config), dir, _1), GlobFile);
Utility::GlobRecursive(dir, "*", std::bind(&ApiListener::ConfigGlobHandler, boost::ref(config), dir, _1), GlobFile);
return config;
}

View File

@ -233,24 +233,24 @@ void ApiListener::Start(bool runtimeCreated)
}
m_Timer = new Timer();
m_Timer->OnTimerExpired.connect(boost::bind(&ApiListener::ApiTimerHandler, this));
m_Timer->OnTimerExpired.connect(std::bind(&ApiListener::ApiTimerHandler, this));
m_Timer->SetInterval(5);
m_Timer->Start();
m_Timer->Reschedule(0);
m_ReconnectTimer = new Timer();
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&ApiListener::ApiReconnectTimerHandler, this));
m_ReconnectTimer->OnTimerExpired.connect(std::bind(&ApiListener::ApiReconnectTimerHandler, this));
m_ReconnectTimer->SetInterval(60);
m_ReconnectTimer->Start();
m_ReconnectTimer->Reschedule(0);
m_AuthorityTimer = new Timer();
m_AuthorityTimer->OnTimerExpired.connect(boost::bind(&ApiListener::UpdateObjectAuthority));
m_AuthorityTimer->OnTimerExpired.connect(std::bind(&ApiListener::UpdateObjectAuthority));
m_AuthorityTimer->SetInterval(30);
m_AuthorityTimer->Start();
m_CleanupCertificateRequestsTimer = new Timer();
m_CleanupCertificateRequestsTimer->OnTimerExpired.connect(boost::bind(&ApiListener::CleanupCertificateRequestsTimerHandler, this));
m_CleanupCertificateRequestsTimer->OnTimerExpired.connect(std::bind(&ApiListener::CleanupCertificateRequestsTimerHandler, this));
m_CleanupCertificateRequestsTimer->SetInterval(3600);
m_CleanupCertificateRequestsTimer->Start();
m_CleanupCertificateRequestsTimer->Reschedule(0);
@ -332,7 +332,7 @@ bool ApiListener::AddListener(const String& node, const String& service)
return false;
}
boost::thread thread(boost::bind(&ApiListener::ListenerThreadProc, this, server));
boost::thread thread(std::bind(&ApiListener::ListenerThreadProc, this, server));
thread.detach();
m_Servers.insert(server);
@ -349,7 +349,7 @@ void ApiListener::ListenerThreadProc(const Socket::Ptr& server)
for (;;) {
try {
Socket::Ptr client = server->Accept();
boost::thread thread(boost::bind(&ApiListener::NewClientHandler, this, client, String(), RoleServer));
boost::thread thread(std::bind(&ApiListener::NewClientHandler, this, client, String(), RoleServer));
thread.detach();
} catch (const std::exception&) {
Log(LogCritical, "ApiListener", "Cannot accept new connection.");
@ -539,7 +539,7 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
endpoint->AddClient(aclient);
m_SyncQueue.Enqueue(boost::bind(&ApiListener::SyncClient, this, aclient, endpoint, needSync));
m_SyncQueue.Enqueue(std::bind(&ApiListener::SyncClient, this, aclient, endpoint, needSync));
} else
AddAnonymousClient(aclient);
} else {
@ -571,7 +571,7 @@ void ApiListener::SyncClient(const JsonRpcConnection::Ptr& aclient, const Endpoi
JsonRpcConnection::SendCertificateRequest(aclient, MessageOrigin::Ptr(), String());
if (Utility::PathExists(ApiListener::GetCertificateRequestsDir()))
Utility::Glob(ApiListener::GetCertificateRequestsDir() + "/*.json", boost::bind(&JsonRpcConnection::SendCertificateRequest, aclient, MessageOrigin::Ptr(), _1), GlobFile);
Utility::Glob(ApiListener::GetCertificateRequestsDir() + "/*.json", std::bind(&JsonRpcConnection::SendCertificateRequest, aclient, MessageOrigin::Ptr(), _1), GlobFile);
}
/* Make sure that the config updates are synced
@ -631,7 +631,7 @@ void ApiListener::ApiTimerHandler(void)
double now = Utility::GetTime();
std::vector<int> files;
Utility::Glob(GetApiDir() + "log/*", boost::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
std::sort(files.begin(), files.end());
for (int ts : files) {
@ -744,7 +744,7 @@ void ApiListener::ApiReconnectTimerHandler(void)
continue;
}
boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
boost::thread thread(std::bind(&ApiListener::AddConnection, this, endpoint));
thread.detach();
}
}
@ -787,7 +787,7 @@ void ApiListener::CleanupCertificateRequestsTimerHandler(void)
if (Utility::PathExists(requestsDir)) {
/* remove certificate requests that are older than a week */
double expiryTime = Utility::GetTime() - 7 * 24 * 60 * 60;
Utility::Glob(requestsDir + "/*.json", boost::bind(&CleanupCertificateRequest, _1, expiryTime), GlobFile);
Utility::Glob(requestsDir + "/*.json", std::bind(&CleanupCertificateRequest, _1, expiryTime), GlobFile);
}
}
@ -797,7 +797,7 @@ void ApiListener::RelayMessage(const MessageOrigin::Ptr& origin,
if (!IsActive())
return;
m_RelayQueue.Enqueue(boost::bind(&ApiListener::SyncRelayMessage, this, origin, secobj, message, log), PriorityNormal, true);
m_RelayQueue.Enqueue(std::bind(&ApiListener::SyncRelayMessage, this, origin, secobj, message, log), PriorityNormal, true);
}
void ApiListener::PersistMessage(const Dictionary::Ptr& message, const ConfigObject::Ptr& secobj)
@ -1090,7 +1090,7 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
count = 0;
std::vector<int> files;
Utility::Glob(GetApiDir() + "log/*", boost::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
std::sort(files.begin(), files.end());
for (int ts : files) {

View File

@ -59,7 +59,7 @@ void ConfigPackageUtility::DeletePackage(const String& name)
std::vector<String> ConfigPackageUtility::GetPackages(void)
{
std::vector<String> packages;
Utility::Glob(GetPackageDir() + "/*", boost::bind(&ConfigPackageUtility::CollectDirNames,
Utility::Glob(GetPackageDir() + "/*", std::bind(&ConfigPackageUtility::CollectDirNames,
_1, boost::ref(packages)), GlobDirectory);
return packages;
}
@ -218,7 +218,7 @@ void ConfigPackageUtility::AsyncTryActivateStage(const String& packageName, cons
Process::Ptr process = new Process(Process::PrepareCommand(args));
process->SetTimeout(300);
process->Run(boost::bind(&TryActivateStageCallback, _1, packageName, stageName, reload));
process->Run(std::bind(&TryActivateStageCallback, _1, packageName, stageName, reload));
}
void ConfigPackageUtility::DeleteStage(const String& packageName, const String& stageName)
@ -237,7 +237,7 @@ void ConfigPackageUtility::DeleteStage(const String& packageName, const String&
std::vector<String> ConfigPackageUtility::GetStages(const String& packageName)
{
std::vector<String> stages;
Utility::Glob(GetPackageDir() + "/" + packageName + "/*", boost::bind(&ConfigPackageUtility::CollectDirNames, _1, boost::ref(stages)), GlobDirectory);
Utility::Glob(GetPackageDir() + "/" + packageName + "/*", std::bind(&ConfigPackageUtility::CollectDirNames, _1, boost::ref(stages)), GlobDirectory);
return stages;
}
@ -263,7 +263,7 @@ String ConfigPackageUtility::GetActiveStage(const String& packageName)
std::vector<std::pair<String, bool> > ConfigPackageUtility::GetFiles(const String& packageName, const String& stageName)
{
std::vector<std::pair<String, bool> > paths;
Utility::GlobRecursive(GetPackageDir() + "/" + packageName + "/" + stageName, "*", boost::bind(&ConfigPackageUtility::CollectPaths, _1, boost::ref(paths)), GlobDirectory | GlobFile);
Utility::GlobRecursive(GetPackageDir() + "/" + packageName + "/" + stageName, "*", std::bind(&ConfigPackageUtility::CollectPaths, _1, boost::ref(paths)), GlobDirectory | GlobFile);
return paths;
}

View File

@ -59,7 +59,7 @@ static void ScriptFrameCleanupHandler(void)
INITIALIZE_ONCE([]() {
l_FrameCleanupTimer = new Timer();
l_FrameCleanupTimer->OnTimerExpired.connect(boost::bind(ScriptFrameCleanupHandler));
l_FrameCleanupTimer->OnTimerExpired.connect(std::bind(ScriptFrameCleanupHandler));
l_FrameCleanupTimer->SetInterval(30);
l_FrameCleanupTimer->Start();
});

View File

@ -44,7 +44,7 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
return Type::Ptr();
}
void ConfigObjectTargetProvider::FindTargets(const String& type, const boost::function<void (const Value&)>& addTarget) const
void ConfigObjectTargetProvider::FindTargets(const String& type, const std::function<void (const Value&)>& addTarget) const
{
Type::Ptr ptype = Type::GetByName(type);
ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
@ -268,7 +268,7 @@ std::vector<Value> FilterUtility::GetFilterTargets(const QueryDescription& qd, c
frame.Self = uvars;
try {
provider->FindTargets(type, boost::bind(&FilteredAddTarget,
provider->FindTargets(type, std::bind(&FilteredAddTarget,
boost::ref(permissionFrame), permissionFilter,
boost::ref(frame), ufilter, boost::ref(result), variableName, _1));
} catch (const std::exception& ex) {

View File

@ -35,7 +35,7 @@ class TargetProvider : public Object
public:
DECLARE_PTR_TYPEDEFS(TargetProvider);
virtual void FindTargets(const String& type, const boost::function<void (const Value&)>& addTarget) const = 0;
virtual void FindTargets(const String& type, const std::function<void (const Value&)>& addTarget) const = 0;
virtual Value GetTargetByName(const String& type, const String& name) const = 0;
virtual bool IsValidType(const String& type) const = 0;
virtual String GetPluralName(const String& type) const = 0;
@ -46,7 +46,7 @@ class ConfigObjectTargetProvider : public TargetProvider
public:
DECLARE_PTR_TYPEDEFS(ConfigObjectTargetProvider);
virtual void FindTargets(const String& type, const boost::function<void (const Value&)>& addTarget) const override;
virtual void FindTargets(const String& type, const std::function<void (const Value&)>& addTarget) const override;
virtual Value GetTargetByName(const String& type, const String& name) const override;
virtual bool IsValidType(const String& type) const override;
virtual String GetPluralName(const String& type) const override;

View File

@ -63,7 +63,7 @@ void HttpClientConnection::Reconnect(void)
-- does not currently work because the NetworkStream class doesn't support async I/O */
/* the stream holds an owning reference to this object through the callback we're registering here */
m_Stream->RegisterDataHandler(boost::bind(&HttpClientConnection::DataAvailableHandler, HttpClientConnection::Ptr(this), _1));
m_Stream->RegisterDataHandler(std::bind(&HttpClientConnection::DataAvailableHandler, HttpClientConnection::Ptr(this), _1));
if (m_Stream->IsDataAvailable())
DataAvailableHandler(m_Stream);
}

View File

@ -52,7 +52,7 @@ public:
boost::shared_ptr<HttpRequest> NewRequest(void);
typedef boost::function<void(HttpRequest&, HttpResponse&)> HttpCompletionCallback;
typedef std::function<void(HttpRequest&, HttpResponse&)> HttpCompletionCallback;
void SubmitRequest(const boost::shared_ptr<HttpRequest>& request, const HttpCompletionCallback& callback);
private:

Some files were not shown because too many files have changed in this diff Show More