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);
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;
}
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);
}
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;
}
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);
}
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;
}
{
l_Restarting = false;
- boost::thread t(boost::bind(&ReloadProcessCallbackInternal, pr));
+ boost::thread t(std::bind(&ReloadProcessCallbackInternal, pr));
t.detach();
}
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;
if (srs != StatusNewItem)
continue;
- upq.Enqueue(boost::bind(&ConfigObject::RestoreObject, message, attributeTypes));
+ upq.Enqueue(std::bind(&ConfigObject::RestoreObject, message, attributeTypes));
restored++;
}
}
}
-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());
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);
ReopenLogFile();
- Application::OnReopenLogs.connect(boost::bind(&FileLogger::ReopenLogFile, this));
+ Application::OnReopenLogs.connect(std::bind(&FileLogger::ReopenLogFile, this));
}
void FileLogger::ReopenLogFile(void)
#include "base/functionwrapper.hpp"
#include "base/scriptglobal.hpp"
#include <vector>
-#include <boost/function.hpp>
namespace icinga
{
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);
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);
}
#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
{
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>&)
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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>
}
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);
}
}
# define unlikely(x) (x)
#endif
+#define BOOST_BIND_NO_PLACEHOLDERS
+
+#include <functional>
+
+using namespace std::placeholders;
#endif /* I2BASE_H */
}
}
-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>());
#include "base/i2-base.hpp"
#include "base/string.hpp"
#include <boost/thread/tss.hpp>
-#include <boost/function.hpp>
#include <queue>
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)
{ }
}
private:
- boost::function<void (void)> m_Callback;
+ std::function<void (void)> m_Callback;
int m_Priority;
};
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:
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 */
{
/* 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();
}
}
}
#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);
delete [] args;
if (callback)
- Utility::QueueAsyncCallback(boost::bind(callback, m_Result));
+ Utility::QueueAsyncCallback(std::bind(callback, m_Result));
return;
}
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;
}
#include "base/i2-base.hpp"
#include "base/dictionary.hpp"
-#include <boost/function.hpp>
#include <sstream>
#include <deque>
#include <vector>
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;
#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);
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);
}
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);
}
InitializeThread(tid);
- m_Threads[tid] = boost::thread(boost::bind(&SocketEventEngine::ThreadProc, this, tid));
+ m_Threads[tid] = boost::thread(std::bind(&SocketEventEngine::ThreadProc, this, tid));
}
}
#include "base/value.hpp"
#include "base/dictionary.hpp"
#include "base/array.hpp"
-#include <boost/function.hpp>
namespace icinga
{
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);
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);
/* 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)
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);
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();
}
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)
#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>
lock.unlock();
/* Asynchronously call the timer. */
- Utility::QueueAsyncCallback(boost::bind(&Timer::Call, ptimer));
+ Utility::QueueAsyncCallback(std::bind(&Timer::Call, ptimer));
}
}
#include "base/utility.hpp"
#include "base/exception.hpp"
#include "base/logger.hpp"
-#include <boost/bind.hpp>
#include <iostream>
#ifndef _WIN32
#include "base/string.hpp"
#include "base/object.hpp"
#include "base/initialize.hpp"
-#include <boost/function.hpp>
#include <vector>
namespace icinga
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:
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)
#include <ios>
#include <fstream>
#include <iostream>
+#include <future>
#ifdef __FreeBSD__
# include <pthread_np.h>
* @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;
* @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;
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. */
#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>
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);
#include "base/convert.hpp"
#include "base/application.hpp"
#include "base/exception.hpp"
-#include <boost/bind.hpp>
#include <boost/thread/tss.hpp>
using namespace icinga;
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();
}
* 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();
<< "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;
#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>
: 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;
};
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);
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);
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)
<< "'" << 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();
}
Checkable::IncreasePendingChecks();
- Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
+ Utility::QueueAsyncCallback(std::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
lock.lock();
}
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)));
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)));
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;
}
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;
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;
* 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;
/* 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;
/* 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());
/* 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;
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
#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 */
{
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
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);
<< "'" << 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 */
}
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));
}
/**
#include "config/i2-config.hpp"
#include "config/expression.hpp"
#include "base/debuginfo.hpp"
-#include <boost/function.hpp>
namespace icinga
{
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));
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();
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);
}
/**
}
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);
}
#include "base/registry.hpp"
#include "base/initialize.hpp"
#include "base/singleton.hpp"
-#include <boost/function.hpp>
#include <iostream>
#include <stack>
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();
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();
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);
}
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)
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;
}
}
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();
}
{
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();
}
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));
-
- 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::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::OnReachabilityChanged.connect(boost::bind(&DbEvents::ReachabilityChangedHandler, _1, _2, _3));
+ 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(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(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(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 */
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)
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;
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)
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);
<< "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();
}
<< "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)
<< "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)
<< "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)
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();
<< "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)
<< "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)
<< "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)
<< "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)
<< 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;
}
}
<< 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;
}
<< 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;
}
<< 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;
}
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)
<< "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;
}
<< 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)
typedef boost::shared_ptr<MYSQL_RES> IdoMysqlResult;
-typedef boost::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
+typedef std::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
struct IdoAsyncQuery
{
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);
DbConnection::Pause();
- m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
+ m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
m_QueryQueue.Join();
}
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)
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)
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)
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)
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)
{
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)
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)
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;
}
}
/* 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;
}
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;
}
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;
}
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)
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();
}
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)
{
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();
}
{
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();
}
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
{
#include "icinga/i2-icinga.hpp"
#include "icinga/command.hpp"
#include "base/string.hpp"
-#include <boost/function.hpp>
#include <boost/signals2.hpp>
#include <vector>
/* 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();
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 = ");
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)));
#include "icinga/i2-icinga.hpp"
#include "icinga/checkable.hpp"
#include "base/value.hpp"
-#include <boost/function.hpp>
#include <vector>
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;
<< "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);
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();
process->SetAdjustPriority(true);
- process->Run(boost::bind(callback, command, _1));
+ process->Run(std::bind(callback, command, _1));
}
ServiceState PluginUtility::ExitStatusToState(int exitStatus)
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);
{
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();
}
{
ObjectImpl<ScheduledDowntime>::Start(runtimeCreated);
- Utility::QueueAsyncCallback(boost::bind(&ScheduledDowntime::CreateNextDowntime, this));
+ Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
}
void ScheduledDowntime::TimerProc(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();
}
{
Value row;
- if (!m_ObjectAccessor.empty())
+ if (m_ObjectAccessor)
row = m_ObjectAccessor(urow, groupByType, groupByObject);
else
row = urow;
#include "livestatus/i2-livestatus.hpp"
#include "base/value.hpp"
-#include <boost/function.hpp>
using namespace icinga;
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);
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
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
/* _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));
}
}
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() << "'.";
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() << "'.";
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())
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)
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
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));
}
}
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
#include "base/dictionary.hpp"
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/tuple/tuple.hpp>
-#include <boost/bind.hpp>
using namespace icinga;
{
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;
}
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;
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();
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)
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)
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();
}
#include "base/exception.hpp"
#include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp>
+#include <boost/scoped_array.hpp>
using namespace icinga;
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)
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)
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)
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));
}
<< "'" << 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)
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)
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)
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));
}
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)
<< "'" << 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)
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)
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)
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";
<< "'" << 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)
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)
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)
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();
#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>
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);
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>());
}
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>());
}
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);
}
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());
}
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;
#include "base/value.hpp"
#include "base/dictionary.hpp"
#include <vector>
-#include <boost/function.hpp>
namespace icinga
{
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);
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;
}
}
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);
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);
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.");
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 {
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
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) {
continue;
}
- boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
+ boost::thread thread(std::bind(&ApiListener::AddConnection, this, endpoint));
thread.detach();
}
}
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);
}
}
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)
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) {
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;
}
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)
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;
}
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;
}
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();
});
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());
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) {
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;
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;
-- 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);
}
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:
#include "remote/apiuser.hpp"
#include "base/registry.hpp"
#include <vector>
-#include <boost/function.hpp>
namespace icinga
{
void HttpServerConnection::StaticInitialize(void)
{
l_HttpServerConnectionTimeoutTimer = new Timer();
- l_HttpServerConnectionTimeoutTimer->OnTimerExpired.connect(boost::bind(&HttpServerConnection::TimeoutTimerHandler));
+ l_HttpServerConnectionTimeoutTimer->OnTimerExpired.connect(std::bind(&HttpServerConnection::TimeoutTimerHandler));
l_HttpServerConnectionTimeoutTimer->SetInterval(15);
l_HttpServerConnectionTimeoutTimer->Start();
}
void HttpServerConnection::Start(void)
{
/* the stream holds an owning reference to this object through the callback we're registering here */
- m_Stream->RegisterDataHandler(boost::bind(&HttpServerConnection::DataAvailableHandler, HttpServerConnection::Ptr(this)));
+ m_Stream->RegisterDataHandler(std::bind(&HttpServerConnection::DataAvailableHandler, HttpServerConnection::Ptr(this)));
if (m_Stream->IsDataAvailable())
DataAvailableHandler();
}
}
if (m_CurrentRequest.Complete) {
- m_RequestQueue.Enqueue(boost::bind(&HttpServerConnection::ProcessMessageAsync,
+ m_RequestQueue.Enqueue(std::bind(&HttpServerConnection::ProcessMessageAsync,
HttpServerConnection::Ptr(this), m_CurrentRequest));
m_Seen = Utility::GetTime();
INITIALIZE_ONCE([]() {
l_HeartbeatTimer = new Timer();
- l_HeartbeatTimer->OnTimerExpired.connect(boost::bind(&JsonRpcConnection::HeartbeatTimerHandler));
+ l_HeartbeatTimer->OnTimerExpired.connect(std::bind(&JsonRpcConnection::HeartbeatTimerHandler));
l_HeartbeatTimer->SetInterval(10);
l_HeartbeatTimer->Start();
});
void JsonRpcConnection::StaticInitialize(void)
{
l_JsonRpcConnectionTimeoutTimer = new Timer();
- l_JsonRpcConnectionTimeoutTimer->OnTimerExpired.connect(boost::bind(&JsonRpcConnection::TimeoutTimerHandler));
+ l_JsonRpcConnectionTimeoutTimer->OnTimerExpired.connect(std::bind(&JsonRpcConnection::TimeoutTimerHandler));
l_JsonRpcConnectionTimeoutTimer->SetInterval(15);
l_JsonRpcConnectionTimeoutTimer->Start();
void JsonRpcConnection::Start(void)
{
/* the stream holds an owning reference to this object through the callback we're registering here */
- m_Stream->RegisterDataHandler(boost::bind(&JsonRpcConnection::DataAvailableHandler, JsonRpcConnection::Ptr(this)));
+ m_Stream->RegisterDataHandler(std::bind(&JsonRpcConnection::DataAvailableHandler, JsonRpcConnection::Ptr(this)));
if (m_Stream->IsDataAvailable())
DataAvailableHandler();
}
if (srs != StatusNewItem)
return false;
- l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(boost::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
+ l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(std::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
return true;
}
String requestDir = ApiListener::GetCertificateRequestsDir();
if (Utility::PathExists(requestDir))
- Utility::Glob(requestDir + "/*.json", boost::bind(&CollectRequestHandler, requests, _1), GlobFile);
+ Utility::Glob(requestDir + "/*.json", std::bind(&CollectRequestHandler, requests, _1), GlobFile);
return requests;
}
DECLARE_PTR_TYPEDEFS(StatusTargetProvider);
virtual void FindTargets(const String& type,
- const boost::function<void (const Value&)>& addTarget) const override
+ const std::function<void (const Value&)>& addTarget) const override
{
typedef std::pair<String, StatsFunction::Ptr> kv_pair;
for (const kv_pair& kv : StatsFunctionRegistry::GetInstance()->GetItems()) {
}
virtual void FindTargets(const String& type,
- const boost::function<void (const Value&)>& addTarget) const override
+ const std::function<void (const Value&)>& addTarget) const override
{
Type::Ptr ptype = Type::GetByName(type);
DECLARE_PTR_TYPEDEFS(TypeTargetProvider);
virtual void FindTargets(const String& type,
- const boost::function<void (const Value&)>& addTarget) const override
+ const std::function<void (const Value&)>& addTarget) const override
{
for (const Type::Ptr& target : Type::GetAllTypes()) {
addTarget(target);
}
virtual void FindTargets(const String& type,
- const boost::function<void (const Value&)>& addTarget) const override
+ const std::function<void (const Value&)>& addTarget) const override
{
{
Dictionary::Ptr globals = ScriptGlobal::GetGlobals();
BOOST_FOREACH(const std::wstring wsDriveName, vExclude_Drives)
{
vDrives.erase(std::remove_if(vDrives.begin(), vDrives.end(),
- boost::bind(checkName, _1, wsDriveName + L'\\')), vDrives.end());
+ std::bind(checkName, _1, wsDriveName + L'\\')), vDrives.end());
}
}
return -1;
// Submits the request. The 'ResultHttpCompletionCallback' is called once the HttpRequest receives an answer,
// which then sets 'ready' to true
- m_Connection->SubmitRequest(req, boost::bind(ResultHttpCompletionCallback, _1, _2,
+ m_Connection->SubmitRequest(req, std::bind(ResultHttpCompletionCallback, _1, _2,
boost::ref(ready), boost::ref(cv), boost::ref(mtx), boost::ref(result)));
// We need to spinlock here because our 'HttpRequest' works asynchronous
{
int counter;
Timer::Ptr timer = new Timer();
- timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
+ timer->OnTimerExpired.connect(std::bind(&Callback, &counter));
timer->SetInterval(1);
counter = 0;
{
int counter;
Timer::Ptr timer = new Timer();
- timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
+ timer->OnTimerExpired.connect(std::bind(&Callback, &counter));
timer->SetInterval(1);
counter = 0;
BOOST_AUTO_TEST_CASE(host_1attempt)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Host::Ptr host = new Host();
host->SetMaxCheckAttempts(1);
BOOST_AUTO_TEST_CASE(host_2attempts)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Host::Ptr host = new Host();
host->SetMaxCheckAttempts(2);
BOOST_AUTO_TEST_CASE(host_3attempts)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Host::Ptr host = new Host();
host->SetMaxCheckAttempts(3);
BOOST_AUTO_TEST_CASE(service_1attempt)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Service::Ptr service = new Service();
service->SetMaxCheckAttempts(1);
BOOST_AUTO_TEST_CASE(service_2attempts)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Service::Ptr service = new Service();
service->SetMaxCheckAttempts(2);
BOOST_AUTO_TEST_CASE(service_3attempts)
{
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
Service::Ptr service = new Service();
service->SetMaxCheckAttempts(3);
#ifndef I2_DEBUG
BOOST_WARN_MESSAGE(false, "This test can only be run in a debug build!");
#else /* I2_DEBUG */
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
int timeStepInterval = 60;
#ifndef I2_DEBUG
BOOST_WARN_MESSAGE(false, "This test can only be run in a debug build!");
#else /* I2_DEBUG */
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
int timeStepInterval = 60;
#ifndef I2_DEBUG
BOOST_WARN_MESSAGE(false, "This test can only be run in a debug build!");
#else /* I2_DEBUG */
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
int timeStepInterval = 60;
#ifndef I2_DEBUG
BOOST_WARN_MESSAGE(false, "This test can only be run in a debug build!");
#else /* I2_DEBUG */
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
int timeStepInterval = 60;
#ifndef I2_DEBUG
BOOST_WARN_MESSAGE(false, "This test can only be run in a debug build!");
#else /* I2_DEBUG */
- boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationHandler, _1, _2));
+ boost::signals2::connection c = Checkable::OnNotificationsRequested.connect(std::bind(&NotificationHandler, _1, _2));
int timeStepInterval = 60;