type = args[1];
std::vector<String> paths;
- Utility::Glob(pathSpec, std::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
+ Utility::Glob(pathSpec, std::bind(&GlobCallbackHelper, std::ref(paths), _1), type);
return Array::FromVector(paths);
}
type = args[2];
std::vector<String> paths;
- Utility::GlobRecursive(path, pattern, std::bind(&GlobCallbackHelper, boost::ref(paths), _1), type);
+ Utility::GlobRecursive(path, pattern, std::bind(&GlobCallbackHelper, std::ref(paths), _1), type);
return Array::FromVector(paths);
}
#include "base/utility.hpp"
#include "base/exception.hpp"
#include "base/application.hpp"
-#include <boost/bind.hpp>
#include <iostream>
using namespace icinga;
Log(LogDebug, "ThreadPool", "Spawning worker thread.");
Threads[i] = WorkerThread(ThreadIdle);
- Threads[i].Thread = group.create_thread(boost::bind(&ThreadPool::WorkerThread::ThreadProc, boost::ref(Threads[i]), boost::ref(*this)));
+ Threads[i].Thread = group.create_thread(std::bind(&ThreadPool::WorkerThread::ThreadProc, std::ref(Threads[i]), std::ref(*this)));
break;
}
void Utility::RemoveDirRecursive(const String& path)
{
std::vector<String> paths;
- Utility::GlobRecursive(path, "*", std::bind(&Utility::CollectPaths, _1, boost::ref(paths)), GlobFile | GlobDirectory);
+ Utility::GlobRecursive(path, "*", std::bind(&Utility::CollectPaths, _1, std::ref(paths)), GlobFile | GlobDirectory);
/* This relies on the fact that GlobRecursive lists the parent directory
first before recursing into subdirectories. */
l_ApiClient->AutocompleteScript(l_Session, word, l_ScriptFrame->Sandboxed,
std::bind(&ConsoleCommand::AutocompleteScriptCompletionHandler,
- boost::ref(mutex), boost::ref(cv), boost::ref(ready),
+ std::ref(mutex), std::ref(cv), std::ref(ready),
_1, _2,
- boost::ref(suggestions)));
+ std::ref(suggestions)));
{
boost::mutex::scoped_lock lock(mutex);
l_ApiClient->ExecuteScript(l_Session, command, scriptFrame.Sandboxed,
std::bind(&ConsoleCommand::ExecuteScriptCompletionHandler,
- boost::ref(mutex), boost::ref(cv), boost::ref(ready),
+ std::ref(mutex), std::ref(cv), std::ref(ready),
_1, _2,
- boost::ref(result), boost::ref(eptr)));
+ std::ref(result), std::ref(eptr)));
{
boost::mutex::scoped_lock lock(mutex);
ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);
std::vector<Expression *> expressions;
- Utility::GlobRecursive(path, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
+ Utility::GlobRecursive(path, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, std::ref(expressions), _1, zoneName, package), GlobFile);
DictExpression expr(expressions);
if (!ExecuteExpression(&expr))
success = false;
}
std::vector<Expression *> expressions;
- Utility::GlobRecursive(zonePath, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
+ Utility::GlobRecursive(zonePath, "*.conf", std::bind(&ConfigCompiler::CollectIncludes, std::ref(expressions), _1, zoneName, package), GlobFile);
DictExpression expr(expressions);
if (!ExecuteExpression(&expr))
success = false;
String zonesEtcDir = Application::GetZonesDir();
if (!zonesEtcDir.IsEmpty() && Utility::PathExists(zonesEtcDir))
- Utility::Glob(zonesEtcDir + "/*", std::bind(&IncludeZoneDirRecursive, _1, "_etc", boost::ref(success)), GlobDirectory);
+ Utility::Glob(zonesEtcDir + "/*", std::bind(&IncludeZoneDirRecursive, _1, "_etc", std::ref(success)), GlobDirectory);
if (!success)
return false;
* are authoritative on this node and are checked in HasZoneConfigAuthority(). */
String packagesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/packages";
if (Utility::PathExists(packagesVarDir))
- Utility::Glob(packagesVarDir + "/*", std::bind(&IncludePackage, _1, boost::ref(success)), GlobDirectory);
+ Utility::Glob(packagesVarDir + "/*", std::bind(&IncludePackage, _1, std::ref(success)), GlobDirectory);
if (!success)
return false;
/* Load cluster synchronized configuration files */
String zonesVarDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
if (Utility::PathExists(zonesVarDir))
- Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", boost::ref(success)), GlobDirectory);
+ Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", std::ref(success)), GlobDirectory);
if (!success)
return false;
/* disable = available-enabled */
String available_pattern = GetFeaturesAvailablePath() + "/*.conf";
std::vector<String> available;
- Utility::Glob(available_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(available)), GlobFile);
+ Utility::Glob(available_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, std::ref(available)), GlobFile);
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
std::vector<String> enabled;
- Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(enabled)), GlobFile);
+ Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, std::ref(enabled)), GlobFile);
std::sort(available.begin(), available.end());
std::sort(enabled.begin(), enabled.end());
/* all enabled features */
String enabled_pattern = GetFeaturesEnabledPath() + "/*.conf";
- Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, boost::ref(features)), GlobFile);
+ Utility::Glob(enabled_pattern, std::bind(&FeatureUtility::CollectFeatures, _1, std::ref(features)), GlobFile);
}
return true;
String bestFilename;
try {
- Utility::Glob(spath, std::bind(&GetLatestReport, _1, boost::ref(bestTimestamp),
- boost::ref(bestFilename)), GlobFile);
+ Utility::Glob(spath, std::bind(&GetLatestReport, _1, std::ref(bestTimestamp),
+ std::ref(bestFilename)), GlobFile);
}
#ifdef _WIN32
catch (win32_error &ex) {
std::vector<Expression *> expressions;
- if (!Utility::Glob(includePath, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile) && includePath.FindFirstOf("*?") == String::NPos) {
+ if (!Utility::Glob(includePath, std::bind(&ConfigCompiler::CollectIncludes, std::ref(expressions), _1, zone, package), GlobFile) && includePath.FindFirstOf("*?") == String::NPos) {
std::ostringstream msgbuf;
msgbuf << "Include file '" + path + "' does not exist";
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), debuginfo));
ppath = relativeBase + "/" + path;
std::vector<Expression *> expressions;
- Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zone, package), GlobFile);
+ Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, std::ref(expressions), _1, zone, package), GlobFile);
DictExpression *dict = new DictExpression(expressions);
dict->MakeInline();
RegisterZoneDir(tag, ppath, zoneName);
- Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, boost::ref(expressions), _1, zoneName, package), GlobFile);
+ Utility::GlobRecursive(ppath, pattern, std::bind(&ConfigCompiler::CollectIncludes, std::ref(expressions), _1, zoneName, package), GlobFile);
}
/**
}
std::vector<Expression *> expressions;
- Utility::Glob(ppath + "/*", std::bind(&ConfigCompiler::HandleIncludeZone, newRelativeBase, tag, _1, pattern, package, boost::ref(expressions)), GlobDirectory);
+ Utility::Glob(ppath + "/*", std::bind(&ConfigCompiler::HandleIncludeZone, newRelativeBase, tag, _1, pattern, package, std::ref(expressions)), GlobDirectory);
return new DictExpression(expressions);
}
fp.exceptions(std::ofstream::failbit | std::ofstream::badbit);
ConfigObject::Ptr previousObject;
- ConfigObject::DumpModifiedAttributes(std::bind(&PersistModAttrHelper, boost::ref(fp), boost::ref(previousObject), _1, _2, _3));
+ ConfigObject::DumpModifiedAttributes(std::bind(&PersistModAttrHelper, std::ref(fp), std::ref(previousObject), _1, _2, _3));
if (previousObject) {
ConfigWriter::EmitRaw(fp, "\tobj.version = ");
}
resolvers_this->Set("macro", new Function("macro (temporary)", std::bind(&MacroProcessor::InternalResolveMacrosShim,
- _1, boost::cref(resolvers), cr, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros,
+ _1, std::cref(resolvers), cr, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros,
recursionLevel + 1), { "str" }));
resolvers_this->Set("resolve_arguments", new Function("resolve_arguments (temporary)", std::bind(&MacroProcessor::InternalResolveArgumentsShim,
- _1, boost::cref(resolvers), cr, resolvedMacros, useResolvedMacros,
+ _1, std::cref(resolvers), cr, resolvedMacros, useResolvedMacros,
recursionLevel + 1)));
std::vector<Value> args;
void LivestatusLogUtility::CreateLogIndex(const String& path, std::map<time_t, String>& index)
{
- Utility::Glob(path + "/icinga.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
- Utility::Glob(path + "/archives/*.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, boost::ref(index)), GlobFile);
+ Utility::Glob(path + "/icinga.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, std::ref(index)), GlobFile);
+ Utility::Glob(path + "/archives/*.log", std::bind(&LivestatusLogUtility::CreateLogIndexFileHandler, _1, std::ref(index)), GlobFile);
}
void LivestatusLogUtility::CreateLogIndexFileHandler(const String& path, std::map<time_t, String>& index)
{
std::vector<LivestatusRowValue> rs;
- FetchRows(std::bind(&Table::FilteredAddRow, this, boost::ref(rs), filter, limit, _1, _2, _3));
+ FetchRows(std::bind(&Table::FilteredAddRow, this, std::ref(rs), filter, limit, _1, _2, _3));
return rs;
}
ConfigDirInformation config;
config.UpdateV1 = new Dictionary();
config.UpdateV2 = new Dictionary();
- Utility::GlobRecursive(dir, "*", std::bind(&ApiListener::ConfigGlobHandler, boost::ref(config), dir, _1), GlobFile);
+ Utility::GlobRecursive(dir, "*", std::bind(&ApiListener::ConfigGlobHandler, std::ref(config), dir, _1), GlobFile);
return config;
}
double now = Utility::GetTime();
std::vector<int> files;
- Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
+ Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, std::ref(files), _1), GlobFile);
std::sort(files.begin(), files.end());
for (int ts : files) {
count = 0;
std::vector<int> files;
- Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, boost::ref(files), _1), GlobFile);
+ Utility::Glob(GetApiDir() + "log/*", std::bind(&ApiListener::LogGlobHandler, std::ref(files), _1), GlobFile);
std::sort(files.begin(), files.end());
for (int ts : files) {
{
std::vector<String> packages;
Utility::Glob(GetPackageDir() + "/*", std::bind(&ConfigPackageUtility::CollectDirNames,
- _1, boost::ref(packages)), GlobDirectory);
+ _1, std::ref(packages)), GlobDirectory);
return packages;
}
std::vector<String> ConfigPackageUtility::GetStages(const String& packageName)
{
std::vector<String> stages;
- Utility::Glob(GetPackageDir() + "/" + packageName + "/*", std::bind(&ConfigPackageUtility::CollectDirNames, _1, boost::ref(stages)), GlobDirectory);
+ Utility::Glob(GetPackageDir() + "/" + packageName + "/*", std::bind(&ConfigPackageUtility::CollectDirNames, _1, std::ref(stages)), GlobDirectory);
return stages;
}
std::vector<std::pair<String, bool> > ConfigPackageUtility::GetFiles(const String& packageName, const String& stageName)
{
std::vector<std::pair<String, bool> > paths;
- Utility::GlobRecursive(GetPackageDir() + "/" + packageName + "/" + stageName, "*", std::bind(&ConfigPackageUtility::CollectPaths, _1, boost::ref(paths)), GlobDirectory | GlobFile);
+ Utility::GlobRecursive(GetPackageDir() + "/" + packageName + "/" + stageName, "*", std::bind(&ConfigPackageUtility::CollectPaths, _1, std::ref(paths)), GlobDirectory | GlobFile);
return paths;
}
try {
provider->FindTargets(type, std::bind(&FilteredAddTarget,
- boost::ref(permissionFrame), permissionFilter,
- boost::ref(frame), ufilter, boost::ref(result), variableName, _1));
+ std::ref(permissionFrame), permissionFilter,
+ std::ref(frame), ufilter, std::ref(result), variableName, _1));
} catch (const std::exception& ex) {
delete ufilter;
throw;
} else if (m_State == HttpRequestBody) {
if (Headers->Get("transfer-encoding") == "chunked") {
if (!m_ChunkContext)
- m_ChunkContext = std::make_shared<ChunkReadContext>(boost::ref(src));
+ m_ChunkContext = std::make_shared<ChunkReadContext>(std::ref(src));
char *data;
size_t size;
} else if (m_State == HttpResponseBody) {
if (Headers->Get("transfer-encoding") == "chunked") {
if (!m_ChunkContext)
- m_ChunkContext = std::make_shared<ChunkReadContext>(boost::ref(src));
+ m_ChunkContext = std::make_shared<ChunkReadContext>(std::ref(src));
char *data;
size_t size;