mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
Merge pull request #5803 from Icinga/feature/cxx11-std-bind
Replace boost::bind/boost::function with std::bind/std::function
This commit is contained in:
commit
f3c825cb86
@ -39,7 +39,7 @@ MainForm::MainForm(wxWindow *parent, const Url::Ptr& url)
|
|||||||
port = "5665";
|
port = "5665";
|
||||||
|
|
||||||
m_ApiClient = new ApiClient(url->GetHost(), port, url->GetUsername(), url->GetPassword());
|
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";
|
std::string title = url->Format() + " - Icinga Studio";
|
||||||
SetTitle(title);
|
SetTitle(title);
|
||||||
@ -52,7 +52,7 @@ MainForm::MainForm(wxWindow *parent, const Url::Ptr& url)
|
|||||||
void MainForm::TypesCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiType::Ptr>& types, bool forward)
|
void MainForm::TypesCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiType::Ptr>& types, bool forward)
|
||||||
{
|
{
|
||||||
if (forward) {
|
if (forward) {
|
||||||
CallAfter(boost::bind(&MainForm::TypesCompletionHandler, this, eptr, types, false));
|
CallAfter(std::bind(&MainForm::TypesCompletionHandler, this, eptr, types, false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ void MainForm::OnTypeSelected(wxTreeEvent& event)
|
|||||||
std::vector<String> attrs;
|
std::vector<String> attrs;
|
||||||
attrs.push_back("__name");
|
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);
|
std::vector<String>(), attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ static bool ApiObjectLessComparer(const ApiObject::Ptr& o1, const ApiObject::Ptr
|
|||||||
void MainForm::ObjectsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
|
void MainForm::ObjectsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
|
||||||
{
|
{
|
||||||
if (forward) {
|
if (forward) {
|
||||||
CallAfter(boost::bind(&MainForm::ObjectsCompletionHandler, this, eptr, objects, false));
|
CallAfter(std::bind(&MainForm::ObjectsCompletionHandler, this, eptr, objects, false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ void MainForm::OnObjectSelected(wxListEvent& event)
|
|||||||
std::vector<String> names;
|
std::vector<String> names;
|
||||||
names.push_back(objectName);
|
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);
|
names, std::vector<String>(), std::vector<String>(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ wxPGProperty *MainForm::ValueToProperty(const String& name, const Value& value)
|
|||||||
void MainForm::ObjectDetailsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
|
void MainForm::ObjectDetailsCompletionHandler(boost::exception_ptr eptr, const std::vector<ApiObject::Ptr>& objects, bool forward)
|
||||||
{
|
{
|
||||||
if (forward) {
|
if (forward) {
|
||||||
CallAfter(boost::bind(&MainForm::ObjectDetailsCompletionHandler, this, eptr, objects, false));
|
CallAfter(std::bind(&MainForm::ObjectDetailsCompletionHandler, this, eptr, objects, false));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ static void ReloadProcessCallback(const ProcessResult& pr)
|
|||||||
{
|
{
|
||||||
l_Restarting = false;
|
l_Restarting = false;
|
||||||
|
|
||||||
boost::thread t(boost::bind(&ReloadProcessCallbackInternal, pr));
|
boost::thread t(std::bind(&ReloadProcessCallbackInternal, pr));
|
||||||
t.detach();
|
t.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ static Array::Ptr ArraySort(const std::vector<Value>& args)
|
|||||||
BOOST_THROW_EXCEPTION(ScriptError("Sort function must be side-effect free."));
|
BOOST_THROW_EXCEPTION(ScriptError("Sort function must be side-effect free."));
|
||||||
|
|
||||||
ObjectLock olock(arr);
|
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;
|
return arr;
|
||||||
|
@ -594,7 +594,7 @@ void ConfigObject::RestoreObjects(const String& filename, int attributeTypes)
|
|||||||
if (srs != StatusNewItem)
|
if (srs != StatusNewItem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
upq.Enqueue(boost::bind(&ConfigObject::RestoreObject, message, attributeTypes));
|
upq.Enqueue(std::bind(&ConfigObject::RestoreObject, message, attributeTypes));
|
||||||
restored++;
|
restored++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ void ConfigObject::StopObjects(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigObject::DumpModifiedAttributes(const boost::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
|
void ConfigObject::DumpModifiedAttributes(const std::function<void(const ConfigObject::Ptr&, const String&, const Value&)>& callback)
|
||||||
{
|
{
|
||||||
for (const Type::Ptr& type : Type::GetAllTypes()) {
|
for (const Type::Ptr& type : Type::GetAllTypes()) {
|
||||||
ConfigType *dtype = dynamic_cast<ConfigType *>(type.get());
|
ConfigType *dtype = dynamic_cast<ConfigType *>(type.get());
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
static void RestoreObjects(const String& filename, int attributeTypes = FAState);
|
static void RestoreObjects(const String& filename, int attributeTypes = FAState);
|
||||||
static void StopObjects(void);
|
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);
|
static Object::Ptr GetPrototype(void);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ void FileLogger::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
ReopenLogFile();
|
ReopenLogFile();
|
||||||
|
|
||||||
Application::OnReopenLogs.connect(boost::bind(&FileLogger::ReopenLogFile, this));
|
Application::OnReopenLogs.connect(std::bind(&FileLogger::ReopenLogFile, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileLogger::ReopenLogFile(void)
|
void FileLogger::ReopenLogFile(void)
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "base/functionwrapper.hpp"
|
#include "base/functionwrapper.hpp"
|
||||||
#include "base/scriptglobal.hpp"
|
#include "base/scriptglobal.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -41,7 +40,7 @@ class I2_BASE_API Function : public ObjectImpl<Function>
|
|||||||
public:
|
public:
|
||||||
DECLARE_OBJECT(Function);
|
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>(),
|
Function(const String& name, const Callback& function, const std::vector<String>& args = std::vector<String>(),
|
||||||
bool side_effect_free = false, bool deprecated = false);
|
bool side_effect_free = false, bool deprecated = false);
|
||||||
|
@ -35,7 +35,7 @@ Value icinga::FunctionWrapperVA(void (*function)(const std::vector<Value>&), con
|
|||||||
return Empty;
|
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);
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <boost/bind.hpp>
|
using namespace std::placeholders;
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ namespace icinga
|
|||||||
Value FunctionWrapperVV(void (*function)(void), const std::vector<Value>& arguments);
|
Value FunctionWrapperVV(void (*function)(void), const std::vector<Value>& arguments);
|
||||||
Value FunctionWrapperVA(void (*function)(const std::vector<Value>&), 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>
|
template<typename TR>
|
||||||
Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
|
Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
|
||||||
@ -41,9 +41,9 @@ Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR>
|
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>
|
||||||
@ -60,9 +60,9 @@ Value FunctionWrapperV(void (*function)(T0), const std::vector<Value>& arguments
|
|||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
@ -77,9 +77,9 @@ Value FunctionWrapperR(TR (*function)(T0), const std::vector<Value>& arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
@ -97,9 +97,9 @@ Value FunctionWrapperV(void (*function)(T0, T1), const std::vector<Value>& argum
|
|||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
@ -115,9 +115,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1), const std::vector<Value>& argumen
|
|||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
@ -136,9 +136,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2), const std::vector<Value>& a
|
|||||||
}
|
}
|
||||||
|
|
||||||
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>
|
||||||
@ -155,9 +155,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2), const std::vector<Value>& arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2>
|
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>
|
||||||
@ -177,9 +177,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3), const std::vector<Value
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T0, typename T1, typename T2, typename T3>
|
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>
|
||||||
@ -197,9 +197,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3), const std::vector<Value>&
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2, typename T3>
|
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>
|
||||||
@ -220,9 +220,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4), const std::vector<V
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T0, typename T1, typename T2, typename T3, typename T4>
|
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>
|
||||||
@ -241,9 +241,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4), const std::vector<Val
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4>
|
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>
|
||||||
@ -265,9 +265,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5), const std::vect
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
|
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>
|
||||||
@ -287,9 +287,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5), const std::vector
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
|
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>
|
||||||
@ -312,9 +312,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6), const std::
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
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>
|
||||||
@ -335,9 +335,9 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6), const std::ve
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
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>
|
||||||
@ -361,9 +361,9 @@ Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const s
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
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>
|
||||||
@ -385,20 +385,20 @@ Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
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>
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -105,5 +105,10 @@
|
|||||||
# define unlikely(x) (x)
|
# define unlikely(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define BOOST_BIND_NO_PLACEHOLDERS
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
using namespace std::placeholders;
|
||||||
|
|
||||||
#endif /* I2BASE_H */
|
#endif /* I2BASE_H */
|
||||||
|
@ -81,7 +81,7 @@ void Loader::ExecuteDeferredInitializers(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Loader::AddDeferredInitializer(const boost::function<void(void)>& callback, int priority)
|
void Loader::AddDeferredInitializer(const std::function<void(void)>& callback, int priority)
|
||||||
{
|
{
|
||||||
if (!GetDeferredInitializers().get())
|
if (!GetDeferredInitializers().get())
|
||||||
GetDeferredInitializers().reset(new std::priority_queue<DeferredInitializer>());
|
GetDeferredInitializers().reset(new std::priority_queue<DeferredInitializer>());
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
#include "base/string.hpp"
|
#include "base/string.hpp"
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
@ -32,7 +31,7 @@ namespace icinga
|
|||||||
struct DeferredInitializer
|
struct DeferredInitializer
|
||||||
{
|
{
|
||||||
public:
|
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)
|
: m_Callback(callback), m_Priority(priority)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -47,7 +46,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::function<void (void)> m_Callback;
|
std::function<void (void)> m_Callback;
|
||||||
int m_Priority;
|
int m_Priority;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ class I2_BASE_API Loader
|
|||||||
public:
|
public:
|
||||||
static void LoadExtensionLibrary(const String& library);
|
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);
|
static void ExecuteDeferredInitializers(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -256,7 +256,7 @@ static void TypeInfoTimerHandler(void)
|
|||||||
INITIALIZE_ONCE([]() {
|
INITIALIZE_ONCE([]() {
|
||||||
l_ObjectCountTimer = new Timer();
|
l_ObjectCountTimer = new Timer();
|
||||||
l_ObjectCountTimer->SetInterval(10);
|
l_ObjectCountTimer->SetInterval(10);
|
||||||
l_ObjectCountTimer->OnTimerExpired.connect(boost::bind(TypeInfoTimerHandler));
|
l_ObjectCountTimer->OnTimerExpired.connect(std::bind(TypeInfoTimerHandler));
|
||||||
l_ObjectCountTimer->Start();
|
l_ObjectCountTimer->Start();
|
||||||
});
|
});
|
||||||
#endif /* I2_LEAK_DEBUG */
|
#endif /* I2_LEAK_DEBUG */
|
||||||
|
@ -539,7 +539,7 @@ void Process::ThreadInitialize(void)
|
|||||||
{
|
{
|
||||||
/* Note to self: Make sure this runs _after_ we've daemonized. */
|
/* Note to self: Make sure this runs _after_ we've daemonized. */
|
||||||
for (int tid = 0; tid < IOTHREADS; tid++) {
|
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();
|
t.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -788,7 +788,7 @@ static BOOL CreatePipeOverlapped(HANDLE *outReadPipe, HANDLE *outWritePipe,
|
|||||||
}
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
void Process::Run(const std::function<void(const ProcessResult&)>& callback)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
boost::call_once(l_SpawnHelperOnceFlag, &Process::InitializeSpawnHelper);
|
boost::call_once(l_SpawnHelperOnceFlag, &Process::InitializeSpawnHelper);
|
||||||
@ -930,7 +930,7 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
|||||||
delete [] args;
|
delete [] args;
|
||||||
|
|
||||||
if (callback)
|
if (callback)
|
||||||
Utility::QueueAsyncCallback(boost::bind(callback, m_Result));
|
Utility::QueueAsyncCallback(std::bind(callback, m_Result));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1131,7 +1131,7 @@ bool Process::DoEvents(void)
|
|||||||
m_Result.Output = output;
|
m_Result.Output = output;
|
||||||
|
|
||||||
if (m_Callback)
|
if (m_Callback)
|
||||||
Utility::QueueAsyncCallback(boost::bind(m_Callback, m_Result));
|
Utility::QueueAsyncCallback(std::bind(m_Callback, m_Result));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -76,7 +75,7 @@ public:
|
|||||||
void SetAdjustPriority(bool adjust);
|
void SetAdjustPriority(bool adjust);
|
||||||
bool GetAdjustPriority(void) const;
|
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;
|
pid_t GetPID(void) const;
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ private:
|
|||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
std::ostringstream m_OutputStream;
|
std::ostringstream m_OutputStream;
|
||||||
boost::function<void (const ProcessResult&)> m_Callback;
|
std::function<void (const ProcessResult&)> m_Callback;
|
||||||
ProcessResult m_Result;
|
ProcessResult m_Result;
|
||||||
|
|
||||||
static void IOThreadProc(int tid);
|
static void IOThreadProc(int tid);
|
||||||
|
@ -477,7 +477,7 @@ Value ScriptUtils::Glob(const std::vector<Value>& args)
|
|||||||
type = args[1];
|
type = args[1];
|
||||||
|
|
||||||
std::vector<String> paths;
|
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);
|
return Array::FromVector(paths);
|
||||||
}
|
}
|
||||||
@ -496,7 +496,7 @@ Value ScriptUtils::GlobRecursive(const std::vector<Value>& args)
|
|||||||
type = args[2];
|
type = args[2];
|
||||||
|
|
||||||
std::vector<String> paths;
|
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);
|
return Array::FromVector(paths);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ void SocketEventEngine::Start(void)
|
|||||||
|
|
||||||
InitializeThread(tid);
|
InitializeThread(tid);
|
||||||
|
|
||||||
m_Threads[tid] = boost::thread(boost::bind(&SocketEventEngine::ThreadProc, this, tid));
|
m_Threads[tid] = boost::thread(std::bind(&SocketEventEngine::ThreadProc, this, tid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include "base/array.hpp"
|
#include "base/array.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -40,7 +39,7 @@ class I2_BASE_API StatsFunction : public Object
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(StatsFunction);
|
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);
|
StatsFunction(const Callback& function);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
using namespace icinga;
|
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())
|
if (SupportsWaiting())
|
||||||
OnDataAvailable.connect(handler);
|
OnDataAvailable.connect(handler);
|
||||||
@ -85,7 +85,7 @@ void Stream::Close(void)
|
|||||||
|
|
||||||
/* Force signals2 to remove the slots, see https://stackoverflow.com/questions/2049291/force-deletion-of-slot-in-boostsignals2
|
/* Force signals2 to remove the slots, see https://stackoverflow.com/questions/2049291/force-deletion-of-slot-in-boostsignals2
|
||||||
* for details. */
|
* for details. */
|
||||||
OnDataAvailable.connect(boost::bind(&StreamDummyCallback));
|
OnDataAvailable.connect(std::bind(&StreamDummyCallback));
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamReadStatus Stream::ReadLine(String *line, StreamReadContext& context, bool may_wait)
|
StreamReadStatus Stream::ReadLine(String *line, StreamReadContext& context, bool may_wait)
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
virtual bool IsDataAvailable(void) const;
|
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);
|
StreamReadStatus ReadLine(String *line, StreamReadContext& context, bool may_wait = false);
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
|||||||
|
|
||||||
m_FlushLogTimer = new Timer();
|
m_FlushLogTimer = new Timer();
|
||||||
m_FlushLogTimer->SetInterval(1);
|
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();
|
m_FlushLogTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void ThreadPool::Start(void)
|
|||||||
for (size_t i = 0; i < sizeof(m_Queues) / sizeof(m_Queues[0]); i++)
|
for (size_t i = 0; i < sizeof(m_Queues) / sizeof(m_Queues[0]); i++)
|
||||||
m_Queues[i].SpawnWorker(m_ThreadGroup);
|
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)
|
void ThreadPool::Stop(void)
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "base/timer.hpp"
|
#include "base/timer.hpp"
|
||||||
#include "base/debug.hpp"
|
#include "base/debug.hpp"
|
||||||
#include "base/utility.hpp"
|
#include "base/utility.hpp"
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/condition_variable.hpp>
|
#include <boost/thread/condition_variable.hpp>
|
||||||
@ -282,6 +281,6 @@ void Timer::TimerThreadProc(void)
|
|||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
/* Asynchronously call the timer. */
|
/* Asynchronously call the timer. */
|
||||||
Utility::QueueAsyncCallback(boost::bind(&Timer::Call, ptimer));
|
Utility::QueueAsyncCallback(std::bind(&Timer::Call, ptimer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include "base/utility.hpp"
|
#include "base/utility.hpp"
|
||||||
#include "base/exception.hpp"
|
#include "base/exception.hpp"
|
||||||
#include "base/logger.hpp"
|
#include "base/logger.hpp"
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "base/string.hpp"
|
#include "base/string.hpp"
|
||||||
#include "base/object.hpp"
|
#include "base/object.hpp"
|
||||||
#include "base/initialize.hpp"
|
#include "base/initialize.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
@ -105,7 +104,7 @@ public:
|
|||||||
|
|
||||||
virtual std::vector<String> GetLoadDependencies(void) const;
|
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);
|
virtual void RegisterAttributeHandler(int fieldId, const AttributeHandler& callback);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -39,7 +39,7 @@ static void TypeRegisterAttributeHandler(const String& fieldName, const Function
|
|||||||
Type::Ptr self = static_cast<Type::Ptr>(vframe->Self);
|
Type::Ptr self = static_cast<Type::Ptr>(vframe->Self);
|
||||||
|
|
||||||
int fid = self->GetFieldId(fieldName);
|
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)
|
Object::Ptr TypeType::GetPrototype(void)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <ios>
|
#include <ios>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <future>
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
# include <pthread_np.h>
|
# include <pthread_np.h>
|
||||||
@ -502,7 +503,7 @@ static int GlobErrorHandler(const char *epath, int eerrno)
|
|||||||
* @param callback The callback which is invoked for each matching file.
|
* @param callback The callback which is invoked for each matching file.
|
||||||
* @param type The file type (a combination of GlobFile and GlobDirectory)
|
* @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;
|
std::vector<String> files, dirs;
|
||||||
|
|
||||||
@ -609,7 +610,7 @@ bool Utility::Glob(const String& pathSpec, const boost::function<void (const Str
|
|||||||
* @param callback The callback which is invoked for each matching file.
|
* @param callback The callback which is invoked for each matching file.
|
||||||
* @param type The file type (a combination of GlobFile and GlobDirectory)
|
* @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;
|
std::vector<String> files, dirs, alldirs;
|
||||||
|
|
||||||
@ -768,7 +769,7 @@ void Utility::MkDirP(const String& path, int mode)
|
|||||||
void Utility::RemoveDirRecursive(const String& path)
|
void Utility::RemoveDirRecursive(const String& path)
|
||||||
{
|
{
|
||||||
std::vector<String> paths;
|
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
|
/* This relies on the fact that GlobRecursive lists the parent directory
|
||||||
first before recursing into subdirectories. */
|
first before recursing into subdirectories. */
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "base/string.hpp"
|
#include "base/string.hpp"
|
||||||
#include "base/array.hpp"
|
#include "base/array.hpp"
|
||||||
#include "base/threadpool.hpp"
|
#include "base/threadpool.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -80,8 +79,8 @@ public:
|
|||||||
|
|
||||||
static String NewUniqueID(void);
|
static String NewUniqueID(void);
|
||||||
|
|
||||||
static bool Glob(const String& pathSpec, 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 boost::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 MkDir(const String& path, int mode);
|
||||||
static void MkDirP(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);
|
static bool SetFileOwnership(const String& file, const String& user, const String& group);
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "base/convert.hpp"
|
#include "base/convert.hpp"
|
||||||
#include "base/application.hpp"
|
#include "base/application.hpp"
|
||||||
#include "base/exception.hpp"
|
#include "base/exception.hpp"
|
||||||
#include <boost/bind.hpp>
|
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
@ -40,7 +39,7 @@ WorkQueue::WorkQueue(size_t maxItems, int threadCount)
|
|||||||
|
|
||||||
m_StatusTimer = new Timer();
|
m_StatusTimer = new Timer();
|
||||||
m_StatusTimer->SetInterval(10);
|
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();
|
m_StatusTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ String WorkQueue::GetName(void) const
|
|||||||
* allowInterleaved is true in which case the new task might be run
|
* allowInterleaved is true in which case the new task might be run
|
||||||
* immediately if it's being enqueued from within the WorkQueue thread.
|
* 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 allowInterleaved)
|
||||||
{
|
{
|
||||||
bool wq_thread = IsWorkerThread();
|
bool wq_thread = IsWorkerThread();
|
||||||
@ -85,7 +84,7 @@ void WorkQueue::Enqueue(boost::function<void (void)>&& function, WorkQueuePriori
|
|||||||
<< "Spawning WorkQueue threads for '" << m_Name << "'";
|
<< "Spawning WorkQueue threads for '" << m_Name << "'";
|
||||||
|
|
||||||
for (int i = 0; i < m_ThreadCount; i++) {
|
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;
|
m_Spawned = true;
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
#include "base/timer.hpp"
|
#include "base/timer.hpp"
|
||||||
#include "base/ringbuffer.hpp"
|
#include "base/ringbuffer.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/condition_variable.hpp>
|
#include <boost/thread/condition_variable.hpp>
|
||||||
@ -47,11 +46,11 @@ struct Task
|
|||||||
: Priority(PriorityNormal), ID(-1)
|
: 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)
|
: Function(std::move(function)), Priority(priority), ID(id)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
boost::function<void (void)> Function;
|
std::function<void (void)> Function;
|
||||||
WorkQueuePriority Priority;
|
WorkQueuePriority Priority;
|
||||||
int ID;
|
int ID;
|
||||||
};
|
};
|
||||||
@ -79,7 +78,7 @@ inline bool operator<(const Task& a, const Task& b)
|
|||||||
class I2_BASE_API WorkQueue
|
class I2_BASE_API WorkQueue
|
||||||
{
|
{
|
||||||
public:
|
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(size_t maxItems = 0, int threadCount = 1);
|
||||||
~WorkQueue(void);
|
~WorkQueue(void);
|
||||||
@ -87,7 +86,7 @@ public:
|
|||||||
void SetName(const String& name);
|
void SetName(const String& name);
|
||||||
String GetName(void) const;
|
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);
|
bool allowInterleaved = false);
|
||||||
void Join(bool stop = false);
|
void Join(bool stop = false);
|
||||||
|
|
||||||
|
@ -65,10 +65,10 @@ CheckerComponent::CheckerComponent(void)
|
|||||||
|
|
||||||
void CheckerComponent::OnConfigLoaded(void)
|
void CheckerComponent::OnConfigLoaded(void)
|
||||||
{
|
{
|
||||||
ConfigObject::OnActiveChanged.connect(bind(&CheckerComponent::ObjectHandler, this, _1));
|
ConfigObject::OnActiveChanged.connect(std::bind(&CheckerComponent::ObjectHandler, this, _1));
|
||||||
ConfigObject::OnPausedChanged.connect(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)
|
void CheckerComponent::Start(bool runtimeCreated)
|
||||||
@ -79,11 +79,11 @@ void CheckerComponent::Start(bool runtimeCreated)
|
|||||||
<< "'" << GetName() << "' started.";
|
<< "'" << 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 = new Timer();
|
||||||
m_ResultTimer->SetInterval(5);
|
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();
|
m_ResultTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ void CheckerComponent::CheckThreadProc(void)
|
|||||||
|
|
||||||
Checkable::IncreasePendingChecks();
|
Checkable::IncreasePendingChecks();
|
||||||
|
|
||||||
Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
|
Utility::QueueAsyncCallback(std::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
|
||||||
|
|
||||||
lock.lock();
|
lock.lock();
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ char *ConsoleCommand::ConsoleCompleteHelper(const char *word, int state)
|
|||||||
Array::Ptr suggestions;
|
Array::Ptr suggestions;
|
||||||
|
|
||||||
l_ApiClient->AutocompleteScript(l_Session, word, l_ScriptFrame->Sandboxed,
|
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),
|
boost::ref(mutex), boost::ref(cv), boost::ref(ready),
|
||||||
_1, _2,
|
_1, _2,
|
||||||
boost::ref(suggestions)));
|
boost::ref(suggestions)));
|
||||||
@ -425,7 +425,7 @@ incomplete:
|
|||||||
boost::exception_ptr eptr;
|
boost::exception_ptr eptr;
|
||||||
|
|
||||||
l_ApiClient->ExecuteScript(l_Session, command, scriptFrame.Sandboxed,
|
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),
|
boost::ref(mutex), boost::ref(cv), boost::ref(ready),
|
||||||
_1, _2,
|
_1, _2,
|
||||||
boost::ref(result), boost::ref(eptr)));
|
boost::ref(result), boost::ref(eptr)));
|
||||||
|
@ -52,7 +52,7 @@ static void IncludeZoneDirRecursive(const String& path, const String& package, b
|
|||||||
ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
|
ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
|
||||||
|
|
||||||
std::vector<Expression *> expressions;
|
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);
|
DictExpression expr(expressions);
|
||||||
if (!ExecuteExpression(&expr))
|
if (!ExecuteExpression(&expr))
|
||||||
success = false;
|
success = false;
|
||||||
@ -75,7 +75,7 @@ static void IncludeNonLocalZone(const String& zonePath, const String& package, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Expression *> expressions;
|
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);
|
DictExpression expr(expressions);
|
||||||
if (!ExecuteExpression(&expr))
|
if (!ExecuteExpression(&expr))
|
||||||
success = false;
|
success = false;
|
||||||
@ -126,7 +126,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
|
|||||||
|
|
||||||
String zonesEtcDir = Application::GetZonesDir();
|
String zonesEtcDir = Application::GetZonesDir();
|
||||||
if (!zonesEtcDir.IsEmpty() && Utility::PathExists(zonesEtcDir))
|
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)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
@ -135,7 +135,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
|
|||||||
* are authoritative on this node and are checked in HasZoneConfigAuthority(). */
|
* are authoritative on this node and are checked in HasZoneConfigAuthority(). */
|
||||||
String packagesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/packages";
|
String packagesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/packages";
|
||||||
if (Utility::PathExists(packagesVarDir))
|
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)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
@ -143,7 +143,7 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
|
|||||||
/* Load cluster synchronized configuration files */
|
/* Load cluster synchronized configuration files */
|
||||||
String zonesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
|
String zonesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
|
||||||
if (Utility::PathExists(zonesVarDir))
|
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)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
|
@ -200,11 +200,11 @@ bool FeatureUtility::GetFeatures(std::vector<String>& features, bool get_disable
|
|||||||
/* disable = available-enabled */
|
/* disable = available-enabled */
|
||||||
String available_pattern = GetFeaturesAvailablePath() + "/*.conf";
|
String available_pattern = GetFeaturesAvailablePath() + "/*.conf";
|
||||||
std::vector<String> available;
|
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";
|
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
|
||||||
std::vector<String> enabled;
|
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(available.begin(), available.end());
|
||||||
std::sort(enabled.begin(), enabled.end());
|
std::sort(enabled.begin(), enabled.end());
|
||||||
@ -217,7 +217,7 @@ bool FeatureUtility::GetFeatures(std::vector<String>& features, bool get_disable
|
|||||||
/* all enabled features */
|
/* all enabled features */
|
||||||
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
|
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;
|
return true;
|
||||||
|
@ -375,7 +375,7 @@ bool TroubleshootCommand::PrintCrashReports(InfoLog& log)
|
|||||||
String bestFilename;
|
String bestFilename;
|
||||||
|
|
||||||
try {
|
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);
|
boost::ref(bestFilename)), GlobFile);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -63,7 +63,7 @@ void CheckResultReader::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
m_ReadTimer = new Timer();
|
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->SetInterval(5);
|
||||||
m_ReadTimer->Start();
|
m_ReadTimer->Start();
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
@ -87,7 +87,7 @@ void CheckResultReader::ReadTimerHandler(void) const
|
|||||||
{
|
{
|
||||||
CONTEXT("Processing check result files in '" + GetSpoolDir() + "'");
|
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
|
void CheckResultReader::ProcessCheckResultFile(const String& path) const
|
||||||
|
@ -63,19 +63,19 @@ void CompatLogger::Start(bool runtimeCreated)
|
|||||||
Log(LogInformation, "CompatLogger")
|
Log(LogInformation, "CompatLogger")
|
||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
Checkable::OnNewCheckResult.connect(bind(&CompatLogger::CheckResultHandler, this, _1, _2));
|
Checkable::OnNewCheckResult.connect(std::bind(&CompatLogger::CheckResultHandler, this, _1, _2));
|
||||||
Checkable::OnNotificationSentToUser.connect(bind(&CompatLogger::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
|
Checkable::OnNotificationSentToUser.connect(std::bind(&CompatLogger::NotificationSentHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
|
||||||
Downtime::OnDowntimeTriggered.connect(boost::bind(&CompatLogger::TriggerDowntimeHandler, this, _1));
|
Downtime::OnDowntimeTriggered.connect(std::bind(&CompatLogger::TriggerDowntimeHandler, this, _1));
|
||||||
Downtime::OnDowntimeRemoved.connect(boost::bind(&CompatLogger::RemoveDowntimeHandler, this, _1));
|
Downtime::OnDowntimeRemoved.connect(std::bind(&CompatLogger::RemoveDowntimeHandler, this, _1));
|
||||||
Checkable::OnEventCommandExecuted.connect(bind(&CompatLogger::EventCommandHandler, this, _1));
|
Checkable::OnEventCommandExecuted.connect(std::bind(&CompatLogger::EventCommandHandler, this, _1));
|
||||||
|
|
||||||
Checkable::OnFlappingChanged.connect(boost::bind(&CompatLogger::FlappingChangedHandler, this, _1));
|
Checkable::OnFlappingChanged.connect(std::bind(&CompatLogger::FlappingChangedHandler, this, _1));
|
||||||
Checkable::OnEnableFlappingChanged.connect(boost::bind(&CompatLogger::EnableFlappingChangedHandler, 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 = new Timer();
|
||||||
m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this));
|
m_RotationTimer->OnTimerExpired.connect(std::bind(&CompatLogger::RotationTimerHandler, this));
|
||||||
m_RotationTimer->Start();
|
m_RotationTimer->Start();
|
||||||
|
|
||||||
ReopenFile(false);
|
ReopenFile(false);
|
||||||
|
@ -54,7 +54,7 @@ void ExternalCommandListener::Start(bool runtimeCreated)
|
|||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
#ifndef _WIN32
|
#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();
|
m_CommandThread.detach();
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
@ -80,12 +80,12 @@ void StatusDataWriter::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_StatusTimer = new Timer();
|
m_StatusTimer = new Timer();
|
||||||
m_StatusTimer->SetInterval(GetUpdateInterval());
|
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->Start();
|
||||||
m_StatusTimer->Reschedule(0);
|
m_StatusTimer->Reschedule(0);
|
||||||
|
|
||||||
ConfigObject::OnVersionChanged.connect(boost::bind(&StatusDataWriter::ObjectHandler, this));
|
ConfigObject::OnVersionChanged.connect(std::bind(&StatusDataWriter::ObjectHandler, this));
|
||||||
ConfigObject::OnActiveChanged.connect(boost::bind(&StatusDataWriter::ObjectHandler, this));
|
ConfigObject::OnActiveChanged.connect(std::bind(&StatusDataWriter::ObjectHandler, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "config/i2-config.hpp"
|
#include "config/i2-config.hpp"
|
||||||
#include "config/expression.hpp"
|
#include "config/expression.hpp"
|
||||||
#include "base/debuginfo.hpp"
|
#include "base/debuginfo.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,7 @@ Expression *ConfigCompiler::HandleInclude(const String& relativeBase, const Stri
|
|||||||
|
|
||||||
std::vector<Expression *> expressions;
|
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;
|
std::ostringstream msgbuf;
|
||||||
msgbuf << "Include file '" + path + "' does not exist";
|
msgbuf << "Include file '" + path + "' does not exist";
|
||||||
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), debuginfo));
|
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), debuginfo));
|
||||||
@ -185,7 +185,7 @@ Expression *ConfigCompiler::HandleIncludeRecursive(const String& relativeBase, c
|
|||||||
ppath = relativeBase + "/" + path;
|
ppath = relativeBase + "/" + path;
|
||||||
|
|
||||||
std::vector<Expression *> expressions;
|
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);
|
DictExpression *dict = new DictExpression(expressions);
|
||||||
dict->MakeInline();
|
dict->MakeInline();
|
||||||
@ -205,7 +205,7 @@ void ConfigCompiler::HandleIncludeZone(const String& relativeBase, const String&
|
|||||||
|
|
||||||
RegisterZoneDir(tag, ppath, zoneName);
|
RegisterZoneDir(tag, ppath, zoneName);
|
||||||
|
|
||||||
Utility::GlobRecursive(ppath, pattern, boost::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
|
Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -231,7 +231,7 @@ Expression *ConfigCompiler::HandleIncludeZones(const String& relativeBase, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Expression *> expressions;
|
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);
|
return new DictExpression(expressions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "base/registry.hpp"
|
#include "base/registry.hpp"
|
||||||
#include "base/initialize.hpp"
|
#include "base/initialize.hpp"
|
||||||
#include "base/singleton.hpp"
|
#include "base/singleton.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr
|
|||||||
Log(LogDebug, "ConfigItem")
|
Log(LogDebug, "ConfigItem")
|
||||||
<< "Setting 'active' to true for object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
|
<< "Setting 'active' to true for object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
|
||||||
#endif /* I2_DEBUG */
|
#endif /* I2_DEBUG */
|
||||||
upq.Enqueue(boost::bind(&ConfigObject::PreActivate, object));
|
upq.Enqueue(std::bind(&ConfigObject::PreActivate, object));
|
||||||
}
|
}
|
||||||
|
|
||||||
upq.Join();
|
upq.Join();
|
||||||
@ -631,7 +631,7 @@ bool ConfigItem::ActivateItems(WorkQueue& upq, const std::vector<ConfigItem::Ptr
|
|||||||
Log(LogDebug, "ConfigItem")
|
Log(LogDebug, "ConfigItem")
|
||||||
<< "Activating object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
|
<< "Activating object '" << object->GetName() << "' of type '" << object->GetReflectionType()->GetName() << "'";
|
||||||
#endif /* I2_DEBUG */
|
#endif /* I2_DEBUG */
|
||||||
upq.Enqueue(boost::bind(&ConfigObject::Activate, object, runtimeCreated));
|
upq.Enqueue(std::bind(&ConfigObject::Activate, object, runtimeCreated));
|
||||||
}
|
}
|
||||||
|
|
||||||
upq.Join();
|
upq.Join();
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
static inline Value NewFunction(ScriptFrame& frame, const String& name, const std::vector<String>& args,
|
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)
|
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);
|
EvaluateClosedVars(frame, closedVars), expression), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ void DbConnection::Start(bool runtimeCreated)
|
|||||||
Log(LogInformation, "DbConnection")
|
Log(LogInformation, "DbConnection")
|
||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
|
DbObject::OnQuery.connect(std::bind(&DbConnection::ExecuteQuery, this, _1));
|
||||||
DbObject::OnMultipleQueries.connect(boost::bind(&DbConnection::ExecuteMultipleQueries, this, _1));
|
DbObject::OnMultipleQueries.connect(std::bind(&DbConnection::ExecuteMultipleQueries, this, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DbConnection::Stop(bool runtimeRemoved)
|
void DbConnection::Stop(bool runtimeRemoved)
|
||||||
@ -81,7 +81,7 @@ void DbConnection::Stop(bool runtimeRemoved)
|
|||||||
void DbConnection::EnableActiveChangedHandler(void)
|
void DbConnection::EnableActiveChangedHandler(void)
|
||||||
{
|
{
|
||||||
if (!m_ActiveChangedHandler) {
|
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_ActiveChangedHandler = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ void DbConnection::Resume(void)
|
|||||||
|
|
||||||
m_CleanUpTimer = new Timer();
|
m_CleanUpTimer = new Timer();
|
||||||
m_CleanUpTimer->SetInterval(60);
|
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_CleanUpTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ void DbConnection::InitializeDbTimer(void)
|
|||||||
{
|
{
|
||||||
m_ProgramStatusTimer = new Timer();
|
m_ProgramStatusTimer = new Timer();
|
||||||
m_ProgramStatusTimer->SetInterval(10);
|
m_ProgramStatusTimer->SetInterval(10);
|
||||||
m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&DbConnection::UpdateProgramStatus));
|
m_ProgramStatusTimer->OnTimerExpired.connect(std::bind(&DbConnection::UpdateProgramStatus));
|
||||||
m_ProgramStatusTimer->Start();
|
m_ProgramStatusTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,49 +42,49 @@ INITIALIZE_ONCE(&DbEvents::StaticInitialize);
|
|||||||
void DbEvents::StaticInitialize(void)
|
void DbEvents::StaticInitialize(void)
|
||||||
{
|
{
|
||||||
/* Status */
|
/* Status */
|
||||||
Comment::OnCommentAdded.connect(boost::bind(&DbEvents::AddComment, _1));
|
Comment::OnCommentAdded.connect(std::bind(&DbEvents::AddComment, _1));
|
||||||
Comment::OnCommentRemoved.connect(boost::bind(&DbEvents::RemoveComment, _1));
|
Comment::OnCommentRemoved.connect(std::bind(&DbEvents::RemoveComment, _1));
|
||||||
Downtime::OnDowntimeAdded.connect(boost::bind(&DbEvents::AddDowntime, _1));
|
Downtime::OnDowntimeAdded.connect(std::bind(&DbEvents::AddDowntime, _1));
|
||||||
Downtime::OnDowntimeRemoved.connect(boost::bind(&DbEvents::RemoveDowntime, _1));
|
Downtime::OnDowntimeRemoved.connect(std::bind(&DbEvents::RemoveDowntime, _1));
|
||||||
Downtime::OnDowntimeTriggered.connect(boost::bind(&DbEvents::TriggerDowntime, _1));
|
Downtime::OnDowntimeTriggered.connect(std::bind(&DbEvents::TriggerDowntime, _1));
|
||||||
Checkable::OnAcknowledgementSet.connect(boost::bind(&DbEvents::AddAcknowledgement, _1, _4));
|
Checkable::OnAcknowledgementSet.connect(std::bind(&DbEvents::AddAcknowledgement, _1, _4));
|
||||||
Checkable::OnAcknowledgementCleared.connect(boost::bind(&DbEvents::RemoveAcknowledgement, _1));
|
Checkable::OnAcknowledgementCleared.connect(std::bind(&DbEvents::RemoveAcknowledgement, _1));
|
||||||
|
|
||||||
Checkable::OnNextCheckUpdated.connect(boost::bind(&DbEvents::NextCheckUpdatedHandler, _1));
|
Checkable::OnNextCheckUpdated.connect(std::bind(&DbEvents::NextCheckUpdatedHandler, _1));
|
||||||
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::FlappingChangedHandler, _1));
|
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::FlappingChangedHandler, _1));
|
||||||
Checkable::OnNotificationSentToAllUsers.connect(boost::bind(&DbEvents::LastNotificationChangedHandler, _1, _2));
|
Checkable::OnNotificationSentToAllUsers.connect(std::bind(&DbEvents::LastNotificationChangedHandler, _1, _2));
|
||||||
|
|
||||||
Checkable::OnEnableActiveChecksChanged.connect(boost::bind(&DbEvents::EnableActiveChecksChangedHandler, _1));
|
Checkable::OnEnableActiveChecksChanged.connect(std::bind(&DbEvents::EnableActiveChecksChangedHandler, _1));
|
||||||
Checkable::OnEnablePassiveChecksChanged.connect(boost::bind(&DbEvents::EnablePassiveChecksChangedHandler, _1));
|
Checkable::OnEnablePassiveChecksChanged.connect(std::bind(&DbEvents::EnablePassiveChecksChangedHandler, _1));
|
||||||
Checkable::OnEnableNotificationsChanged.connect(boost::bind(&DbEvents::EnableNotificationsChangedHandler, _1));
|
Checkable::OnEnableNotificationsChanged.connect(std::bind(&DbEvents::EnableNotificationsChangedHandler, _1));
|
||||||
Checkable::OnEnablePerfdataChanged.connect(boost::bind(&DbEvents::EnablePerfdataChangedHandler, _1));
|
Checkable::OnEnablePerfdataChanged.connect(std::bind(&DbEvents::EnablePerfdataChangedHandler, _1));
|
||||||
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::EnableFlappingChangedHandler, _1));
|
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::EnableFlappingChangedHandler, _1));
|
||||||
|
|
||||||
Checkable::OnReachabilityChanged.connect(boost::bind(&DbEvents::ReachabilityChangedHandler, _1, _2, _3));
|
Checkable::OnReachabilityChanged.connect(std::bind(&DbEvents::ReachabilityChangedHandler, _1, _2, _3));
|
||||||
|
|
||||||
/* History */
|
/* History */
|
||||||
Comment::OnCommentAdded.connect(boost::bind(&DbEvents::AddCommentHistory, _1));
|
Comment::OnCommentAdded.connect(std::bind(&DbEvents::AddCommentHistory, _1));
|
||||||
Downtime::OnDowntimeAdded.connect(boost::bind(&DbEvents::AddDowntimeHistory, _1));
|
Downtime::OnDowntimeAdded.connect(std::bind(&DbEvents::AddDowntimeHistory, _1));
|
||||||
Checkable::OnAcknowledgementSet.connect(boost::bind(&DbEvents::AddAcknowledgementHistory, _1, _2, _3, _4, _5, _6));
|
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::OnNewCheckResult.connect(std::bind(&DbEvents::AddCheckResultLogHistory, _1, _2));
|
||||||
Checkable::OnNotificationSentToUser.connect(boost::bind(&DbEvents::AddNotificationSentLogHistory, _1, _2, _3, _4, _5, _6, _7));
|
Checkable::OnNotificationSentToUser.connect(std::bind(&DbEvents::AddNotificationSentLogHistory, _1, _2, _3, _4, _5, _6, _7));
|
||||||
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::AddFlappingChangedLogHistory, _1));
|
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::AddFlappingChangedLogHistory, _1));
|
||||||
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::AddEnableFlappingChangedLogHistory, _1));
|
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::AddEnableFlappingChangedLogHistory, _1));
|
||||||
Downtime::OnDowntimeTriggered.connect(boost::bind(&DbEvents::AddTriggerDowntimeLogHistory, _1));
|
Downtime::OnDowntimeTriggered.connect(std::bind(&DbEvents::AddTriggerDowntimeLogHistory, _1));
|
||||||
Downtime::OnDowntimeRemoved.connect(boost::bind(&DbEvents::AddRemoveDowntimeLogHistory, _1));
|
Downtime::OnDowntimeRemoved.connect(std::bind(&DbEvents::AddRemoveDowntimeLogHistory, _1));
|
||||||
|
|
||||||
Checkable::OnFlappingChanged.connect(boost::bind(&DbEvents::AddFlappingChangedHistory, _1));
|
Checkable::OnFlappingChanged.connect(std::bind(&DbEvents::AddFlappingChangedHistory, _1));
|
||||||
Checkable::OnEnableFlappingChanged.connect(boost::bind(&DbEvents::AddEnableFlappingChangedHistory, _1));
|
Checkable::OnEnableFlappingChanged.connect(std::bind(&DbEvents::AddEnableFlappingChangedHistory, _1));
|
||||||
Checkable::OnNewCheckResult.connect(boost::bind(&DbEvents::AddCheckableCheckHistory, _1, _2));
|
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 */
|
/* check events */
|
||||||
|
@ -52,11 +52,11 @@ DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const
|
|||||||
void DbObject::StaticInitialize(void)
|
void DbObject::StaticInitialize(void)
|
||||||
{
|
{
|
||||||
/* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
|
/* triggered in ProcessCheckResult(), requires UpdateNextCheck() to be called before */
|
||||||
ConfigObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
|
ConfigObject::OnStateChanged.connect(std::bind(&DbObject::StateChangedHandler, _1));
|
||||||
CustomVarObject::OnVarsChanged.connect(boost::bind(&DbObject::VarsChangedHandler, _1));
|
CustomVarObject::OnVarsChanged.connect(std::bind(&DbObject::VarsChangedHandler, _1));
|
||||||
|
|
||||||
/* triggered on create, update and delete objects */
|
/* 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)
|
void DbObject::SetObject(const ConfigObject::Ptr& object)
|
||||||
|
@ -41,7 +41,7 @@ class I2_DB_IDO_API DbType : public Object
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(DbType);
|
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<String, DbType::Ptr> TypeMap;
|
||||||
typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap;
|
typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap;
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ INITIALIZE_ONCE(&EndpointDbObject::StaticInitialize);
|
|||||||
|
|
||||||
void EndpointDbObject::StaticInitialize(void)
|
void EndpointDbObject::StaticInitialize(void)
|
||||||
{
|
{
|
||||||
Endpoint::OnConnected.connect(boost::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
|
Endpoint::OnConnected.connect(std::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
|
||||||
Endpoint::OnDisconnected.connect(boost::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
|
Endpoint::OnDisconnected.connect(std::bind(&EndpointDbObject::UpdateConnectedStatus, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
EndpointDbObject::EndpointDbObject(const DbType::Ptr& type, const String& name1, const String& name2)
|
EndpointDbObject::EndpointDbObject(const DbType::Ptr& type, const String& name1, const String& name2)
|
||||||
|
@ -85,16 +85,16 @@ void IdoMysqlConnection::Resume(void)
|
|||||||
|
|
||||||
SetConnected(false);
|
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 = new Timer();
|
||||||
m_TxTimer->SetInterval(1);
|
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_TxTimer->Start();
|
||||||
|
|
||||||
m_ReconnectTimer = new Timer();
|
m_ReconnectTimer = new Timer();
|
||||||
m_ReconnectTimer->SetInterval(10);
|
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->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
m_ReconnectTimer->Reschedule(0);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ void IdoMysqlConnection::Pause(void)
|
|||||||
<< "Rescheduling disconnect task.";
|
<< "Rescheduling disconnect task.";
|
||||||
#endif /* I2_DEBUG */
|
#endif /* I2_DEBUG */
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::Disconnect, this), PriorityHigh);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::Disconnect, this), PriorityHigh);
|
||||||
m_QueryQueue.Join();
|
m_QueryQueue.Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,8 +163,8 @@ void IdoMysqlConnection::NewTransaction(void)
|
|||||||
<< "Scheduling new transaction and finishing async queries.";
|
<< "Scheduling new transaction and finishing async queries.";
|
||||||
#endif /* I2_DEBUG */
|
#endif /* I2_DEBUG */
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalNewTransaction, this), PriorityHigh);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::InternalNewTransaction, this), PriorityHigh);
|
||||||
m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::FinishAsyncQueries, this), PriorityHigh);
|
m_QueryQueue.Enqueue(std::bind(&IdoMysqlConnection::FinishAsyncQueries, this), PriorityHigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdoMysqlConnection::InternalNewTransaction(void)
|
void IdoMysqlConnection::InternalNewTransaction(void)
|
||||||
@ -185,7 +185,7 @@ void IdoMysqlConnection::ReconnectTimerHandler(void)
|
|||||||
<< "Scheduling reconnect task.";
|
<< "Scheduling reconnect task.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::Reconnect(void)
|
||||||
@ -444,9 +444,9 @@ void IdoMysqlConnection::Reconnect(void)
|
|||||||
<< "Scheduling session table clear and finish connect task.";
|
<< "Scheduling session table clear and finish connect task.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::FinishConnect(double startTime)
|
||||||
@ -479,7 +479,7 @@ void IdoMysqlConnection::ClearTableBySession(const String& table)
|
|||||||
Convert::ToString(GetSessionToken()));
|
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();
|
AssertOnWorkQueue();
|
||||||
|
|
||||||
@ -715,7 +715,7 @@ void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
|
|||||||
<< "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
|
<< "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj)
|
||||||
@ -754,7 +754,7 @@ void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj)
|
|||||||
<< "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
|
<< "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
|
||||||
@ -859,7 +859,7 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query)
|
|||||||
<< "Scheduling execute query task, type " << query.Type << ", table '" << query.Table << "'.";
|
<< "Scheduling execute query task, type " << query.Type << ", table '" << query.Table << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
|
||||||
@ -872,7 +872,7 @@ void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& quer
|
|||||||
<< "Scheduling multiple execute query task, type " << queries[0].Type << ", table '" << queries[0].Table << "'.";
|
<< "Scheduling multiple execute query task, type " << queries[0].Type << ", table '" << queries[0].Table << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
bool IdoMysqlConnection::CanExecuteQuery(const DbQuery& query)
|
||||||
@ -925,7 +925,7 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
|
|||||||
<< query.Type << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< query.Type << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -963,7 +963,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -986,7 +986,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
<< typeOverride << "', table '" << query.Table << "', queue size: '" << GetPendingQueryCount() << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1065,7 +1065,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
<< kv.first << "', val '" << kv.second << "', type " << typeOverride << ", table '" << query.Table << "'.";
|
<< kv.first << "', val '" << kv.second << "', type " << typeOverride << ", table '" << query.Table << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1095,7 +1095,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
if (type != DbQueryInsert)
|
if (type != DbQueryInsert)
|
||||||
qbuf << where.str();
|
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)
|
void IdoMysqlConnection::FinishExecuteQuery(const DbQuery& query, int type, bool upsert)
|
||||||
@ -1107,7 +1107,7 @@ void IdoMysqlConnection::FinishExecuteQuery(const DbQuery& query, int type, bool
|
|||||||
<< "Rescheduling DELETE/INSERT query: Upsert UPDATE did not affect rows, type " << type << ", table '" << query.Table << "'.";
|
<< "Rescheduling DELETE/INSERT query: Upsert UPDATE did not affect rows, type " << type << ", table '" << query.Table << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
@ -1132,7 +1132,7 @@ void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String&
|
|||||||
<< time_column << "'. max_age is set to '" << max_age << "'.";
|
<< time_column << "'. max_age is set to '" << max_age << "'.";
|
||||||
#endif /* I2_DEBUG */
|
#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)
|
void IdoMysqlConnection::InternalCleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
|
||||||
|
@ -31,7 +31,7 @@ namespace icinga
|
|||||||
|
|
||||||
typedef boost::shared_ptr<MYSQL_RES> IdoMysqlResult;
|
typedef boost::shared_ptr<MYSQL_RES> IdoMysqlResult;
|
||||||
|
|
||||||
typedef boost::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
|
typedef std::function<void (const IdoMysqlResult&)> IdoAsyncCallback;
|
||||||
|
|
||||||
struct IdoAsyncQuery
|
struct IdoAsyncQuery
|
||||||
{
|
{
|
||||||
|
@ -89,16 +89,16 @@ void IdoPgsqlConnection::Resume(void)
|
|||||||
|
|
||||||
SetConnected(false);
|
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 = new Timer();
|
||||||
m_TxTimer->SetInterval(1);
|
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_TxTimer->Start();
|
||||||
|
|
||||||
m_ReconnectTimer = new Timer();
|
m_ReconnectTimer = new Timer();
|
||||||
m_ReconnectTimer->SetInterval(10);
|
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->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
m_ReconnectTimer->Reschedule(0);
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ void IdoPgsqlConnection::Pause(void)
|
|||||||
|
|
||||||
DbConnection::Pause();
|
DbConnection::Pause();
|
||||||
|
|
||||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
|
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::Disconnect, this), PriorityHigh);
|
||||||
m_QueryQueue.Join();
|
m_QueryQueue.Join();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ void IdoPgsqlConnection::TxTimerHandler(void)
|
|||||||
|
|
||||||
void IdoPgsqlConnection::NewTransaction(void)
|
void IdoPgsqlConnection::NewTransaction(void)
|
||||||
{
|
{
|
||||||
m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true);
|
m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdoPgsqlConnection::InternalNewTransaction(void)
|
void IdoPgsqlConnection::InternalNewTransaction(void)
|
||||||
@ -172,7 +172,7 @@ void IdoPgsqlConnection::InternalNewTransaction(void)
|
|||||||
|
|
||||||
void IdoPgsqlConnection::ReconnectTimerHandler(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)
|
void IdoPgsqlConnection::Reconnect(void)
|
||||||
@ -395,9 +395,9 @@ void IdoPgsqlConnection::Reconnect(void)
|
|||||||
|
|
||||||
UpdateAllObjects();
|
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::FinishConnect(double startTime)
|
||||||
@ -542,7 +542,7 @@ Dictionary::Ptr IdoPgsqlConnection::FetchRow(const IdoPgsqlResult& result, int r
|
|||||||
|
|
||||||
void IdoPgsqlConnection::ActivateObject(const DbObject::Ptr& dbobj)
|
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::InternalActivateObject(const DbObject::Ptr& dbobj)
|
||||||
@ -576,7 +576,7 @@ void IdoPgsqlConnection::InternalActivateObject(const DbObject::Ptr& dbobj)
|
|||||||
|
|
||||||
void IdoPgsqlConnection::DeactivateObject(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)
|
void IdoPgsqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj)
|
||||||
@ -676,7 +676,7 @@ void IdoPgsqlConnection::ExecuteQuery(const DbQuery& query)
|
|||||||
{
|
{
|
||||||
ASSERT(query.Category != DbCatInvalid);
|
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)
|
void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries)
|
||||||
@ -684,7 +684,7 @@ void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& quer
|
|||||||
if (queries.empty())
|
if (queries.empty())
|
||||||
return;
|
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)
|
bool IdoPgsqlConnection::CanExecuteQuery(const DbQuery& query)
|
||||||
@ -730,7 +730,7 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
|
|||||||
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
|
ASSERT(query.Type == DbQueryNewTransaction || query.Category != DbCatInvalid);
|
||||||
|
|
||||||
if (!CanExecuteQuery(query)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -761,7 +761,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
|
|
||||||
/* check if there are missing object/insert ids and re-enqueue the query */
|
/* check if there are missing object/insert ids and re-enqueue the query */
|
||||||
if (!CanExecuteQuery(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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
|
|
||||||
for (const Dictionary::Pair& kv : query.WhereCriteria) {
|
for (const Dictionary::Pair& kv : query.WhereCriteria) {
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!FieldToEscapedString(kv.first, kv.second, &value)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,7 +908,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, int typeOver
|
|||||||
|
|
||||||
void IdoPgsqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
|
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)
|
void IdoPgsqlConnection::InternalCleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
|
||||||
|
@ -39,7 +39,7 @@ void Demo::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_DemoTimer = new Timer();
|
m_DemoTimer = new Timer();
|
||||||
m_DemoTimer->SetInterval(5);
|
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();
|
m_DemoTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@ boost::signals2::signal<void (const Checkable::Ptr&, const MessageOrigin::Ptr&)>
|
|||||||
void Checkable::StaticInitialize(void)
|
void Checkable::StaticInitialize(void)
|
||||||
{
|
{
|
||||||
/* fixed downtime start */
|
/* fixed downtime start */
|
||||||
Downtime::OnDowntimeStarted.connect(boost::bind(&Checkable::NotifyFixedDowntimeStart, _1));
|
Downtime::OnDowntimeStarted.connect(std::bind(&Checkable::NotifyFixedDowntimeStart, _1));
|
||||||
/* flexible downtime start */
|
/* flexible downtime start */
|
||||||
Downtime::OnDowntimeTriggered.connect(boost::bind(&Checkable::NotifyFlexibleDowntimeStart, _1));
|
Downtime::OnDowntimeTriggered.connect(std::bind(&Checkable::NotifyFlexibleDowntimeStart, _1));
|
||||||
/* fixed/flexible downtime end */
|
/* fixed/flexible downtime end */
|
||||||
Downtime::OnDowntimeRemoved.connect(boost::bind(&Checkable::NotifyDowntimeEnd, _1));
|
Downtime::OnDowntimeRemoved.connect(std::bind(&Checkable::NotifyDowntimeEnd, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Checkable::Checkable(void)
|
Checkable::Checkable(void)
|
||||||
|
@ -45,7 +45,7 @@ void Comment::StaticInitialize(void)
|
|||||||
{
|
{
|
||||||
l_CommentsExpireTimer = new Timer();
|
l_CommentsExpireTimer = new Timer();
|
||||||
l_CommentsExpireTimer->SetInterval(60);
|
l_CommentsExpireTimer->SetInterval(60);
|
||||||
l_CommentsExpireTimer->OnTimerExpired.connect(boost::bind(&Comment::CommentsExpireTimerHandler));
|
l_CommentsExpireTimer->OnTimerExpired.connect(std::bind(&Comment::CommentsExpireTimerHandler));
|
||||||
l_CommentsExpireTimer->Start();
|
l_CommentsExpireTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,12 +49,12 @@ void Downtime::StaticInitialize(void)
|
|||||||
{
|
{
|
||||||
l_DowntimesStartTimer = new Timer();
|
l_DowntimesStartTimer = new Timer();
|
||||||
l_DowntimesStartTimer->SetInterval(5);
|
l_DowntimesStartTimer->SetInterval(5);
|
||||||
l_DowntimesStartTimer->OnTimerExpired.connect(boost::bind(&Downtime::DowntimesStartTimerHandler));
|
l_DowntimesStartTimer->OnTimerExpired.connect(std::bind(&Downtime::DowntimesStartTimerHandler));
|
||||||
l_DowntimesStartTimer->Start();
|
l_DowntimesStartTimer->Start();
|
||||||
|
|
||||||
l_DowntimesExpireTimer = new Timer();
|
l_DowntimesExpireTimer = new Timer();
|
||||||
l_DowntimesExpireTimer->SetInterval(60);
|
l_DowntimesExpireTimer->SetInterval(60);
|
||||||
l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Downtime::DowntimesExpireTimerHandler));
|
l_DowntimesExpireTimer->OnTimerExpired.connect(std::bind(&Downtime::DowntimesExpireTimerHandler));
|
||||||
l_DowntimesExpireTimer->Start();
|
l_DowntimesExpireTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ using namespace icinga;
|
|||||||
|
|
||||||
INITIALIZE_ONCE(&ExternalCommandProcessor::StaticInitialize);
|
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
|
struct ExternalCommandInfo
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "icinga/i2-icinga.hpp"
|
#include "icinga/i2-icinga.hpp"
|
||||||
#include "icinga/command.hpp"
|
#include "icinga/command.hpp"
|
||||||
#include "base/string.hpp"
|
#include "base/string.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <boost/signals2.hpp>
|
#include <boost/signals2.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ int IcingaApplication::Main(void)
|
|||||||
/* periodically dump the program state */
|
/* periodically dump the program state */
|
||||||
l_RetentionTimer = new Timer();
|
l_RetentionTimer = new Timer();
|
||||||
l_RetentionTimer->SetInterval(300);
|
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();
|
l_RetentionTimer->Start();
|
||||||
|
|
||||||
RunEventLoop();
|
RunEventLoop();
|
||||||
@ -166,7 +166,7 @@ void IcingaApplication::DumpModifiedAttributes(void)
|
|||||||
fp.exceptions(std::ofstream::failbit | std::ofstream::badbit);
|
fp.exceptions(std::ofstream::failbit | std::ofstream::badbit);
|
||||||
|
|
||||||
ConfigObject::Ptr previousObject;
|
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) {
|
if (previousObject) {
|
||||||
ConfigWriter::EmitRaw(fp, "\tobj.version = ");
|
ConfigWriter::EmitRaw(fp, "\tobj.version = ");
|
||||||
|
@ -215,10 +215,10 @@ Value MacroProcessor::EvaluateFunction(const Function::Ptr& func, const Resolver
|
|||||||
resolvers_this->Set(resolver.first, resolver.second);
|
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,
|
_1, boost::cref(resolvers), cr, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros,
|
||||||
recursionLevel + 1), { "str" }));
|
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,
|
_1, boost::cref(resolvers), cr, resolvedMacros, useResolvedMacros,
|
||||||
recursionLevel + 1)));
|
recursionLevel + 1)));
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "icinga/i2-icinga.hpp"
|
#include "icinga/i2-icinga.hpp"
|
||||||
#include "icinga/checkable.hpp"
|
#include "icinga/checkable.hpp"
|
||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
@ -37,7 +36,7 @@ namespace icinga
|
|||||||
class I2_ICINGA_API MacroProcessor
|
class I2_ICINGA_API MacroProcessor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::function<Value (const Value&)> EscapeCallback;
|
typedef std::function<Value (const Value&)> EscapeCallback;
|
||||||
typedef std::pair<String, Object::Ptr> ResolverSpec;
|
typedef std::pair<String, Object::Ptr> ResolverSpec;
|
||||||
typedef std::vector<ResolverSpec> ResolverList;
|
typedef std::vector<ResolverSpec> ResolverList;
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
|
|||||||
<< "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '"
|
<< "Sending " << (reminder ? "reminder " : "") << "'" << NotificationTypeToStringInternal(type) << "' notification '"
|
||||||
<< GetName() << "' for user '" << userName << "'";
|
<< 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 */
|
/* collect all notified users */
|
||||||
allNotifiedUsers.insert(user);
|
allNotifiedUsers.insert(user);
|
||||||
|
@ -35,7 +35,7 @@ using namespace icinga;
|
|||||||
void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
|
void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
|
||||||
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
|
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
|
||||||
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros,
|
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();
|
Value raw_command = commandObj->GetCommandLine();
|
||||||
Dictionary::Ptr raw_arguments = commandObj->GetArguments();
|
Dictionary::Ptr raw_arguments = commandObj->GetArguments();
|
||||||
@ -95,7 +95,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
|
|||||||
|
|
||||||
process->SetAdjustPriority(true);
|
process->SetAdjustPriority(true);
|
||||||
|
|
||||||
process->Run(boost::bind(callback, command, _1));
|
process->Run(std::bind(callback, command, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceState PluginUtility::ExitStatusToState(int exitStatus)
|
ServiceState PluginUtility::ExitStatusToState(int exitStatus)
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
|
static void ExecuteCommand(const Command::Ptr& commandObj, const Checkable::Ptr& checkable,
|
||||||
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
|
const CheckResult::Ptr& cr, const MacroProcessor::ResolverList& macroResolvers,
|
||||||
const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros,
|
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 ServiceState ExitStatusToState(int exitStatus);
|
||||||
static std::pair<String, String> ParseCheckOutput(const String& output);
|
static std::pair<String, String> ParseCheckOutput(const String& output);
|
||||||
|
@ -83,7 +83,7 @@ void ScheduledDowntime::StaticInitialize(void)
|
|||||||
{
|
{
|
||||||
l_Timer = new Timer();
|
l_Timer = new Timer();
|
||||||
l_Timer->SetInterval(60);
|
l_Timer->SetInterval(60);
|
||||||
l_Timer->OnTimerExpired.connect(boost::bind(&ScheduledDowntime::TimerProc));
|
l_Timer->OnTimerExpired.connect(std::bind(&ScheduledDowntime::TimerProc));
|
||||||
l_Timer->Start();
|
l_Timer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void ScheduledDowntime::Start(bool runtimeCreated)
|
|||||||
{
|
{
|
||||||
ObjectImpl<ScheduledDowntime>::Start(runtimeCreated);
|
ObjectImpl<ScheduledDowntime>::Start(runtimeCreated);
|
||||||
|
|
||||||
Utility::QueueAsyncCallback(boost::bind(&ScheduledDowntime::CreateNextDowntime, this));
|
Utility::QueueAsyncCallback(std::bind(&ScheduledDowntime::CreateNextDowntime, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduledDowntime::TimerProc(void)
|
void ScheduledDowntime::TimerProc(void)
|
||||||
|
@ -39,7 +39,7 @@ void TimePeriod::StaticInitialize(void)
|
|||||||
{
|
{
|
||||||
l_UpdateTimer = new Timer();
|
l_UpdateTimer = new Timer();
|
||||||
l_UpdateTimer->SetInterval(300);
|
l_UpdateTimer->SetInterval(300);
|
||||||
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
|
l_UpdateTimer->OnTimerExpired.connect(std::bind(&TimePeriod::UpdateTimerHandler));
|
||||||
l_UpdateTimer->Start();
|
l_UpdateTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Value Column::ExtractValue(const Value& urow, LivestatusGroupByType groupByType,
|
|||||||
{
|
{
|
||||||
Value row;
|
Value row;
|
||||||
|
|
||||||
if (!m_ObjectAccessor.empty())
|
if (m_ObjectAccessor)
|
||||||
row = m_ObjectAccessor(urow, groupByType, groupByObject);
|
row = m_ObjectAccessor(urow, groupByType, groupByObject);
|
||||||
else
|
else
|
||||||
row = urow;
|
row = urow;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "livestatus/i2-livestatus.hpp"
|
#include "livestatus/i2-livestatus.hpp"
|
||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -38,8 +37,8 @@ enum LivestatusGroupByType {
|
|||||||
class I2_LIVESTATUS_API Column
|
class I2_LIVESTATUS_API Column
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::function<Value (const Value&)> ValueAccessor;
|
typedef std::function<Value (const Value&)> ValueAccessor;
|
||||||
typedef boost::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
|
typedef std::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
|
||||||
|
|
||||||
Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor);
|
Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor);
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ void CommentsTable::AddColumns(Table *table, const String& prefix,
|
|||||||
table->AddColumn(prefix + "expire_time", Column(&CommentsTable::ExpireTimeAccessor, objectAccessor));
|
table->AddColumn(prefix + "expire_time", Column(&CommentsTable::ExpireTimeAccessor, objectAccessor));
|
||||||
|
|
||||||
/* order is important - host w/o services must not be empty */
|
/* order is important - host w/o services must not be empty */
|
||||||
ServicesTable::AddColumns(table, "service_", boost::bind(&CommentsTable::ServiceAccessor, _1, objectAccessor));
|
ServicesTable::AddColumns(table, "service_", std::bind(&CommentsTable::ServiceAccessor, _1, objectAccessor));
|
||||||
HostsTable::AddColumns(table, "host_", boost::bind(&CommentsTable::HostAccessor, _1, objectAccessor));
|
HostsTable::AddColumns(table, "host_", std::bind(&CommentsTable::HostAccessor, _1, objectAccessor));
|
||||||
}
|
}
|
||||||
|
|
||||||
String CommentsTable::GetName(void) const
|
String CommentsTable::GetName(void) const
|
||||||
|
@ -48,8 +48,8 @@ void DowntimesTable::AddColumns(Table *table, const String& prefix,
|
|||||||
table->AddColumn(prefix + "triggered_by", Column(&DowntimesTable::TriggeredByAccessor, objectAccessor));
|
table->AddColumn(prefix + "triggered_by", Column(&DowntimesTable::TriggeredByAccessor, objectAccessor));
|
||||||
|
|
||||||
/* order is important - host w/o services must not be empty */
|
/* order is important - host w/o services must not be empty */
|
||||||
ServicesTable::AddColumns(table, "service_", boost::bind(&DowntimesTable::ServiceAccessor, _1, objectAccessor));
|
ServicesTable::AddColumns(table, "service_", std::bind(&DowntimesTable::ServiceAccessor, _1, objectAccessor));
|
||||||
HostsTable::AddColumns(table, "host_", boost::bind(&DowntimesTable::HostAccessor, _1, objectAccessor));
|
HostsTable::AddColumns(table, "host_", std::bind(&DowntimesTable::HostAccessor, _1, objectAccessor));
|
||||||
}
|
}
|
||||||
|
|
||||||
String DowntimesTable::GetName(void) const
|
String DowntimesTable::GetName(void) const
|
||||||
|
@ -170,7 +170,7 @@ void HostsTable::AddColumns(Table *table, const String& prefix,
|
|||||||
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
||||||
Log(LogDebug, "Livestatus")
|
Log(LogDebug, "Livestatus")
|
||||||
<< "Processing hosts group by hostgroup table.";
|
<< "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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ void LivestatusListener::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_Listener = socket;
|
m_Listener = socket;
|
||||||
|
|
||||||
m_Thread = boost::thread(boost::bind(&LivestatusListener::ServerThreadProc, this));
|
m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
|
||||||
|
|
||||||
Log(LogInformation, "LivestatusListener")
|
Log(LogInformation, "LivestatusListener")
|
||||||
<< "Created TCP socket listening on host '" << GetBindHost() << "' port '" << GetBindPort() << "'.";
|
<< "Created TCP socket listening on host '" << GetBindHost() << "' port '" << GetBindPort() << "'.";
|
||||||
@ -110,7 +110,7 @@ void LivestatusListener::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_Listener = socket;
|
m_Listener = socket;
|
||||||
|
|
||||||
m_Thread = boost::thread(boost::bind(&LivestatusListener::ServerThreadProc, this));
|
m_Thread = boost::thread(std::bind(&LivestatusListener::ServerThreadProc, this));
|
||||||
|
|
||||||
Log(LogInformation, "LivestatusListener")
|
Log(LogInformation, "LivestatusListener")
|
||||||
<< "Created UNIX socket in '" << GetSocketPath() << "'.";
|
<< "Created UNIX socket in '" << GetSocketPath() << "'.";
|
||||||
@ -160,7 +160,7 @@ void LivestatusListener::ServerThreadProc(void)
|
|||||||
if (m_Listener->Poll(true, false, &tv)) {
|
if (m_Listener->Poll(true, false, &tv)) {
|
||||||
Socket::Ptr client = m_Listener->Accept();
|
Socket::Ptr client = m_Listener->Accept();
|
||||||
Log(LogNotice, "LivestatusListener", "Client connected");
|
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())
|
if (!IsActive())
|
||||||
|
@ -39,8 +39,8 @@ using namespace icinga;
|
|||||||
|
|
||||||
void LivestatusLogUtility::CreateLogIndex(const String& path, std::map<time_t, String>& index)
|
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 + "/icinga.log", std::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 + "/archives/*.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LivestatusLogUtility::CreateLogIndexFileHandler(const String& path, std::map<time_t, String>& index)
|
void LivestatusLogUtility::CreateLogIndexFileHandler(const String& path, std::map<time_t, String>& index)
|
||||||
|
@ -75,10 +75,10 @@ void LogTable::AddColumns(Table *table, const String& prefix,
|
|||||||
table->AddColumn(prefix + "contact_name", Column(&LogTable::ContactNameAccessor, objectAccessor));
|
table->AddColumn(prefix + "contact_name", Column(&LogTable::ContactNameAccessor, objectAccessor));
|
||||||
table->AddColumn(prefix + "command_name", Column(&LogTable::CommandNameAccessor, objectAccessor));
|
table->AddColumn(prefix + "command_name", Column(&LogTable::CommandNameAccessor, objectAccessor));
|
||||||
|
|
||||||
HostsTable::AddColumns(table, "current_host_", boost::bind(&LogTable::HostAccessor, _1, objectAccessor));
|
HostsTable::AddColumns(table, "current_host_", std::bind(&LogTable::HostAccessor, _1, objectAccessor));
|
||||||
ServicesTable::AddColumns(table, "current_service_", boost::bind(&LogTable::ServiceAccessor, _1, objectAccessor));
|
ServicesTable::AddColumns(table, "current_service_", std::bind(&LogTable::ServiceAccessor, _1, objectAccessor));
|
||||||
ContactsTable::AddColumns(table, "current_contact_", boost::bind(&LogTable::ContactAccessor, _1, objectAccessor));
|
ContactsTable::AddColumns(table, "current_contact_", std::bind(&LogTable::ContactAccessor, _1, objectAccessor));
|
||||||
CommandsTable::AddColumns(table, "current_command_", boost::bind(&LogTable::CommandAccessor, _1, objectAccessor));
|
CommandsTable::AddColumns(table, "current_command_", std::bind(&LogTable::CommandAccessor, _1, objectAccessor));
|
||||||
}
|
}
|
||||||
|
|
||||||
String LogTable::GetName(void) const
|
String LogTable::GetName(void) const
|
||||||
|
@ -138,19 +138,19 @@ void ServicesTable::AddColumns(Table *table, const String& prefix,
|
|||||||
table->AddColumn(prefix + "cv_is_json", Column(&ServicesTable::CVIsJsonAccessor, objectAccessor));
|
table->AddColumn(prefix + "cv_is_json", Column(&ServicesTable::CVIsJsonAccessor, objectAccessor));
|
||||||
table->AddColumn(prefix + "original_attributes", Column(&ServicesTable::OriginalAttributesAccessor, 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 */
|
/* add additional group by values received through the object accessor */
|
||||||
if (table->GetGroupByType() == LivestatusGroupByServiceGroup) {
|
if (table->GetGroupByType() == LivestatusGroupByServiceGroup) {
|
||||||
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
||||||
Log(LogDebug, "Livestatus")
|
Log(LogDebug, "Livestatus")
|
||||||
<< "Processing services group by servicegroup table.";
|
<< "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) {
|
} else if (table->GetGroupByType() == LivestatusGroupByHostGroup) {
|
||||||
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
/* _1 = row, _2 = groupByType, _3 = groupByObject */
|
||||||
Log(LogDebug, "Livestatus")
|
Log(LogDebug, "Livestatus")
|
||||||
<< "Processing services group by hostgroup table.";
|
<< "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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,8 +240,8 @@ void StateHistTable::AddColumns(Table *table, const String& prefix,
|
|||||||
table->AddColumn(prefix + "duration_unmonitored", Column(&StateHistTable::DurationUnmonitoredAccessor, objectAccessor));
|
table->AddColumn(prefix + "duration_unmonitored", Column(&StateHistTable::DurationUnmonitoredAccessor, objectAccessor));
|
||||||
table->AddColumn(prefix + "duration_part_unmonitored", Column(&StateHistTable::DurationPartUnmonitoredAccessor, objectAccessor));
|
table->AddColumn(prefix + "duration_part_unmonitored", Column(&StateHistTable::DurationPartUnmonitoredAccessor, objectAccessor));
|
||||||
|
|
||||||
HostsTable::AddColumns(table, "current_host_", boost::bind(&StateHistTable::HostAccessor, _1, objectAccessor));
|
HostsTable::AddColumns(table, "current_host_", std::bind(&StateHistTable::HostAccessor, _1, objectAccessor));
|
||||||
ServicesTable::AddColumns(table, "current_service_", boost::bind(&StateHistTable::ServiceAccessor, _1, objectAccessor));
|
ServicesTable::AddColumns(table, "current_service_", std::bind(&StateHistTable::ServiceAccessor, _1, objectAccessor));
|
||||||
}
|
}
|
||||||
|
|
||||||
String StateHistTable::GetName(void) const
|
String StateHistTable::GetName(void) const
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include <boost/algorithm/string/case_conv.hpp>
|
#include <boost/algorithm/string/case_conv.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -129,7 +128,7 @@ std::vector<LivestatusRowValue> Table::FilterRows(const Filter::Ptr& filter, int
|
|||||||
{
|
{
|
||||||
std::vector<LivestatusRowValue> rs;
|
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;
|
return rs;
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,7 @@ struct LivestatusRowValue {
|
|||||||
Value GroupByObject;
|
Value GroupByObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::function<bool (const Value&, LivestatusGroupByType, const Object::Ptr&)> AddRowFunction;
|
||||||
typedef boost::function<bool (const Value&, LivestatusGroupByType, const Object::Ptr&)> AddRowFunction;
|
|
||||||
|
|
||||||
class Filter;
|
class Filter;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
|
|||||||
|
|
||||||
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
|
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
|
||||||
resolvers, resolvedMacros, useResolvedMacros,
|
resolvers, resolvedMacros, useResolvedMacros,
|
||||||
boost::bind(&PluginCheckTask::ProcessFinishedHandler, checkable, cr, _1, _2));
|
std::bind(&PluginCheckTask::ProcessFinishedHandler, checkable, cr, _1, _2));
|
||||||
|
|
||||||
if (!resolvedMacros || useResolvedMacros)
|
if (!resolvedMacros || useResolvedMacros)
|
||||||
Checkable::IncreasePendingChecks();
|
Checkable::IncreasePendingChecks();
|
||||||
|
@ -51,7 +51,7 @@ void PluginEventTask::ScriptFunc(const Checkable::Ptr& checkable,
|
|||||||
|
|
||||||
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
|
PluginUtility::ExecuteCommand(commandObj, checkable, checkable->GetLastCheckResult(),
|
||||||
resolvers, resolvedMacros, useResolvedMacros,
|
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)
|
void PluginEventTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& commandLine, const ProcessResult& pr)
|
||||||
|
@ -66,7 +66,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification,
|
|||||||
|
|
||||||
PluginUtility::ExecuteCommand(commandObj, checkable, cr, resolvers,
|
PluginUtility::ExecuteCommand(commandObj, checkable, cr, resolvers,
|
||||||
resolvedMacros, useResolvedMacros,
|
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)
|
void PluginNotificationTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& commandLine, const ProcessResult& pr)
|
||||||
|
@ -55,12 +55,12 @@ void NotificationComponent::Start(bool runtimeCreated)
|
|||||||
Log(LogInformation, "NotificationComponent")
|
Log(LogInformation, "NotificationComponent")
|
||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
|
Checkable::OnNotificationsRequested.connect(std::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
|
||||||
_2, _3, _4, _5));
|
_2, _3, _4, _5));
|
||||||
|
|
||||||
m_NotificationTimer = new Timer();
|
m_NotificationTimer = new Timer();
|
||||||
m_NotificationTimer->SetInterval(5);
|
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();
|
m_NotificationTimer->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "base/exception.hpp"
|
#include "base/exception.hpp"
|
||||||
#include "base/statsfunction.hpp"
|
#include "base/statsfunction.hpp"
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -83,19 +84,19 @@ void ElasticsearchWriter::Start(bool runtimeCreated)
|
|||||||
Log(LogInformation, "ElasticsearchWriter")
|
Log(LogInformation, "ElasticsearchWriter")
|
||||||
<< "'" << GetName() << "' started.";
|
<< "'" << 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 */
|
/* Setup timer for periodically flushing m_DataBuffer */
|
||||||
m_FlushTimer = new Timer();
|
m_FlushTimer = new Timer();
|
||||||
m_FlushTimer->SetInterval(GetFlushInterval());
|
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->Start();
|
||||||
m_FlushTimer->Reschedule(0);
|
m_FlushTimer->Reschedule(0);
|
||||||
|
|
||||||
/* Register for new metrics. */
|
/* Register for new metrics. */
|
||||||
Checkable::OnNewCheckResult.connect(boost::bind(&ElasticsearchWriter::CheckResultHandler, this, _1, _2));
|
Checkable::OnNewCheckResult.connect(std::bind(&ElasticsearchWriter::CheckResultHandler, this, _1, _2));
|
||||||
Checkable::OnStateChange.connect(boost::bind(&ElasticsearchWriter::StateChangeHandler, this, _1, _2, _3));
|
Checkable::OnStateChange.connect(std::bind(&ElasticsearchWriter::StateChangeHandler, this, _1, _2, _3));
|
||||||
Checkable::OnNotificationSentToAllUsers.connect(boost::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandler, this, _1, _2, _3, _4, _5, _6, _7));
|
Checkable::OnNotificationSentToAllUsers.connect(std::bind(&ElasticsearchWriter::NotificationSentToAllUsersHandler, this, _1, _2, _3, _4, _5, _6, _7));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElasticsearchWriter::Stop(bool runtimeRemoved)
|
void ElasticsearchWriter::Stop(bool runtimeRemoved)
|
||||||
@ -175,7 +176,7 @@ void ElasticsearchWriter::AddCheckResult(const Dictionary::Ptr& fields, const Ch
|
|||||||
|
|
||||||
void ElasticsearchWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
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::InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
||||||
@ -229,7 +230,7 @@ void ElasticsearchWriter::InternalCheckResultHandler(const Checkable::Ptr& check
|
|||||||
|
|
||||||
void ElasticsearchWriter::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
|
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)
|
void ElasticsearchWriter::StateChangeHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
|
||||||
@ -278,7 +279,7 @@ void ElasticsearchWriter::NotificationSentToAllUsersHandler(const Notification::
|
|||||||
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
|
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
|
||||||
const CheckResult::Ptr& cr, const String& author, const String& text)
|
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));
|
notification, checkable, users, type, cr, author, text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,19 +87,19 @@ void GelfWriter::Start(bool runtimeCreated)
|
|||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
/* Register exception handler for WQ tasks. */
|
/* 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 */
|
/* Timer for reconnecting */
|
||||||
m_ReconnectTimer = new Timer();
|
m_ReconnectTimer = new Timer();
|
||||||
m_ReconnectTimer->SetInterval(10);
|
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->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
m_ReconnectTimer->Reschedule(0);
|
||||||
|
|
||||||
/* Register event handlers. */
|
/* Register event handlers. */
|
||||||
Checkable::OnNewCheckResult.connect(boost::bind(&GelfWriter::CheckResultHandler, this, _1, _2));
|
Checkable::OnNewCheckResult.connect(std::bind(&GelfWriter::CheckResultHandler, this, _1, _2));
|
||||||
Checkable::OnNotificationSentToUser.connect(boost::bind(&GelfWriter::NotificationToUserHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
|
Checkable::OnNotificationSentToUser.connect(std::bind(&GelfWriter::NotificationToUserHandler, this, _1, _2, _3, _4, _5, _6, _7, _8));
|
||||||
Checkable::OnStateChange.connect(boost::bind(&GelfWriter::StateChangeHandler, this, _1, _2, _3));
|
Checkable::OnStateChange.connect(std::bind(&GelfWriter::StateChangeHandler, this, _1, _2, _3));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GelfWriter::Stop(bool runtimeRemoved)
|
void GelfWriter::Stop(bool runtimeRemoved)
|
||||||
@ -167,7 +167,7 @@ void GelfWriter::Reconnect(void)
|
|||||||
|
|
||||||
void GelfWriter::ReconnectTimerHandler(void)
|
void GelfWriter::ReconnectTimerHandler(void)
|
||||||
{
|
{
|
||||||
m_WorkQueue.Enqueue(boost::bind(&GelfWriter::Reconnect, this), PriorityNormal);
|
m_WorkQueue.Enqueue(std::bind(&GelfWriter::Reconnect, this), PriorityNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GelfWriter::Disconnect(void)
|
void GelfWriter::Disconnect(void)
|
||||||
@ -184,7 +184,7 @@ void GelfWriter::Disconnect(void)
|
|||||||
|
|
||||||
void GelfWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
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)
|
void GelfWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
||||||
@ -284,7 +284,7 @@ void GelfWriter::NotificationToUserHandler(const Notification::Ptr& notification
|
|||||||
const User::Ptr& user, NotificationType notificationType, CheckResult::Ptr const& cr,
|
const User::Ptr& user, NotificationType notificationType, CheckResult::Ptr const& cr,
|
||||||
const String& author, const String& commentText, const String& commandName)
|
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));
|
notification, checkable, user, notificationType, cr, author, commentText, commandName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ void GelfWriter::NotificationToUserHandlerInternal(const Notification::Ptr& noti
|
|||||||
|
|
||||||
void GelfWriter::StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
|
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)
|
void GelfWriter::StateChangeHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type)
|
||||||
|
@ -86,17 +86,17 @@ void GraphiteWriter::Start(bool runtimeCreated)
|
|||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
/* Register exception handler for WQ tasks. */
|
/* 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 */
|
/* Timer for reconnecting */
|
||||||
m_ReconnectTimer = new Timer();
|
m_ReconnectTimer = new Timer();
|
||||||
m_ReconnectTimer->SetInterval(10);
|
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->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
m_ReconnectTimer->Reschedule(0);
|
||||||
|
|
||||||
/* Register event handlers. */
|
/* 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::Stop(bool runtimeRemoved)
|
||||||
@ -164,7 +164,7 @@ void GraphiteWriter::Reconnect(void)
|
|||||||
|
|
||||||
void GraphiteWriter::ReconnectTimerHandler(void)
|
void GraphiteWriter::ReconnectTimerHandler(void)
|
||||||
{
|
{
|
||||||
m_WorkQueue.Enqueue(boost::bind(&GraphiteWriter::Reconnect, this), PriorityNormal);
|
m_WorkQueue.Enqueue(std::bind(&GraphiteWriter::Reconnect, this), PriorityNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphiteWriter::Disconnect(void)
|
void GraphiteWriter::Disconnect(void)
|
||||||
@ -181,7 +181,7 @@ void GraphiteWriter::Disconnect(void)
|
|||||||
|
|
||||||
void GraphiteWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
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)
|
void GraphiteWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
||||||
@ -206,9 +206,9 @@ void GraphiteWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable,
|
|||||||
String prefix;
|
String prefix;
|
||||||
|
|
||||||
if (service) {
|
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 {
|
} 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";
|
String prefixPerfdata = prefix + ".perfdata";
|
||||||
|
@ -96,17 +96,17 @@ void InfluxdbWriter::Start(bool runtimeCreated)
|
|||||||
<< "'" << GetName() << "' started.";
|
<< "'" << GetName() << "' started.";
|
||||||
|
|
||||||
/* Register exception handler for WQ tasks. */
|
/* 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 */
|
/* Setup timer for periodically flushing m_DataBuffer */
|
||||||
m_FlushTimer = new Timer();
|
m_FlushTimer = new Timer();
|
||||||
m_FlushTimer->SetInterval(GetFlushInterval());
|
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->Start();
|
||||||
m_FlushTimer->Reschedule(0);
|
m_FlushTimer->Reschedule(0);
|
||||||
|
|
||||||
/* Register for new metrics. */
|
/* 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::Stop(bool runtimeRemoved)
|
||||||
@ -176,7 +176,7 @@ Stream::Ptr InfluxdbWriter::Connect()
|
|||||||
|
|
||||||
void InfluxdbWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
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)
|
void InfluxdbWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
|
||||||
|
@ -66,11 +66,11 @@ void OpenTsdbWriter::Start(bool runtimeCreated)
|
|||||||
|
|
||||||
m_ReconnectTimer = new Timer();
|
m_ReconnectTimer = new Timer();
|
||||||
m_ReconnectTimer->SetInterval(10);
|
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->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
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)
|
void OpenTsdbWriter::Stop(bool runtimeRemoved)
|
||||||
|
@ -56,10 +56,10 @@ void PerfdataWriter::Start(bool runtimeCreated)
|
|||||||
Log(LogInformation, "PerfdataWriter")
|
Log(LogInformation, "PerfdataWriter")
|
||||||
<< "'" << GetName() << "' started.";
|
<< "'" << 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 = 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->SetInterval(GetRotationInterval());
|
||||||
m_RotationTimer->Start();
|
m_RotationTimer->Start();
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include "base/configobject.hpp"
|
#include "base/configobject.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/function.hpp>
|
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
#include <boost/algorithm/string/classification.hpp>
|
#include <boost/algorithm/string/classification.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/algorithm/string/split.hpp>
|
||||||
@ -44,7 +43,7 @@ class I2_REMOTE_API ApiAction : public Object
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(ApiAction);
|
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);
|
ApiAction(const std::vector<String>& registerTypes, const Callback& function);
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ void ApiClient::GetTypes(const TypesCompletionCallback& callback) const
|
|||||||
req->RequestUrl = url;
|
req->RequestUrl = url;
|
||||||
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
||||||
req->AddHeader("Accept", "application/json");
|
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) {
|
} catch (const std::exception& ex) {
|
||||||
callback(boost::current_exception(), std::vector<ApiType::Ptr>());
|
callback(boost::current_exception(), std::vector<ApiType::Ptr>());
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ void ApiClient::GetObjects(const String& pluralType, const ObjectsCompletionCall
|
|||||||
req->RequestUrl = url;
|
req->RequestUrl = url;
|
||||||
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
||||||
req->AddHeader("Accept", "application/json");
|
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) {
|
} catch (const std::exception& ex) {
|
||||||
callback(boost::current_exception(), std::vector<ApiObject::Ptr>());
|
callback(boost::current_exception(), std::vector<ApiObject::Ptr>());
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ void ApiClient::ExecuteScript(const String& session, const String& command, bool
|
|||||||
req->RequestUrl = url;
|
req->RequestUrl = url;
|
||||||
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
||||||
req->AddHeader("Accept", "application/json");
|
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) {
|
} catch (const std::exception& ex) {
|
||||||
callback(boost::current_exception(), Empty);
|
callback(boost::current_exception(), Empty);
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ void ApiClient::AutocompleteScript(const String& session, const String& command,
|
|||||||
req->RequestUrl = url;
|
req->RequestUrl = url;
|
||||||
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
|
||||||
req->AddHeader("Accept", "application/json");
|
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) {
|
} catch (const std::exception& ex) {
|
||||||
callback(boost::current_exception(), Array::Ptr());
|
callback(boost::current_exception(), Array::Ptr());
|
||||||
}
|
}
|
||||||
|
@ -92,20 +92,20 @@ public:
|
|||||||
ApiClient(const String& host, const String& port,
|
ApiClient(const String& host, const String& port,
|
||||||
const String& user, const String& password);
|
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;
|
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,
|
void GetObjects(const String& pluralType, const ObjectsCompletionCallback& callback,
|
||||||
const std::vector<String>& names = std::vector<String>(),
|
const std::vector<String>& names = std::vector<String>(),
|
||||||
const std::vector<String>& attrs = std::vector<String>(),
|
const std::vector<String>& attrs = std::vector<String>(),
|
||||||
const std::vector<String>& joins = std::vector<String>(), bool all_joins = false) const;
|
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,
|
void ExecuteScript(const String& session, const String& command, bool sandboxed,
|
||||||
const ExecuteScriptCompletionCallback& callback) const;
|
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,
|
void AutocompleteScript(const String& session, const String& command, bool sandboxed,
|
||||||
const AutocompleteScriptCompletionCallback& callback) const;
|
const AutocompleteScriptCompletionCallback& callback) const;
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include "base/dictionary.hpp"
|
#include "base/dictionary.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/function.hpp>
|
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -41,7 +40,7 @@ class I2_REMOTE_API ApiFunction : public Object
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(ApiFunction);
|
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);
|
ApiFunction(const Callback& function);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ ConfigDirInformation ApiListener::LoadConfigDir(const String& dir)
|
|||||||
ConfigDirInformation config;
|
ConfigDirInformation config;
|
||||||
config.UpdateV1 = new Dictionary();
|
config.UpdateV1 = new Dictionary();
|
||||||
config.UpdateV2 = 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;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,24 +233,24 @@ void ApiListener::Start(bool runtimeCreated)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_Timer = new Timer();
|
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->SetInterval(5);
|
||||||
m_Timer->Start();
|
m_Timer->Start();
|
||||||
m_Timer->Reschedule(0);
|
m_Timer->Reschedule(0);
|
||||||
|
|
||||||
m_ReconnectTimer = new Timer();
|
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->SetInterval(60);
|
||||||
m_ReconnectTimer->Start();
|
m_ReconnectTimer->Start();
|
||||||
m_ReconnectTimer->Reschedule(0);
|
m_ReconnectTimer->Reschedule(0);
|
||||||
|
|
||||||
m_AuthorityTimer = new Timer();
|
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->SetInterval(30);
|
||||||
m_AuthorityTimer->Start();
|
m_AuthorityTimer->Start();
|
||||||
|
|
||||||
m_CleanupCertificateRequestsTimer = new Timer();
|
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->SetInterval(3600);
|
||||||
m_CleanupCertificateRequestsTimer->Start();
|
m_CleanupCertificateRequestsTimer->Start();
|
||||||
m_CleanupCertificateRequestsTimer->Reschedule(0);
|
m_CleanupCertificateRequestsTimer->Reschedule(0);
|
||||||
@ -332,7 +332,7 @@ bool ApiListener::AddListener(const String& node, const String& service)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::thread thread(boost::bind(&ApiListener::ListenerThreadProc, this, server));
|
boost::thread thread(std::bind(&ApiListener::ListenerThreadProc, this, server));
|
||||||
thread.detach();
|
thread.detach();
|
||||||
|
|
||||||
m_Servers.insert(server);
|
m_Servers.insert(server);
|
||||||
@ -349,7 +349,7 @@ void ApiListener::ListenerThreadProc(const Socket::Ptr& server)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
try {
|
try {
|
||||||
Socket::Ptr client = server->Accept();
|
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();
|
thread.detach();
|
||||||
} catch (const std::exception&) {
|
} catch (const std::exception&) {
|
||||||
Log(LogCritical, "ApiListener", "Cannot accept new connection.");
|
Log(LogCritical, "ApiListener", "Cannot accept new connection.");
|
||||||
@ -539,7 +539,7 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
|
|||||||
|
|
||||||
endpoint->AddClient(aclient);
|
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
|
} else
|
||||||
AddAnonymousClient(aclient);
|
AddAnonymousClient(aclient);
|
||||||
} else {
|
} else {
|
||||||
@ -571,7 +571,7 @@ void ApiListener::SyncClient(const JsonRpcConnection::Ptr& aclient, const Endpoi
|
|||||||
JsonRpcConnection::SendCertificateRequest(aclient, MessageOrigin::Ptr(), String());
|
JsonRpcConnection::SendCertificateRequest(aclient, MessageOrigin::Ptr(), String());
|
||||||
|
|
||||||
if (Utility::PathExists(ApiListener::GetCertificateRequestsDir()))
|
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
|
/* Make sure that the config updates are synced
|
||||||
@ -631,7 +631,7 @@ void ApiListener::ApiTimerHandler(void)
|
|||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
|
|
||||||
std::vector<int> files;
|
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());
|
std::sort(files.begin(), files.end());
|
||||||
|
|
||||||
for (int ts : files) {
|
for (int ts : files) {
|
||||||
@ -744,7 +744,7 @@ void ApiListener::ApiReconnectTimerHandler(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
|
boost::thread thread(std::bind(&ApiListener::AddConnection, this, endpoint));
|
||||||
thread.detach();
|
thread.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -787,7 +787,7 @@ void ApiListener::CleanupCertificateRequestsTimerHandler(void)
|
|||||||
if (Utility::PathExists(requestsDir)) {
|
if (Utility::PathExists(requestsDir)) {
|
||||||
/* remove certificate requests that are older than a week */
|
/* remove certificate requests that are older than a week */
|
||||||
double expiryTime = Utility::GetTime() - 7 * 24 * 60 * 60;
|
double expiryTime = Utility::GetTime() - 7 * 24 * 60 * 60;
|
||||||
Utility::Glob(requestsDir + "/*.json", boost::bind(&CleanupCertificateRequest, _1, expiryTime), GlobFile);
|
Utility::Glob(requestsDir + "/*.json", std::bind(&CleanupCertificateRequest, _1, expiryTime), GlobFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +797,7 @@ void ApiListener::RelayMessage(const MessageOrigin::Ptr& origin,
|
|||||||
if (!IsActive())
|
if (!IsActive())
|
||||||
return;
|
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)
|
void ApiListener::PersistMessage(const Dictionary::Ptr& message, const ConfigObject::Ptr& secobj)
|
||||||
@ -1090,7 +1090,7 @@ void ApiListener::ReplayLog(const JsonRpcConnection::Ptr& client)
|
|||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
std::vector<int> files;
|
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());
|
std::sort(files.begin(), files.end());
|
||||||
|
|
||||||
for (int ts : files) {
|
for (int ts : files) {
|
||||||
|
@ -59,7 +59,7 @@ void ConfigPackageUtility::DeletePackage(const String& name)
|
|||||||
std::vector<String> ConfigPackageUtility::GetPackages(void)
|
std::vector<String> ConfigPackageUtility::GetPackages(void)
|
||||||
{
|
{
|
||||||
std::vector<String> packages;
|
std::vector<String> packages;
|
||||||
Utility::Glob(GetPackageDir() + "/*", boost::bind(&ConfigPackageUtility::CollectDirNames,
|
Utility::Glob(GetPackageDir() + "/*", std::bind(&ConfigPackageUtility::CollectDirNames,
|
||||||
_1, boost::ref(packages)), GlobDirectory);
|
_1, boost::ref(packages)), GlobDirectory);
|
||||||
return packages;
|
return packages;
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ void ConfigPackageUtility::AsyncTryActivateStage(const String& packageName, cons
|
|||||||
|
|
||||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||||
process->SetTimeout(300);
|
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)
|
void ConfigPackageUtility::DeleteStage(const String& packageName, const String& stageName)
|
||||||
@ -237,7 +237,7 @@ void ConfigPackageUtility::DeleteStage(const String& packageName, const String&
|
|||||||
std::vector<String> ConfigPackageUtility::GetStages(const String& packageName)
|
std::vector<String> ConfigPackageUtility::GetStages(const String& packageName)
|
||||||
{
|
{
|
||||||
std::vector<String> stages;
|
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;
|
return stages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ String ConfigPackageUtility::GetActiveStage(const String& packageName)
|
|||||||
std::vector<std::pair<String, bool> > ConfigPackageUtility::GetFiles(const String& packageName, const String& stageName)
|
std::vector<std::pair<String, bool> > ConfigPackageUtility::GetFiles(const String& packageName, const String& stageName)
|
||||||
{
|
{
|
||||||
std::vector<std::pair<String, bool> > paths;
|
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;
|
return paths;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ static void ScriptFrameCleanupHandler(void)
|
|||||||
|
|
||||||
INITIALIZE_ONCE([]() {
|
INITIALIZE_ONCE([]() {
|
||||||
l_FrameCleanupTimer = new Timer();
|
l_FrameCleanupTimer = new Timer();
|
||||||
l_FrameCleanupTimer->OnTimerExpired.connect(boost::bind(ScriptFrameCleanupHandler));
|
l_FrameCleanupTimer->OnTimerExpired.connect(std::bind(ScriptFrameCleanupHandler));
|
||||||
l_FrameCleanupTimer->SetInterval(30);
|
l_FrameCleanupTimer->SetInterval(30);
|
||||||
l_FrameCleanupTimer->Start();
|
l_FrameCleanupTimer->Start();
|
||||||
});
|
});
|
||||||
|
@ -44,7 +44,7 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
|
|||||||
return Type::Ptr();
|
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);
|
Type::Ptr ptype = Type::GetByName(type);
|
||||||
ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
|
ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
|
||||||
@ -268,7 +268,7 @@ std::vector<Value> FilterUtility::GetFilterTargets(const QueryDescription& qd, c
|
|||||||
frame.Self = uvars;
|
frame.Self = uvars;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
provider->FindTargets(type, boost::bind(&FilteredAddTarget,
|
provider->FindTargets(type, std::bind(&FilteredAddTarget,
|
||||||
boost::ref(permissionFrame), permissionFilter,
|
boost::ref(permissionFrame), permissionFilter,
|
||||||
boost::ref(frame), ufilter, boost::ref(result), variableName, _1));
|
boost::ref(frame), ufilter, boost::ref(result), variableName, _1));
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
|
@ -35,7 +35,7 @@ class TargetProvider : public Object
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(TargetProvider);
|
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 Value GetTargetByName(const String& type, const String& name) const = 0;
|
||||||
virtual bool IsValidType(const String& type) const = 0;
|
virtual bool IsValidType(const String& type) const = 0;
|
||||||
virtual String GetPluralName(const String& type) const = 0;
|
virtual String GetPluralName(const String& type) const = 0;
|
||||||
@ -46,7 +46,7 @@ class ConfigObjectTargetProvider : public TargetProvider
|
|||||||
public:
|
public:
|
||||||
DECLARE_PTR_TYPEDEFS(ConfigObjectTargetProvider);
|
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 Value GetTargetByName(const String& type, const String& name) const override;
|
||||||
virtual bool IsValidType(const String& type) const override;
|
virtual bool IsValidType(const String& type) const override;
|
||||||
virtual String GetPluralName(const String& type) const override;
|
virtual String GetPluralName(const String& type) const override;
|
||||||
|
@ -63,7 +63,7 @@ void HttpClientConnection::Reconnect(void)
|
|||||||
-- does not currently work because the NetworkStream class doesn't support async I/O */
|
-- 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 */
|
/* 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())
|
if (m_Stream->IsDataAvailable())
|
||||||
DataAvailableHandler(m_Stream);
|
DataAvailableHandler(m_Stream);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
boost::shared_ptr<HttpRequest> NewRequest(void);
|
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);
|
void SubmitRequest(const boost::shared_ptr<HttpRequest>& request, const HttpCompletionCallback& callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user