Replace boost::tuple with std::tuple

This commit is contained in:
Gunnar Beutner 2017-11-22 12:05:36 +01:00
parent 160ab21e59
commit df8266631d
11 changed files with 12 additions and 16 deletions

View File

@ -34,7 +34,6 @@
#include "base/process.hpp"
#include "config.h"
#include <boost/program_options.hpp>
#include <boost/tuple/tuple.hpp>
#include <thread>
#ifndef _WIN32

View File

@ -31,9 +31,6 @@ using boost::intrusive_ptr;
using boost::dynamic_pointer_cast;
using boost::static_pointer_cast;
#include <boost/tuple/tuple.hpp>
using boost::tie;
namespace icinga
{

View File

@ -267,13 +267,13 @@ bool Service::ResolveMacro(const String& macro, const CheckResult::Ptr& cr, Valu
return false;
}
boost::tuple<Host::Ptr, Service::Ptr> icinga::GetHostService(const Checkable::Ptr& checkable)
std::pair<Host::Ptr, Service::Ptr> icinga::GetHostService(const Checkable::Ptr& checkable)
{
Service::Ptr service = dynamic_pointer_cast<Service>(checkable);
if (service)
return boost::make_tuple(service->GetHost(), service);
return std::make_pair(service->GetHost(), service);
else
return boost::make_tuple(static_pointer_cast<Host>(checkable), Service::Ptr());
return std::make_pair(static_pointer_cast<Host>(checkable), Service::Ptr());
}

View File

@ -24,6 +24,10 @@
#include "icinga/service.thpp"
#include "icinga/macroresolver.hpp"
#include "icinga/host.hpp"
#include <utility>
#include <tuple>
using std::tie;
namespace icinga
{
@ -68,7 +72,7 @@ private:
static bool EvaluateApplyRule(const Host::Ptr& host, const ApplyRule& rule);
};
I2_ICINGA_API boost::tuple<Host::Ptr, Service::Ptr> GetHostService(const Checkable::Ptr& checkable);
I2_ICINGA_API std::pair<Host::Ptr, Service::Ptr> GetHostService(const Checkable::Ptr& checkable);
}

View File

@ -190,7 +190,7 @@ void ElasticsearchWriter::InternalCheckResultHandler(const Checkable::Ptr& check
Host::Ptr host;
Service::Ptr service;
boost::tie(host, service) = GetHostService(checkable);
tie(host, service) = GetHostService(checkable);
Dictionary::Ptr fields = new Dictionary();

View File

@ -195,7 +195,7 @@ void GraphiteWriter::CheckResultHandlerInternal(const Checkable::Ptr& checkable,
Host::Ptr host;
Service::Ptr service;
boost::tie(host, service) = GetHostService(checkable);
tie(host, service) = GetHostService(checkable);
MacroProcessor::ResolverList resolvers;
if (service)

View File

@ -190,7 +190,7 @@ void InfluxdbWriter::InternalCheckResultHandler(const Checkable::Ptr& checkable,
Host::Ptr host;
Service::Ptr service;
boost::tie(host, service) = GetHostService(checkable);
tie(host, service) = GetHostService(checkable);
MacroProcessor::ResolverList resolvers;
if (service)
@ -275,7 +275,7 @@ void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::
if (GetEnableSendMetadata()) {
Host::Ptr host;
Service::Ptr service;
boost::tie(host, service) = GetHostService(checkable);
tie(host, service) = GetHostService(checkable);
Dictionary::Ptr fields = new Dictionary();

View File

@ -21,7 +21,6 @@
#include "base/objectlock.hpp"
#include "base/json.hpp"
#include <BoostTestTargetConfig.h>
#include <boost/tuple/tuple.hpp>
using namespace icinga;

View File

@ -21,7 +21,6 @@
#include "base/objectlock.hpp"
#include "base/json.hpp"
#include <BoostTestTargetConfig.h>
#include <boost/tuple/tuple.hpp>
using namespace icinga;

View File

@ -24,7 +24,6 @@
#include "base/array.hpp"
#include "base/dictionary.hpp"
#include <BoostTestTargetConfig.h>
#include <boost/tuple/tuple.hpp>
using namespace icinga;

View File

@ -23,7 +23,6 @@
#include "base/application.hpp"
#include "base/type.hpp"
#include <BoostTestTargetConfig.h>
#include <boost/tuple/tuple.hpp>
using namespace icinga;