mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 13:14:32 +02:00
Remove namespace qualifiers for boost::make_shared and boost::enable_shared_from_this.
Fixes #5012
This commit is contained in:
parent
686446584c
commit
6acc017707
@ -44,7 +44,7 @@ void CheckerComponent::Start(void)
|
||||
|
||||
m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
|
||||
|
||||
m_ResultTimer = boost::make_shared<Timer>();
|
||||
m_ResultTimer = make_shared<Timer>();
|
||||
m_ResultTimer->SetInterval(5);
|
||||
m_ResultTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::ResultTimerHandler, this));
|
||||
m_ResultTimer->Start();
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "base/zlibstream.h"
|
||||
#include "base/application.h"
|
||||
#include "base/convert.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <fstream>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
|
||||
@ -66,7 +65,7 @@ void ClusterListener::Start(void)
|
||||
if (!GetBindPort().IsEmpty())
|
||||
AddListener(GetBindPort());
|
||||
|
||||
m_ClusterTimer = boost::make_shared<Timer>();
|
||||
m_ClusterTimer = make_shared<Timer>();
|
||||
m_ClusterTimer->OnTimerExpired.connect(boost::bind(&ClusterListener::ClusterTimerHandler, this));
|
||||
m_ClusterTimer->SetInterval(5);
|
||||
m_ClusterTimer->Start();
|
||||
@ -150,7 +149,7 @@ void ClusterListener::AddListener(const String& service)
|
||||
s << "Adding new listener: port " << service;
|
||||
Log(LogInformation, "cluster", s.str());
|
||||
|
||||
TcpSocket::Ptr server = boost::make_shared<TcpSocket>();
|
||||
TcpSocket::Ptr server = make_shared<TcpSocket>();
|
||||
server->Bind(service, AF_INET6);
|
||||
|
||||
boost::thread thread(boost::bind(&ClusterListener::ListenerThreadProc, this, server));
|
||||
@ -188,7 +187,7 @@ void ClusterListener::AddConnection(const String& node, const String& service) {
|
||||
BOOST_THROW_EXCEPTION(std::logic_error("SSL context is required for AddConnection()"));
|
||||
}
|
||||
|
||||
TcpSocket::Ptr client = boost::make_shared<TcpSocket>();
|
||||
TcpSocket::Ptr client = make_shared<TcpSocket>();
|
||||
|
||||
client->Connect(node, service);
|
||||
Utility::QueueAsyncCallback(boost::bind(&ClusterListener::NewClientHandler, this, client, TlsRoleClient));
|
||||
@ -205,7 +204,7 @@ void ClusterListener::PersistMessage(const Endpoint::Ptr& source, const Dictiona
|
||||
|
||||
ASSERT(ts != 0);
|
||||
|
||||
Dictionary::Ptr pmessage = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr pmessage = make_shared<Dictionary>();
|
||||
pmessage->Set("timestamp", ts);
|
||||
|
||||
if (source)
|
||||
@ -303,9 +302,9 @@ void ClusterListener::OpenLogFile(void)
|
||||
return;
|
||||
}
|
||||
|
||||
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
|
||||
StdioStream::Ptr logStream = make_shared<StdioStream>(fp, true);
|
||||
#ifdef HAVE_BIOZLIB
|
||||
m_LogFile = boost::make_shared<ZlibStream>(logStream);
|
||||
m_LogFile = make_shared<ZlibStream>(logStream);
|
||||
#else /* HAVE_BIOZLIB */
|
||||
m_LogFile = logStream;
|
||||
#endif /* HAVE_BIOZLIB */
|
||||
@ -390,9 +389,9 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr
|
||||
Log(LogInformation, "cluster", "Replaying log: " + path);
|
||||
|
||||
std::fstream *fp = new std::fstream(path.CStr(), std::fstream::in);
|
||||
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
|
||||
StdioStream::Ptr logStream = make_shared<StdioStream>(fp, true);
|
||||
#ifdef HAVE_BIOZLIB
|
||||
ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream);
|
||||
ZlibStream::Ptr lstream = make_shared<ZlibStream>(logStream);
|
||||
#else /* HAVE_BIOZLIB */
|
||||
Stream::Ptr lstream = logStream;
|
||||
#endif /* HAVE_BIOZLIB */
|
||||
@ -474,7 +473,7 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr
|
||||
|
||||
void ClusterListener::ConfigGlobHandler(const Dictionary::Ptr& config, const String& file, bool basename)
|
||||
{
|
||||
Dictionary::Ptr elem = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr elem = make_shared<Dictionary>();
|
||||
|
||||
std::ifstream fp(file.CStr());
|
||||
if (!fp)
|
||||
@ -493,9 +492,9 @@ void ClusterListener::ConfigGlobHandler(const Dictionary::Ptr& config, const Str
|
||||
*/
|
||||
void ClusterListener::NewClientHandler(const Socket::Ptr& client, TlsRole role)
|
||||
{
|
||||
NetworkStream::Ptr netStream = boost::make_shared<NetworkStream>(client);
|
||||
NetworkStream::Ptr netStream = make_shared<NetworkStream>(client);
|
||||
|
||||
TlsStream::Ptr tlsStream = boost::make_shared<TlsStream>(netStream, role, m_SSLContext);
|
||||
TlsStream::Ptr tlsStream = make_shared<TlsStream>(netStream, role, m_SSLContext);
|
||||
tlsStream->Handshake();
|
||||
|
||||
shared_ptr<X509> cert = tlsStream->GetPeerCertificate();
|
||||
@ -519,7 +518,7 @@ void ClusterListener::NewClientHandler(const Socket::Ptr& client, TlsRole role)
|
||||
endpoint->SetClient(tlsStream);
|
||||
}
|
||||
|
||||
Dictionary::Ptr config = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr config = make_shared<Dictionary>();
|
||||
Array::Ptr configFiles = endpoint->GetConfigFiles();
|
||||
|
||||
if (configFiles) {
|
||||
@ -531,11 +530,11 @@ void ClusterListener::NewClientHandler(const Socket::Ptr& client, TlsRole role)
|
||||
|
||||
Log(LogInformation, "cluster", "Sending " + Convert::ToString(static_cast<long>(config->GetLength())) + " config files to endpoint '" + endpoint->GetName() + "'.");
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("identity", GetIdentity());
|
||||
params->Set("config_files", config);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::Config");
|
||||
message->Set("params", params);
|
||||
@ -549,16 +548,16 @@ void ClusterListener::NewClientHandler(const Socket::Ptr& client, TlsRole role)
|
||||
void ClusterListener::ClusterTimerHandler(void)
|
||||
{
|
||||
/* broadcast a heartbeat message */
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("identity", GetIdentity());
|
||||
|
||||
/* Eww. */
|
||||
Dictionary::Ptr features = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr features = make_shared<Dictionary>();
|
||||
features->Set("checker", SupportsChecks() ? 1 : 0);
|
||||
features->Set("notification", SupportsNotifications() ? 1 : 0);
|
||||
params->Set("features", features);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::HeartBeat");
|
||||
message->Set("params", params);
|
||||
@ -655,7 +654,7 @@ void ClusterListener::SetSecurityInfo(const Dictionary::Ptr& message, const Dyna
|
||||
{
|
||||
ASSERT(object);
|
||||
|
||||
Dictionary::Ptr security = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr security = make_shared<Dictionary>();
|
||||
security->Set("type", object->GetType()->GetName());
|
||||
security->Set("name", object->GetName());
|
||||
security->Set("privs", privs);
|
||||
@ -668,11 +667,11 @@ void ClusterListener::CheckResultHandler(const Service::Ptr& service, const Dict
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("check_result", cr);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::CheckResult");
|
||||
message->Set("params", params);
|
||||
@ -687,11 +686,11 @@ void ClusterListener::NextCheckChangedHandler(const Service::Ptr& service, doubl
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("next_check", nextCheck);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetNextCheck");
|
||||
message->Set("params", params);
|
||||
@ -706,11 +705,11 @@ void ClusterListener::NextNotificationChangedHandler(const Notification::Ptr& no
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("notification", notification->GetName());
|
||||
params->Set("next_notification", nextNotification);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetNextNotification");
|
||||
message->Set("params", params);
|
||||
@ -725,11 +724,11 @@ void ClusterListener::ForceNextCheckChangedHandler(const Service::Ptr& service,
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("forced", forced);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetForceNextCheck");
|
||||
message->Set("params", params);
|
||||
@ -744,11 +743,11 @@ void ClusterListener::ForceNextNotificationChangedHandler(const Service::Ptr& se
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("forced", forced);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetForceNextNotification");
|
||||
message->Set("params", params);
|
||||
@ -763,11 +762,11 @@ void ClusterListener::EnableActiveChecksChangedHandler(const Service::Ptr& servi
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("enabled", enabled);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetEnableActiveChecks");
|
||||
message->Set("params", params);
|
||||
@ -782,11 +781,11 @@ void ClusterListener::EnablePassiveChecksChangedHandler(const Service::Ptr& serv
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("enabled", enabled);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetEnablePassiveChecks");
|
||||
message->Set("params", params);
|
||||
@ -801,11 +800,11 @@ void ClusterListener::EnableNotificationsChangedHandler(const Service::Ptr& serv
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("enabled", enabled);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetEnableNotifications");
|
||||
message->Set("params", params);
|
||||
@ -820,11 +819,11 @@ void ClusterListener::EnableFlappingChangedHandler(const Service::Ptr& service,
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("enabled", enabled);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetEnableFlapping");
|
||||
message->Set("params", params);
|
||||
@ -839,11 +838,11 @@ void ClusterListener::CommentAddedHandler(const Service::Ptr& service, const Dic
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("comment", comment);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::AddComment");
|
||||
message->Set("params", params);
|
||||
@ -858,11 +857,11 @@ void ClusterListener::CommentRemovedHandler(const Service::Ptr& service, const D
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("id", comment->Get("id"));
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::RemoveComment");
|
||||
message->Set("params", params);
|
||||
@ -877,11 +876,11 @@ void ClusterListener::DowntimeAddedHandler(const Service::Ptr& service, const Di
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("downtime", downtime);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::AddDowntime");
|
||||
message->Set("params", params);
|
||||
@ -896,11 +895,11 @@ void ClusterListener::DowntimeRemovedHandler(const Service::Ptr& service, const
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("id", downtime->Get("id"));
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::RemoveDowntime");
|
||||
message->Set("params", params);
|
||||
@ -915,14 +914,14 @@ void ClusterListener::AcknowledgementSetHandler(const Service::Ptr& service, con
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
params->Set("author", author);
|
||||
params->Set("comment", comment);
|
||||
params->Set("type", type);
|
||||
params->Set("expiry", expiry);
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::SetAcknowledgement");
|
||||
message->Set("params", params);
|
||||
@ -937,10 +936,10 @@ void ClusterListener::AcknowledgementClearedHandler(const Service::Ptr& service,
|
||||
if (!authority.IsEmpty() && authority != GetIdentity())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr params = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr params = make_shared<Dictionary>();
|
||||
params->Set("service", service->GetName());
|
||||
|
||||
Dictionary::Ptr message = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr message = make_shared<Dictionary>();
|
||||
message->Set("jsonrpc", "2.0");
|
||||
message->Set("method", "cluster::ClearAcknowledgement");
|
||||
message->Set("params", params);
|
||||
@ -967,10 +966,10 @@ void ClusterListener::MessageHandler(const Endpoint::Ptr& sender, const Dictiona
|
||||
return;
|
||||
|
||||
if (sender->GetRemoteLogPosition() + 10 < ts) {
|
||||
Dictionary::Ptr lparams = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr lparams = make_shared<Dictionary>();
|
||||
lparams->Set("log_position", message->Get("ts"));
|
||||
|
||||
Dictionary::Ptr lmessage = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr lmessage = make_shared<Dictionary>();
|
||||
lmessage->Set("jsonrpc", "2.0");
|
||||
lmessage->Set("method", "cluster::SetLogPosition");
|
||||
lmessage->Set("params", lparams);
|
||||
@ -1378,7 +1377,7 @@ void ClusterListener::MessageHandler(const Endpoint::Ptr& sender, const Dictiona
|
||||
<< boost::errinfo_errno(errno));
|
||||
}
|
||||
|
||||
Dictionary::Ptr localConfig = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr localConfig = make_shared<Dictionary>();
|
||||
Utility::Glob(dir + "/*", boost::bind(&ClusterListener::ConfigGlobHandler, boost::cref(localConfig), _1, true));
|
||||
|
||||
bool configChange = false;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "base/utility.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include "config/configitembuilder.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/application.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <fstream>
|
||||
|
||||
using namespace icinga;
|
||||
@ -38,7 +37,7 @@ REGISTER_TYPE(CheckResultReader);
|
||||
*/
|
||||
void CheckResultReader::Start(void)
|
||||
{
|
||||
m_ReadTimer = boost::make_shared<Timer>();
|
||||
m_ReadTimer = make_shared<Timer>();
|
||||
m_ReadTimer->OnTimerExpired.connect(boost::bind(&CheckResultReader::ReadTimerHandler, this));
|
||||
m_ReadTimer->SetInterval(5);
|
||||
m_ReadTimer->Start();
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "base/application.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
@ -62,7 +61,7 @@ void CompatLogger::Start(void)
|
||||
Service::OnEventCommandExecuted.connect(bind(&CompatLogger::EventCommandHandler, this, _1));
|
||||
ExternalCommandProcessor::OnNewExternalCommand.connect(boost::bind(&CompatLogger::ExternalCommandHandler, this, _2, _3));
|
||||
|
||||
m_RotationTimer = boost::make_shared<Timer>();
|
||||
m_RotationTimer = make_shared<Timer>();
|
||||
m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this));
|
||||
m_RotationTimer->Start();
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/exception.h"
|
||||
#include "base/application.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
@ -57,7 +56,7 @@ void StatusDataWriter::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
m_StatusTimer = boost::make_shared<Timer>();
|
||||
m_StatusTimer = make_shared<Timer>();
|
||||
m_StatusTimer->SetInterval(15);
|
||||
m_StatusTimer->OnTimerExpired.connect(boost::bind(&StatusDataWriter::StatusTimerHandler, this));
|
||||
m_StatusTimer->Start();
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "db_ido_mysql/idomysqlconnection.h"
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -46,12 +45,12 @@ void IdoMysqlConnection::Start(void)
|
||||
|
||||
m_QueryQueue.SetExceptionCallback(boost::bind(&IdoMysqlConnection::ExceptionHandler, this, _1));
|
||||
|
||||
m_TxTimer = boost::make_shared<Timer>();
|
||||
m_TxTimer = make_shared<Timer>();
|
||||
m_TxTimer->SetInterval(5);
|
||||
m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::TxTimerHandler, this));
|
||||
m_TxTimer->Start();
|
||||
|
||||
m_ReconnectTimer = boost::make_shared<Timer>();
|
||||
m_ReconnectTimer = make_shared<Timer>();
|
||||
m_ReconnectTimer->SetInterval(10);
|
||||
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::ReconnectTimerHandler, this));
|
||||
m_ReconnectTimer->Start();
|
||||
@ -285,7 +284,7 @@ Array::Ptr IdoMysqlConnection::Query(const String& query)
|
||||
return Array::Ptr();
|
||||
}
|
||||
|
||||
Array::Ptr rows = boost::make_shared<Array>();
|
||||
Array::Ptr rows = make_shared<Array>();
|
||||
|
||||
for (;;) {
|
||||
Dictionary::Ptr row = FetchRow(result);
|
||||
@ -342,7 +341,7 @@ Dictionary::Ptr IdoMysqlConnection::FetchRow(MYSQL_RES *result)
|
||||
if (!lengths)
|
||||
return Dictionary::Ptr();
|
||||
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
|
||||
mysql_field_seek(result, 0);
|
||||
for (field = mysql_fetch_field(result), i = 0; field; field = mysql_fetch_field(result), i++) {
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "db_ido_pgsql/idopgsqlconnection.h"
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -46,12 +45,12 @@ void IdoPgsqlConnection::Start(void)
|
||||
|
||||
m_QueryQueue.SetExceptionCallback(boost::bind(&IdoPgsqlConnection::ExceptionHandler, this, _1));
|
||||
|
||||
m_TxTimer = boost::make_shared<Timer>();
|
||||
m_TxTimer = make_shared<Timer>();
|
||||
m_TxTimer->SetInterval(5);
|
||||
m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::TxTimerHandler, this));
|
||||
m_TxTimer->Start();
|
||||
|
||||
m_ReconnectTimer = boost::make_shared<Timer>();
|
||||
m_ReconnectTimer = make_shared<Timer>();
|
||||
m_ReconnectTimer->SetInterval(10);
|
||||
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::ReconnectTimerHandler, this));
|
||||
m_ReconnectTimer->Start();
|
||||
@ -290,7 +289,7 @@ Array::Ptr IdoPgsqlConnection::Query(const String& query)
|
||||
);
|
||||
}
|
||||
|
||||
Array::Ptr rows = boost::make_shared<Array>();
|
||||
Array::Ptr rows = make_shared<Array>();
|
||||
|
||||
int rownum = 0;
|
||||
|
||||
@ -352,7 +351,7 @@ Dictionary::Ptr IdoPgsqlConnection::FetchRow(PGresult *result, int row)
|
||||
|
||||
int columns = PQnfields(result);
|
||||
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
|
||||
for (int column = 0; column < columns; column++) {
|
||||
Value value;
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "demo/demo.h"
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -33,7 +32,7 @@ void Demo::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
m_DemoTimer = boost::make_shared<Timer>();
|
||||
m_DemoTimer = make_shared<Timer>();
|
||||
m_DemoTimer->SetInterval(5);
|
||||
m_DemoTimer->OnTimerExpired.connect(boost::bind(&Demo::DemoTimerHandler, this));
|
||||
m_DemoTimer->Start();
|
||||
|
@ -77,7 +77,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row)
|
||||
if(!user_group)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr members = boost::make_shared<Array>();
|
||||
Array::Ptr members = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const User::Ptr& user, user_group->GetMembers()) {
|
||||
members->Add(user->GetName());
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/objectlock.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
@ -211,7 +210,7 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row)
|
||||
if (!custom)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(custom);
|
||||
String key;
|
||||
@ -244,7 +243,7 @@ Value ContactsTable::CustomVariableValuesAccessor(const Value& row)
|
||||
if (!custom)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(custom);
|
||||
String key;
|
||||
@ -277,7 +276,7 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row)
|
||||
if (!custom)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(custom);
|
||||
String key;
|
||||
@ -292,7 +291,7 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row)
|
||||
key == "2d_coords")
|
||||
continue;
|
||||
|
||||
Array::Ptr key_val = boost::make_shared<Array>();
|
||||
Array::Ptr key_val = make_shared<Array>();
|
||||
key_val->Add(key);
|
||||
key_val->Add(value);
|
||||
cv->Add(key_val);
|
||||
|
@ -116,7 +116,7 @@ Value HostGroupsTable::ActionUrlAccessor(const Value& row)
|
||||
|
||||
Value HostGroupsTable::MembersAccessor(const Value& row)
|
||||
{
|
||||
Array::Ptr members = boost::make_shared<Array>();
|
||||
Array::Ptr members = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Host::Ptr& host, static_cast<HostGroup::Ptr>(row)->GetMembers()) {
|
||||
members->Add(host->GetName());
|
||||
@ -127,10 +127,10 @@ Value HostGroupsTable::MembersAccessor(const Value& row)
|
||||
|
||||
Value HostGroupsTable::MembersWithStateAccessor(const Value& row)
|
||||
{
|
||||
Array::Ptr members = boost::make_shared<Array>();
|
||||
Array::Ptr members = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Host::Ptr& host, static_cast<HostGroup::Ptr>(row)->GetMembers()) {
|
||||
Array::Ptr member_state = boost::make_shared<Array>();
|
||||
Array::Ptr member_state = make_shared<Array>();
|
||||
member_state->Add(host->GetName());
|
||||
member_state->Add(host->GetState());
|
||||
members->Add(member_state);
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "base/utility.h"
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
@ -1403,7 +1402,7 @@ Value HostsTable::ContactsAccessor(const Value& row)
|
||||
if (!hc)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr contact_names = boost::make_shared<Array>();
|
||||
Array::Ptr contact_names = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetServiceNotificationUsers(hc)) {
|
||||
contact_names->Add(user->GetName());
|
||||
@ -1427,7 +1426,7 @@ Value HostsTable::DowntimesAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr downtimes = hc->GetDowntimes();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(downtimes);
|
||||
|
||||
@ -1462,7 +1461,7 @@ Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr downtimes = hc->GetDowntimes();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(downtimes);
|
||||
|
||||
@ -1476,7 +1475,7 @@ Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
|
||||
if (Service::IsDowntimeExpired(downtime))
|
||||
continue;
|
||||
|
||||
Array::Ptr downtime_info = boost::make_shared<Array>();
|
||||
Array::Ptr downtime_info = make_shared<Array>();
|
||||
downtime_info->Add(downtime->Get("legacy_id"));
|
||||
downtime_info->Add(downtime->Get("author"));
|
||||
downtime_info->Add(downtime->Get("comment"));
|
||||
@ -1501,7 +1500,7 @@ Value HostsTable::CommentsAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = hc->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1536,7 +1535,7 @@ Value HostsTable::CommentsWithInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = hc->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1550,7 +1549,7 @@ Value HostsTable::CommentsWithInfoAccessor(const Value& row)
|
||||
if (Service::IsCommentExpired(comment))
|
||||
continue;
|
||||
|
||||
Array::Ptr comment_info = boost::make_shared<Array>();
|
||||
Array::Ptr comment_info = make_shared<Array>();
|
||||
comment_info->Add(comment->Get("legacy_id"));
|
||||
comment_info->Add(comment->Get("author"));
|
||||
comment_info->Add(comment->Get("text"));
|
||||
@ -1575,7 +1574,7 @@ Value HostsTable::CommentsWithExtraInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = hc->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1589,7 +1588,7 @@ Value HostsTable::CommentsWithExtraInfoAccessor(const Value& row)
|
||||
if (Service::IsCommentExpired(comment))
|
||||
continue;
|
||||
|
||||
Array::Ptr comment_info = boost::make_shared<Array>();
|
||||
Array::Ptr comment_info = make_shared<Array>();
|
||||
comment_info->Add(comment->Get("legacy_id"));
|
||||
comment_info->Add(comment->Get("author"));
|
||||
comment_info->Add(comment->Get("text"));
|
||||
@ -1618,7 +1617,7 @@ Value HostsTable::CustomVariableNamesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
@ -1646,7 +1645,7 @@ Value HostsTable::CustomVariableValuesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
@ -1674,12 +1673,12 @@ Value HostsTable::CustomVariablesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
BOOST_FOREACH(boost::tie(key, value), customvars) {
|
||||
Array::Ptr key_val = boost::make_shared<Array>();
|
||||
Array::Ptr key_val = make_shared<Array>();
|
||||
key_val->Add(key);
|
||||
key_val->Add(value);
|
||||
cv->Add(key_val);
|
||||
@ -1695,7 +1694,7 @@ Value HostsTable::ParentsAccessor(const Value& row)
|
||||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr parents = boost::make_shared<Array>();
|
||||
Array::Ptr parents = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Host::Ptr& parent, host->GetParentHosts()) {
|
||||
parents->Add(parent->GetName());
|
||||
@ -1711,7 +1710,7 @@ Value HostsTable::ChildsAccessor(const Value& row)
|
||||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr childs = boost::make_shared<Array>();
|
||||
Array::Ptr childs = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Host::Ptr& child, host->GetChildHosts()) {
|
||||
childs->Add(child->GetName());
|
||||
@ -1988,7 +1987,7 @@ Value HostsTable::ContactGroupsAccessor(const Value& row)
|
||||
if (!hc)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr contactgroup_names = boost::make_shared<Array>();
|
||||
Array::Ptr contactgroup_names = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(hc)) {
|
||||
contactgroup_names->Add(usergroup->GetName());
|
||||
@ -2004,7 +2003,7 @@ Value HostsTable::ServicesAccessor(const Value& row)
|
||||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr services = boost::make_shared<Array>();
|
||||
Array::Ptr services = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||
services->Add(service->GetShortName());
|
||||
@ -2020,10 +2019,10 @@ Value HostsTable::ServicesWithStateAccessor(const Value& row)
|
||||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr services = boost::make_shared<Array>();
|
||||
Array::Ptr services = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||
Array::Ptr svc_add = boost::make_shared<Array>();
|
||||
Array::Ptr svc_add = make_shared<Array>();
|
||||
|
||||
svc_add->Add(service->GetShortName());
|
||||
svc_add->Add(service->GetState());
|
||||
@ -2041,10 +2040,10 @@ Value HostsTable::ServicesWithInfoAccessor(const Value& row)
|
||||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr services = boost::make_shared<Array>();
|
||||
Array::Ptr services = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||
Array::Ptr svc_add = boost::make_shared<Array>();
|
||||
Array::Ptr svc_add = make_shared<Array>();
|
||||
|
||||
svc_add->Add(service->GetShortName());
|
||||
svc_add->Add(service->GetState());
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "base/application.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/convert.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -50,7 +49,7 @@ void LivestatusListener::Start(void)
|
||||
DynamicObject::Start();
|
||||
|
||||
if (GetSocketType() == "tcp") {
|
||||
TcpSocket::Ptr socket = boost::make_shared<TcpSocket>();
|
||||
TcpSocket::Ptr socket = make_shared<TcpSocket>();
|
||||
socket->Bind(GetBindHost(), GetBindPort(), AF_INET);
|
||||
|
||||
boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
|
||||
@ -59,7 +58,7 @@ void LivestatusListener::Start(void)
|
||||
}
|
||||
else if (GetSocketType() == "unix") {
|
||||
#ifndef _WIN32
|
||||
UnixSocket::Ptr socket = boost::make_shared<UnixSocket>();
|
||||
UnixSocket::Ptr socket = make_shared<UnixSocket>();
|
||||
socket->Bind(GetSocketPath());
|
||||
|
||||
/* group must be able to write */
|
||||
@ -119,7 +118,7 @@ void LivestatusListener::ClientThreadProc(const Socket::Ptr& client)
|
||||
l_Connections++;
|
||||
}
|
||||
|
||||
Stream::Ptr stream = boost::make_shared<NetworkStream>(client);
|
||||
Stream::Ptr stream = make_shared<NetworkStream>(client);
|
||||
|
||||
for (;;) {
|
||||
String line;
|
||||
@ -134,7 +133,7 @@ void LivestatusListener::ClientThreadProc(const Socket::Ptr& client)
|
||||
break;
|
||||
}
|
||||
|
||||
Query::Ptr query = boost::make_shared<Query>(lines);
|
||||
Query::Ptr query = make_shared<Query>(lines);
|
||||
if (!query->Execute(stream))
|
||||
break;
|
||||
}
|
||||
@ -154,4 +153,4 @@ void LivestatusListener::ValidateSocketType(const String& location, const Dictio
|
||||
ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
|
||||
location + ": Socket type '" + socket_type + "' is invalid.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/application.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@ -555,7 +554,7 @@ Dictionary::Ptr LogTable::GetLogEntryAttributes(const String& type, const String
|
||||
} else
|
||||
return Dictionary::Ptr();
|
||||
|
||||
Dictionary::Ptr bag = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr bag = make_shared<Dictionary>();
|
||||
|
||||
bag->Set("class", log_class); /* 0 is the default if not populated */
|
||||
bag->Set("comment", comment);
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "base/exception.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
|
||||
@ -156,19 +155,19 @@ Query::Query(const std::vector<String>& lines)
|
||||
Filter::Ptr filter;
|
||||
|
||||
if (aggregate_arg == "sum") {
|
||||
aggregator = boost::make_shared<SumAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<SumAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "min") {
|
||||
aggregator = boost::make_shared<MinAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<MinAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "max") {
|
||||
aggregator = boost::make_shared<MaxAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<MaxAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "avg") {
|
||||
aggregator = boost::make_shared<AvgAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<AvgAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "std") {
|
||||
aggregator = boost::make_shared<StdAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<StdAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "suminv") {
|
||||
aggregator = boost::make_shared<InvSumAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<InvSumAggregator>(aggregate_attr);
|
||||
} else if (aggregate_arg == "avginv") {
|
||||
aggregator = boost::make_shared<InvAvgAggregator>(aggregate_attr);
|
||||
aggregator = make_shared<InvAvgAggregator>(aggregate_attr);
|
||||
} else {
|
||||
filter = ParseFilter(params, m_LogTimeFrom, m_LogTimeUntil);
|
||||
|
||||
@ -179,7 +178,7 @@ Query::Query(const std::vector<String>& lines)
|
||||
return;
|
||||
}
|
||||
|
||||
aggregator = boost::make_shared<CountAggregator>();
|
||||
aggregator = make_shared<CountAggregator>();
|
||||
}
|
||||
|
||||
aggregator->SetFilter(filter);
|
||||
@ -193,10 +192,10 @@ Query::Query(const std::vector<String>& lines)
|
||||
CombinerFilter::Ptr filter;
|
||||
|
||||
if (header == "Or" || header == "StatsOr") {
|
||||
filter = boost::make_shared<OrFilter>();
|
||||
filter = make_shared<OrFilter>();
|
||||
Log(LogDebug, "livestatus", "Add OR filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
|
||||
} else {
|
||||
filter = boost::make_shared<AndFilter>();
|
||||
filter = make_shared<AndFilter>();
|
||||
Log(LogDebug, "livestatus", "Add AND filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
|
||||
}
|
||||
|
||||
@ -234,7 +233,7 @@ Query::Query(const std::vector<String>& lines)
|
||||
return;
|
||||
}
|
||||
|
||||
deq.push_back(boost::make_shared<NegateFilter>(filter));
|
||||
deq.push_back(make_shared<NegateFilter>(filter));
|
||||
|
||||
if (deq == stats) {
|
||||
Aggregator::Ptr aggregator = aggregators.back();
|
||||
@ -244,7 +243,7 @@ Query::Query(const std::vector<String>& lines)
|
||||
}
|
||||
|
||||
/* Combine all top-level filters into a single filter. */
|
||||
AndFilter::Ptr top_filter = boost::make_shared<AndFilter>();
|
||||
AndFilter::Ptr top_filter = make_shared<AndFilter>();
|
||||
|
||||
BOOST_FOREACH(const Filter::Ptr& filter, filters) {
|
||||
top_filter->AddSubFilter(filter);
|
||||
@ -311,10 +310,10 @@ Filter::Ptr Query::ParseFilter(const String& params, unsigned long& from, unsign
|
||||
negate = true;
|
||||
}
|
||||
|
||||
Filter::Ptr filter = boost::make_shared<AttributeFilter>(attr, op, val);
|
||||
Filter::Ptr filter = make_shared<AttributeFilter>(attr, op, val);
|
||||
|
||||
if (negate)
|
||||
filter = boost::make_shared<NegateFilter>(filter);
|
||||
filter = make_shared<NegateFilter>(filter);
|
||||
|
||||
/* pre-filter log time duration */
|
||||
if (attr == "time") {
|
||||
@ -411,11 +410,11 @@ void Query::ExecuteGetHelper(const Stream::Ptr& stream)
|
||||
else
|
||||
columns = table->GetColumnNames();
|
||||
|
||||
Array::Ptr rs = boost::make_shared<Array>();
|
||||
Array::Ptr rs = make_shared<Array>();
|
||||
|
||||
if (m_Aggregators.empty()) {
|
||||
BOOST_FOREACH(const Value& object, objects) {
|
||||
Array::Ptr row = boost::make_shared<Array>();
|
||||
Array::Ptr row = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const String& columnName, columns) {
|
||||
Column column = table->GetColumn(columnName);
|
||||
@ -438,7 +437,7 @@ void Query::ExecuteGetHelper(const Stream::Ptr& stream)
|
||||
index++;
|
||||
}
|
||||
|
||||
Array::Ptr row = boost::make_shared<Array>();
|
||||
Array::Ptr row = make_shared<Array>();
|
||||
for (size_t i = 0; i < m_Aggregators.size(); i++)
|
||||
row->Add(stats[i]);
|
||||
|
||||
|
@ -107,10 +107,10 @@ Value ServiceGroupsTable::ActionUrlAccessor(const Value& row)
|
||||
|
||||
Value ServiceGroupsTable::MembersAccessor(const Value& row)
|
||||
{
|
||||
Array::Ptr members = boost::make_shared<Array>();
|
||||
Array::Ptr members = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Service::Ptr& service, static_cast<ServiceGroup::Ptr>(row)->GetMembers()) {
|
||||
Array::Ptr host_svc = boost::make_shared<Array>();
|
||||
Array::Ptr host_svc = make_shared<Array>();
|
||||
host_svc->Add(service->GetHost()->GetName());
|
||||
host_svc->Add(service->GetShortName());
|
||||
members->Add(host_svc);
|
||||
@ -121,10 +121,10 @@ Value ServiceGroupsTable::MembersAccessor(const Value& row)
|
||||
|
||||
Value ServiceGroupsTable::MembersWithStateAccessor(const Value& row)
|
||||
{
|
||||
Array::Ptr members = boost::make_shared<Array>();
|
||||
Array::Ptr members = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const Service::Ptr& service, static_cast<ServiceGroup::Ptr>(row)->GetMembers()) {
|
||||
Array::Ptr host_svc = boost::make_shared<Array>();
|
||||
Array::Ptr host_svc = make_shared<Array>();
|
||||
host_svc->Add(service->GetHost()->GetName());
|
||||
host_svc->Add(service->GetShortName());
|
||||
host_svc->Add(service->GetHost()->GetState());
|
||||
|
@ -1033,7 +1033,7 @@ Value ServicesTable::ContactsAccessor(const Value& row)
|
||||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr contact_names = boost::make_shared<Array>();
|
||||
Array::Ptr contact_names = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetServiceNotificationUsers(service)) {
|
||||
contact_names->Add(user->GetName());
|
||||
@ -1051,7 +1051,7 @@ Value ServicesTable::DowntimesAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr downtimes = service->GetDowntimes();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(downtimes);
|
||||
|
||||
@ -1080,7 +1080,7 @@ Value ServicesTable::DowntimesWithInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr downtimes = service->GetDowntimes();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(downtimes);
|
||||
|
||||
@ -1094,7 +1094,7 @@ Value ServicesTable::DowntimesWithInfoAccessor(const Value& row)
|
||||
if (Service::IsDowntimeExpired(downtime))
|
||||
continue;
|
||||
|
||||
Array::Ptr downtime_info = boost::make_shared<Array>();
|
||||
Array::Ptr downtime_info = make_shared<Array>();
|
||||
downtime_info->Add(downtime->Get("legacy_id"));
|
||||
downtime_info->Add(downtime->Get("author"));
|
||||
downtime_info->Add(downtime->Get("comment"));
|
||||
@ -1113,7 +1113,7 @@ Value ServicesTable::CommentsAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = service->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1142,7 +1142,7 @@ Value ServicesTable::CommentsWithInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = service->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1156,7 +1156,7 @@ Value ServicesTable::CommentsWithInfoAccessor(const Value& row)
|
||||
if (Service::IsCommentExpired(comment))
|
||||
continue;
|
||||
|
||||
Array::Ptr comment_info = boost::make_shared<Array>();
|
||||
Array::Ptr comment_info = make_shared<Array>();
|
||||
comment_info->Add(comment->Get("legacy_id"));
|
||||
comment_info->Add(comment->Get("author"));
|
||||
comment_info->Add(comment->Get("text"));
|
||||
@ -1175,7 +1175,7 @@ Value ServicesTable::CommentsWithExtraInfoAccessor(const Value& row)
|
||||
|
||||
Dictionary::Ptr comments = service->GetComments();
|
||||
|
||||
Array::Ptr ids = boost::make_shared<Array>();
|
||||
Array::Ptr ids = make_shared<Array>();
|
||||
|
||||
ObjectLock olock(comments);
|
||||
|
||||
@ -1189,7 +1189,7 @@ Value ServicesTable::CommentsWithExtraInfoAccessor(const Value& row)
|
||||
if (Service::IsCommentExpired(comment))
|
||||
continue;
|
||||
|
||||
Array::Ptr comment_info = boost::make_shared<Array>();
|
||||
Array::Ptr comment_info = make_shared<Array>();
|
||||
comment_info->Add(comment->Get("legacy_id"));
|
||||
comment_info->Add(comment->Get("author"));
|
||||
comment_info->Add(comment->Get("text"));
|
||||
@ -1218,7 +1218,7 @@ Value ServicesTable::CustomVariableNamesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
@ -1246,7 +1246,7 @@ Value ServicesTable::CustomVariableValuesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
@ -1274,12 +1274,12 @@ Value ServicesTable::CustomVariablesAccessor(const Value& row)
|
||||
if (!customvars)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr cv = boost::make_shared<Array>();
|
||||
Array::Ptr cv = make_shared<Array>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
BOOST_FOREACH(boost::tie(key, value), customvars) {
|
||||
Array::Ptr key_val = boost::make_shared<Array>();
|
||||
Array::Ptr key_val = make_shared<Array>();
|
||||
key_val->Add(key);
|
||||
key_val->Add(value);
|
||||
cv->Add(key_val);
|
||||
@ -1310,7 +1310,7 @@ Value ServicesTable::ContactGroupsAccessor(const Value& row)
|
||||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Array::Ptr contactgroup_names = boost::make_shared<Array>();
|
||||
Array::Ptr contactgroup_names = make_shared<Array>();
|
||||
|
||||
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(service)) {
|
||||
contactgroup_names->Add(usergroup->GetName());
|
||||
|
@ -135,8 +135,8 @@ StateHistTable::StateHistTable(const unsigned long& from, const unsigned long& u
|
||||
if (m_ServicesCache.find(state_hist_service) == m_ServicesCache.end()) {
|
||||
|
||||
/* create new values */
|
||||
state_hist_service_states = boost::make_shared<Array>();
|
||||
state_hist_bag = boost::make_shared<Dictionary>();
|
||||
state_hist_service_states = make_shared<Array>();
|
||||
state_hist_bag = make_shared<Dictionary>();
|
||||
|
||||
state_hist_bag->Set("host_name", state_hist_service->GetHost()->GetName());
|
||||
state_hist_bag->Set("service_description", state_hist_service->GetShortName());
|
||||
@ -195,7 +195,7 @@ StateHistTable::StateHistTable(const unsigned long& from, const unsigned long& u
|
||||
state_hist_bag->Set("until", time); /* add until record for duration calculation */
|
||||
|
||||
/* 2. add new state_hist_bag */
|
||||
Dictionary::Ptr state_hist_bag_new = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr state_hist_bag_new = make_shared<Dictionary>();
|
||||
|
||||
state_hist_bag_new->Set("host_name", state_hist_bag->Get("host_name"));
|
||||
state_hist_bag_new->Set("service_description", state_hist_bag->Get("service_description"));
|
||||
@ -704,7 +704,7 @@ Dictionary::Ptr StateHistTable::GetStateHistAttributes(const String& type, const
|
||||
else
|
||||
return Dictionary::Ptr();
|
||||
|
||||
Dictionary::Ptr bag = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr bag = make_shared<Dictionary>();
|
||||
|
||||
bag->Set("log_class", log_class); /* 0 is the default if not populated */
|
||||
bag->Set("log_type", log_type);
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/application.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
using namespace livestatus;
|
||||
@ -107,7 +106,7 @@ String StatusTable::GetName(void) const
|
||||
|
||||
void StatusTable::FetchRows(const AddRowFunction& addRowFn)
|
||||
{
|
||||
Object::Ptr obj = boost::make_shared<Object>();
|
||||
Object::Ptr obj = make_shared<Object>();
|
||||
|
||||
/* Return a fake row. */
|
||||
addRowFn(obj);
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "base/array.h"
|
||||
#include "base/dictionary.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
@ -48,31 +47,31 @@ Table::Table(void)
|
||||
Table::Ptr Table::GetByName(const String& name, const unsigned long& from, const unsigned long& until)
|
||||
{
|
||||
if (name == "status")
|
||||
return boost::make_shared<StatusTable>();
|
||||
return make_shared<StatusTable>();
|
||||
else if (name == "contactgroups")
|
||||
return boost::make_shared<ContactGroupsTable>();
|
||||
return make_shared<ContactGroupsTable>();
|
||||
else if (name == "contacts")
|
||||
return boost::make_shared<ContactsTable>();
|
||||
return make_shared<ContactsTable>();
|
||||
else if (name == "hostgroups")
|
||||
return boost::make_shared<HostGroupsTable>();
|
||||
return make_shared<HostGroupsTable>();
|
||||
else if (name == "hosts")
|
||||
return boost::make_shared<HostsTable>();
|
||||
return make_shared<HostsTable>();
|
||||
else if (name == "servicegroups")
|
||||
return boost::make_shared<ServiceGroupsTable>();
|
||||
return make_shared<ServiceGroupsTable>();
|
||||
else if (name == "services")
|
||||
return boost::make_shared<ServicesTable>();
|
||||
return make_shared<ServicesTable>();
|
||||
else if (name == "commands")
|
||||
return boost::make_shared<CommandsTable>();
|
||||
return make_shared<CommandsTable>();
|
||||
else if (name == "comments")
|
||||
return boost::make_shared<CommentsTable>();
|
||||
return make_shared<CommentsTable>();
|
||||
else if (name == "downtimes")
|
||||
return boost::make_shared<DowntimesTable>();
|
||||
return make_shared<DowntimesTable>();
|
||||
else if (name == "timeperiods")
|
||||
return boost::make_shared<TimePeriodsTable>();
|
||||
return make_shared<TimePeriodsTable>();
|
||||
else if (name == "log")
|
||||
return boost::make_shared<LogTable>(from, until);
|
||||
return make_shared<LogTable>(from, until);
|
||||
else if (name == "statehist")
|
||||
return boost::make_shared<StateHistTable>(from, until);
|
||||
return make_shared<StateHistTable>(from, until);
|
||||
|
||||
return Table::Ptr();
|
||||
}
|
||||
@ -141,10 +140,10 @@ Value Table::EmptyStringAccessor(const Value&)
|
||||
|
||||
Value Table::EmptyArrayAccessor(const Value&)
|
||||
{
|
||||
return boost::make_shared<Array>();
|
||||
return make_shared<Array>();
|
||||
}
|
||||
|
||||
Value Table::EmptyDictionaryAccessor(const Value&)
|
||||
{
|
||||
return boost::make_shared<Dictionary>();
|
||||
return make_shared<Dictionary>();
|
||||
}
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
@ -41,7 +40,7 @@ void NotificationComponent::Start(void)
|
||||
Service::OnNotificationsRequested.connect(boost::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
|
||||
_2, _3, _4, _5));
|
||||
|
||||
m_NotificationTimer = boost::make_shared<Timer>();
|
||||
m_NotificationTimer = make_shared<Timer>();
|
||||
m_NotificationTimer->SetInterval(5);
|
||||
m_NotificationTimer->OnTimerExpired.connect(boost::bind(&NotificationComponent::NotificationTimerHandler, this));
|
||||
m_NotificationTimer->Start();
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "base/bufferedstream.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
@ -48,7 +47,7 @@ void GraphiteWriter::Start(void)
|
||||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
m_ReconnectTimer = boost::make_shared<Timer>();
|
||||
m_ReconnectTimer = make_shared<Timer>();
|
||||
m_ReconnectTimer->SetInterval(10);
|
||||
m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&GraphiteWriter::ReconnectTimerHandler, this));
|
||||
m_ReconnectTimer->Start();
|
||||
@ -69,13 +68,13 @@ void GraphiteWriter::ReconnectTimerHandler(void)
|
||||
Log(LogWarning, "perfdata", "GraphiteWriter socket on host '" + GetHost() + "' port '" + GetPort() + "' gone. Attempting to reconnect.");
|
||||
}
|
||||
|
||||
TcpSocket::Ptr socket = boost::make_shared<TcpSocket>();
|
||||
TcpSocket::Ptr socket = make_shared<TcpSocket>();
|
||||
|
||||
Log(LogDebug, "perfdata", "GraphiteWriter: Reconnect to tcp socket on host '" + GetHost() + "' port '" + GetPort() + "'.");
|
||||
socket->Connect(GetHost(), GetPort());
|
||||
|
||||
NetworkStream::Ptr net_stream = boost::make_shared<NetworkStream>(socket);
|
||||
m_Stream = boost::make_shared<BufferedStream>(net_stream);
|
||||
NetworkStream::Ptr net_stream = make_shared<NetworkStream>(socket);
|
||||
m_Stream = make_shared<BufferedStream>(net_stream);
|
||||
}
|
||||
|
||||
void GraphiteWriter::CheckResultHandler(const Service::Ptr& service, const Dictionary::Ptr& cr)
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/application.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -39,7 +38,7 @@ void PerfdataWriter::Start(void)
|
||||
|
||||
Service::OnNewCheckResult.connect(boost::bind(&PerfdataWriter::CheckResultHandler, this, _1, _2));
|
||||
|
||||
m_RotationTimer = boost::make_shared<Timer>();
|
||||
m_RotationTimer = make_shared<Timer>();
|
||||
m_RotationTimer->OnTimerExpired.connect(boost::bind(&PerfdataWriter::RotationTimerHandler, this));
|
||||
m_RotationTimer->SetInterval(GetRotationInterval());
|
||||
m_RotationTimer->Start();
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "config.h"
|
||||
#include <boost/program_options.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#ifndef _WIN32
|
||||
@ -77,7 +76,7 @@ static bool LoadConfigFiles(const String& appType, bool validateOnly)
|
||||
ConfigCompiler::CompileText(name, fragment);
|
||||
}
|
||||
|
||||
ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>();
|
||||
ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>();
|
||||
builder->SetType(appType);
|
||||
builder->SetName("application");
|
||||
ConfigItem::Ptr item = builder->Compile();
|
||||
|
@ -143,7 +143,7 @@ Array::Ptr Array::ShallowClone(void) const
|
||||
ASSERT(!OwnsLock());
|
||||
ObjectLock olock(this);
|
||||
|
||||
Array::Ptr clone = boost::make_shared<Array>();
|
||||
Array::Ptr clone = make_shared<Array>();
|
||||
|
||||
std::copy(m_Data.begin(), m_Data.end(), std::back_inserter(clone->m_Data));
|
||||
|
||||
@ -158,7 +158,7 @@ Array::Ptr Array::ShallowClone(void) const
|
||||
*/
|
||||
Array::Ptr Array::FromJson(cJSON *json)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
|
||||
ASSERT(json->type == cJSON_Array);
|
||||
|
||||
|
@ -21,14 +21,13 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <sstream>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
BufferedStream::BufferedStream(const Stream::Ptr& innerStream, size_t maxBufferSize)
|
||||
: m_InnerStream(innerStream), m_Stopped(false), m_Eof(false),
|
||||
m_RecvQ(boost::make_shared<FIFO>()), m_SendQ(boost::make_shared<FIFO>()),
|
||||
m_RecvQ(make_shared<FIFO>()), m_SendQ(make_shared<FIFO>()),
|
||||
m_Blocking(true), m_MaxBufferSize(maxBufferSize), m_Exception()
|
||||
{
|
||||
m_ReadThread = boost::thread(boost::bind(&BufferedStream::ReadThreadProc, this));
|
||||
|
@ -209,7 +209,7 @@ Dictionary::Ptr Dictionary::ShallowClone(void) const
|
||||
ASSERT(!OwnsLock());
|
||||
ObjectLock olock(this);
|
||||
|
||||
Dictionary::Ptr clone = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr clone = make_shared<Dictionary>();
|
||||
|
||||
String key;
|
||||
Value value;
|
||||
@ -228,7 +228,7 @@ Dictionary::Ptr Dictionary::ShallowClone(void) const
|
||||
*/
|
||||
Dictionary::Ptr Dictionary::FromJson(cJSON *json)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
|
||||
ASSERT(json->type == cJSON_Object);
|
||||
|
||||
|
@ -112,7 +112,7 @@ void DynamicObject::SetExtension(const String& key, const Object::Ptr& object)
|
||||
Dictionary::Ptr extensions = GetExtensions();
|
||||
|
||||
if (!extensions) {
|
||||
extensions = boost::make_shared<Dictionary>();
|
||||
extensions = make_shared<Dictionary>();
|
||||
SetExtensions(extensions);
|
||||
}
|
||||
|
||||
@ -212,11 +212,11 @@ void DynamicObject::DumpObjects(const String& filename, int attributeTypes)
|
||||
if (!fp)
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Could not open '" + filename + "' file"));
|
||||
|
||||
StdioStream::Ptr sfp = boost::make_shared<StdioStream>(&fp, false);
|
||||
StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
|
||||
|
||||
BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
|
||||
BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
|
||||
Dictionary::Ptr persistentObject = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr persistentObject = make_shared<Dictionary>();
|
||||
|
||||
persistentObject->Set("type", type->GetName());
|
||||
persistentObject->Set("name", object->GetName());
|
||||
@ -258,7 +258,7 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
|
||||
std::fstream fp;
|
||||
fp.open(filename.CStr(), std::ios_base::in);
|
||||
|
||||
StdioStream::Ptr sfp = boost::make_shared<StdioStream>(&fp, false);
|
||||
StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
|
||||
|
||||
unsigned long restored = 0;
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
@ -13,7 +11,7 @@ class DynamicObject
|
||||
[config] Array::Ptr authorities;
|
||||
[get_protected] bool active;
|
||||
Dictionary::Ptr authority_info {
|
||||
default {{{ return boost::make_shared<Dictionary>(); }}}
|
||||
default {{{ return make_shared<Dictionary>(); }}}
|
||||
};
|
||||
[protected] Dictionary::Ptr extensions;
|
||||
};
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -109,7 +108,7 @@ class RegisterTypeHelper
|
||||
public:
|
||||
RegisterTypeHelper(const String& name, const DynamicType::ObjectFactory& factory)
|
||||
{
|
||||
DynamicType::Ptr type = boost::make_shared<DynamicType>(name, factory);
|
||||
DynamicType::Ptr type = make_shared<DynamicType>(name, factory);
|
||||
DynamicType::RegisterType(type);
|
||||
}
|
||||
};
|
||||
@ -122,7 +121,7 @@ public:
|
||||
template<typename T>
|
||||
shared_ptr<T> DynamicObjectFactory(void)
|
||||
{
|
||||
return boost::make_shared<T>();
|
||||
return make_shared<T>();
|
||||
}
|
||||
|
||||
#define REGISTER_TYPE_ALIAS(type, alias) \
|
||||
|
@ -33,11 +33,14 @@
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/weak_ptr.hpp>
|
||||
#include <boost/smart_ptr/enable_shared_from_this.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using boost::shared_ptr;
|
||||
using boost::weak_ptr;
|
||||
using boost::enable_shared_from_this;
|
||||
using boost::dynamic_pointer_cast;
|
||||
using boost::static_pointer_cast;
|
||||
using boost::make_shared;
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -56,7 +59,7 @@ class Type;
|
||||
*
|
||||
* @ingroup base
|
||||
*/
|
||||
class I2_BASE_API Object : public boost::enable_shared_from_this<Object>
|
||||
class I2_BASE_API Object : public enable_shared_from_this<Object>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Object);
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/registry.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -34,6 +33,6 @@ Value ScriptFunction::Invoke(const std::vector<Value>& arguments)
|
||||
|
||||
RegisterFunctionHelper::RegisterFunctionHelper(const String& name, const ScriptFunction::Callback& function)
|
||||
{
|
||||
ScriptFunction::Ptr func = boost::make_shared<ScriptFunction>(function);
|
||||
ScriptFunction::Ptr func = make_shared<ScriptFunction>(function);
|
||||
ScriptFunctionRegistry::GetInstance()->Register(name, func);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -42,7 +41,7 @@ void ScriptInterpreter::SubscribeFunction(const String& name)
|
||||
|
||||
m_SubscribedFunctions.insert(name);
|
||||
|
||||
ScriptFunction::Ptr sf = boost::make_shared<ScriptFunction>(boost::bind(&ScriptInterpreter::ProcessCall, this, name, _1));
|
||||
ScriptFunction::Ptr sf = make_shared<ScriptFunction>(boost::bind(&ScriptInterpreter::ProcessCall, this, name, _1));
|
||||
ScriptFunctionRegistry::GetInstance()->Register(name, sf);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
};
|
||||
|
||||
#define REGISTER_SCRIPTLANGUAGE(name, klass) \
|
||||
static RegisterLanguageHelper g_RegisterSL_ ## type(name, boost::make_shared<klass>())
|
||||
static RegisterLanguageHelper g_RegisterSL_ ## type(name, make_shared<klass>())
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "base/serializer.h"
|
||||
#include "base/type.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -27,7 +26,7 @@ Dictionary::Ptr Serializer::Serialize(const Object::Ptr& object, int attributeTy
|
||||
{
|
||||
const Type *type = object->GetReflectionType();
|
||||
|
||||
Dictionary::Ptr update = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr update = make_shared<Dictionary>();
|
||||
|
||||
for (int i = 0; i < type->GetFieldCount(); i++) {
|
||||
Field field = type->GetFieldInfo(i);
|
||||
|
@ -282,5 +282,5 @@ Socket::Ptr Socket::Accept(void)
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
return boost::make_shared<Socket>(fd);
|
||||
return make_shared<Socket>(fd);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/utility.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@ -63,7 +62,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
|
||||
m_OwnsStream = ownsStream;
|
||||
m_Tty = IsTty(*stream);
|
||||
|
||||
m_FlushLogTimer = boost::make_shared<Timer>();
|
||||
m_FlushLogTimer = make_shared<Timer>();
|
||||
m_FlushLogTimer->SetInterval(1);
|
||||
m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
|
||||
m_FlushLogTimer->Start();
|
||||
|
@ -43,7 +43,7 @@ TlsStream::TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SS
|
||||
m_InnerStream = dynamic_pointer_cast<BufferedStream>(innerStream);
|
||||
|
||||
if (!m_InnerStream)
|
||||
m_InnerStream = boost::make_shared<BufferedStream>(innerStream);
|
||||
m_InnerStream = make_shared<BufferedStream>(innerStream);
|
||||
|
||||
m_InnerStream->MakeNonBlocking();
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "base/scriptvariable.h"
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
@ -178,7 +177,7 @@ variable: T_SET identifier T_EQUAL value
|
||||
{
|
||||
Value *value = $4;
|
||||
if (value->IsObjectType<ExpressionList>()) {
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
ExpressionList::Ptr exprl = *value;
|
||||
exprl->Execute(dict);
|
||||
delete value;
|
||||
@ -208,7 +207,7 @@ type: partial_specifier T_TYPE identifier
|
||||
if ($1)
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Partial type definition for unknown type '" + name + "'"));
|
||||
|
||||
m_Type = boost::make_shared<ConfigType>(name, yylloc);
|
||||
m_Type = make_shared<ConfigType>(name, yylloc);
|
||||
m_Type->Register();
|
||||
}
|
||||
}
|
||||
@ -238,7 +237,7 @@ partial_specifier: /* Empty */
|
||||
|
||||
typerulelist: '{'
|
||||
{
|
||||
m_RuleLists.push(boost::make_shared<TypeRuleList>());
|
||||
m_RuleLists.push(make_shared<TypeRuleList>());
|
||||
}
|
||||
typerules
|
||||
'}'
|
||||
@ -316,7 +315,7 @@ object:
|
||||
}
|
||||
object_declaration identifier T_STRING object_inherits_specifier expressionlist
|
||||
{
|
||||
ConfigItemBuilder::Ptr item = boost::make_shared<ConfigItemBuilder>(yylloc);
|
||||
ConfigItemBuilder::Ptr item = make_shared<ConfigItemBuilder>(yylloc);
|
||||
|
||||
item->SetType($3);
|
||||
|
||||
@ -442,7 +441,7 @@ expression: identifier operator value
|
||||
free($3);
|
||||
delete $6;
|
||||
|
||||
ExpressionList::Ptr subexprl = boost::make_shared<ExpressionList>();
|
||||
ExpressionList::Ptr subexprl = make_shared<ExpressionList>();
|
||||
subexprl->AddExpression(subexpr);
|
||||
|
||||
$$ = new Expression($1, OperatorPlus, subexprl, yylloc);
|
||||
@ -485,7 +484,7 @@ array_items_inner: /* empty */
|
||||
|
||||
if ($1->IsObjectType<ExpressionList>()) {
|
||||
ExpressionList::Ptr exprl = *$1;
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
exprl->Execute(dict);
|
||||
delete $1;
|
||||
$1 = new Value(dict);
|
||||
@ -503,7 +502,7 @@ array_items_inner: /* empty */
|
||||
|
||||
if ($3->IsObjectType<ExpressionList>()) {
|
||||
ExpressionList::Ptr exprl = *$3;
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
exprl->Execute(dict);
|
||||
delete $3;
|
||||
$3 = new Value(dict);
|
||||
@ -544,63 +543,63 @@ aterm: '(' aexpression ')'
|
||||
|
||||
aexpression: T_STRING
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEReturn, AValue(ATSimple, $1)));
|
||||
$$ = new Value(make_shared<AExpression>(AEReturn, AValue(ATSimple, $1)));
|
||||
free($1);
|
||||
}
|
||||
| T_NUMBER
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEReturn, AValue(ATSimple, $1)));
|
||||
$$ = new Value(make_shared<AExpression>(AEReturn, AValue(ATSimple, $1)));
|
||||
}
|
||||
| T_IDENTIFIER
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEReturn, AValue(ATVariable, $1)));
|
||||
$$ = new Value(make_shared<AExpression>(AEReturn, AValue(ATVariable, $1)));
|
||||
free($1);
|
||||
}
|
||||
| aexpression '+' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEAdd, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEAdd, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression '-' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AESubtract, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AESubtract, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression '*' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEMultiply, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEMultiply, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression '/' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEDivide, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEDivide, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression '&' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEBinaryAnd, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEBinaryAnd, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression '|' aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEBinaryOr, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEBinaryOr, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression T_SHIFT_LEFT aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEShiftLeft, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEShiftLeft, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
| aexpression T_SHIFT_RIGHT aexpression
|
||||
{
|
||||
$$ = new Value(boost::make_shared<AExpression>(AEShiftRight, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
$$ = new Value(make_shared<AExpression>(AEShiftRight, static_cast<AExpression::Ptr>(*$1), static_cast<AExpression::Ptr>(*$3)));
|
||||
delete $1;
|
||||
delete $3;
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/debug.h"
|
||||
#include <sstream>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -107,7 +106,7 @@ void ConfigItem::Link(void)
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
m_LinkedExpressionList = boost::make_shared<ExpressionList>();
|
||||
m_LinkedExpressionList = make_shared<ExpressionList>();
|
||||
|
||||
BOOST_FOREACH(const String& name, m_ParentNames) {
|
||||
ConfigItem::Ptr parent = ConfigItem::GetObject(m_Type, name);
|
||||
@ -163,11 +162,11 @@ DynamicObject::Ptr ConfigItem::Commit(void)
|
||||
|
||||
/* Create a fake update in the format that
|
||||
* DynamicObject::Deserialize expects. */
|
||||
Dictionary::Ptr attrs = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attrs = make_shared<Dictionary>();
|
||||
|
||||
Link();
|
||||
|
||||
Dictionary::Ptr properties = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr properties = make_shared<Dictionary>();
|
||||
GetLinkedExpressionList()->Execute(properties);
|
||||
|
||||
{
|
||||
|
@ -20,14 +20,13 @@
|
||||
#include "config/configitembuilder.h"
|
||||
#include "config/configcompilercontext.h"
|
||||
#include "base/dynamictype.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <sstream>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
ConfigItemBuilder::ConfigItemBuilder(void)
|
||||
: m_Abstract(false), m_ExpressionList(boost::make_shared<ExpressionList>())
|
||||
: m_Abstract(false), m_ExpressionList(make_shared<ExpressionList>())
|
||||
{
|
||||
m_DebugInfo.FirstLine = 0;
|
||||
m_DebugInfo.FirstColumn = 0;
|
||||
@ -36,7 +35,7 @@ ConfigItemBuilder::ConfigItemBuilder(void)
|
||||
}
|
||||
|
||||
ConfigItemBuilder::ConfigItemBuilder(const DebugInfo& debugInfo)
|
||||
: m_Abstract(false), m_ExpressionList(boost::make_shared<ExpressionList>())
|
||||
: m_Abstract(false), m_ExpressionList(make_shared<ExpressionList>())
|
||||
{
|
||||
m_DebugInfo = debugInfo;
|
||||
}
|
||||
@ -103,7 +102,7 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Configuration item '" + m_Name + "' of type '" + m_Type + "' must not inherit from itself."));
|
||||
}
|
||||
|
||||
ExpressionList::Ptr exprl = boost::make_shared<ExpressionList>();
|
||||
ExpressionList::Ptr exprl = make_shared<ExpressionList>();
|
||||
|
||||
Expression execExpr("", OperatorExecute, m_ExpressionList, m_DebugInfo);
|
||||
exprl->AddExpression(execExpr);
|
||||
@ -114,6 +113,6 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
|
||||
Expression nameExpr("__name", OperatorSet, m_Name, m_DebugInfo);
|
||||
exprl->AddExpression(nameExpr);
|
||||
|
||||
return boost::make_shared<ConfigItem>(m_Type, m_Name, m_Abstract, exprl,
|
||||
return make_shared<ConfigItem>(m_Type, m_Name, m_Abstract, exprl,
|
||||
m_Parents, m_DebugInfo);
|
||||
}
|
||||
|
@ -23,13 +23,12 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
ConfigType::ConfigType(const String& name, const DebugInfo& debuginfo)
|
||||
: m_Name(name), m_RuleList(boost::make_shared<TypeRuleList>()), m_DebugInfo(debuginfo)
|
||||
: m_Name(name), m_RuleList(make_shared<TypeRuleList>()), m_DebugInfo(debuginfo)
|
||||
{ }
|
||||
|
||||
String ConfigType::GetName(void) const
|
||||
@ -81,7 +80,7 @@ void ConfigType::ValidateItem(const ConfigItem::Ptr& item)
|
||||
if (item->IsAbstract())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr attrs = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attrs = make_shared<Dictionary>();
|
||||
item->GetLinkedExpressionList()->Execute(attrs);
|
||||
|
||||
std::vector<String> locations;
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/array.h"
|
||||
#include <sstream>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -73,7 +72,7 @@ void Expression::Execute(const Dictionary::Ptr& dictionary) const
|
||||
|
||||
case OperatorSet:
|
||||
if (valueExprl) {
|
||||
dict = boost::make_shared<Dictionary>();
|
||||
dict = make_shared<Dictionary>();
|
||||
valueExprl->Execute(dict);
|
||||
newValue = dict;
|
||||
}
|
||||
@ -91,14 +90,14 @@ void Expression::Execute(const Dictionary::Ptr& dictionary) const
|
||||
|
||||
if (valueExprl) {
|
||||
if (!dict)
|
||||
dict = boost::make_shared<Dictionary>();
|
||||
dict = make_shared<Dictionary>();
|
||||
|
||||
valueExprl->Execute(dict);
|
||||
|
||||
newValue = dict;
|
||||
} else if (valueDict) {
|
||||
if (!dict)
|
||||
dict = boost::make_shared<Dictionary>();
|
||||
dict = make_shared<Dictionary>();
|
||||
|
||||
ObjectLock olock(valueDict);
|
||||
|
||||
@ -111,7 +110,7 @@ void Expression::Execute(const Dictionary::Ptr& dictionary) const
|
||||
newValue = dict;
|
||||
} else if (valueArray) {
|
||||
if (!array)
|
||||
array = boost::make_shared<Array>();
|
||||
array = make_shared<Array>();
|
||||
|
||||
|
||||
ObjectLock olock(valueArray);
|
||||
|
@ -37,7 +37,7 @@ CommandDbObject::CommandDbObject(const DbType::Ptr& type, const String& name1, c
|
||||
|
||||
Dictionary::Ptr CommandDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Command::Ptr command = static_pointer_cast<Command>(GetObject());
|
||||
|
||||
Dictionary::Ptr attrs;
|
||||
|
@ -36,7 +36,7 @@ class CommandDbObject : public DbObject
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CommandDbObject);
|
||||
|
||||
CommandDbObject(const boost::shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
CommandDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
|
||||
virtual Dictionary::Ptr GetConfigFields(void) const;
|
||||
virtual Dictionary::Ptr GetStatusFields(void) const;
|
||||
|
@ -41,7 +41,7 @@ void DbConnection::Start(void)
|
||||
|
||||
DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
|
||||
|
||||
m_CleanUpTimer = boost::make_shared<Timer>();
|
||||
m_CleanUpTimer = make_shared<Timer>();
|
||||
m_CleanUpTimer->SetInterval(60);
|
||||
m_CleanUpTimer->OnTimerExpired.connect(boost::bind(&DbConnection::CleanUpHandler, this));
|
||||
m_CleanUpTimer->Start();
|
||||
@ -49,7 +49,7 @@ void DbConnection::Start(void)
|
||||
|
||||
void DbConnection::StaticInitialize(void)
|
||||
{
|
||||
m_ProgramStatusTimer = boost::make_shared<Timer>();
|
||||
m_ProgramStatusTimer = make_shared<Timer>();
|
||||
m_ProgramStatusTimer->SetInterval(10);
|
||||
m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&DbConnection::ProgramStatusHandler));
|
||||
m_ProgramStatusTimer->Start();
|
||||
@ -61,7 +61,7 @@ void DbConnection::InsertRuntimeVariable(const String& key, const Value& value)
|
||||
query.Table = "runtimevariables";
|
||||
query.Type = DbQueryInsert;
|
||||
query.Category = DbCatProgramStatus;
|
||||
query.Fields = boost::make_shared<Dictionary>();
|
||||
query.Fields = make_shared<Dictionary>();
|
||||
query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query.Fields->Set("varname", key);
|
||||
query.Fields->Set("varvalue", value);
|
||||
@ -74,7 +74,7 @@ void DbConnection::ProgramStatusHandler(void)
|
||||
query1.Table = "programstatus";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatProgramStatus;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
DbObject::OnQuery(query1);
|
||||
|
||||
@ -84,7 +84,7 @@ void DbConnection::ProgramStatusHandler(void)
|
||||
query2.Type = DbQueryInsert;
|
||||
query2.Category = DbCatProgramStatus;
|
||||
|
||||
query2.Fields = boost::make_shared<Dictionary>();
|
||||
query2.Fields = make_shared<Dictionary>();
|
||||
query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query2.Fields->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime()));
|
||||
query2.Fields->Set("program_start_time", DbValue::FromTimestamp(Application::GetStartTime()));
|
||||
@ -105,7 +105,7 @@ void DbConnection::ProgramStatusHandler(void)
|
||||
query3.Table = "runtimevariables";
|
||||
query3.Type = DbQueryDelete;
|
||||
query3.Category = DbCatProgramStatus;
|
||||
query3.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query3.WhereCriteria = make_shared<Dictionary>();
|
||||
query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
DbObject::OnQuery(query3);
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "db_ido/dbquery.h"
|
||||
#include "base/dynamicobject.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -12,7 +11,7 @@ class DbConnection : DynamicObject
|
||||
};
|
||||
|
||||
[config] Dictionary::Ptr cleanup {
|
||||
default {{{ return boost::make_shared<Dictionary>(); }}}
|
||||
default {{{ return make_shared<Dictionary>(); }}}
|
||||
};
|
||||
|
||||
[config] int categories {
|
||||
|
@ -83,7 +83,7 @@ void DbObject::SendConfigUpdate(void)
|
||||
query.Fields->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query.Fields->Set("config_type", 1);
|
||||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query.WhereCriteria = make_shared<Dictionary>();
|
||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Object = GetSelf();
|
||||
query.ConfigUpdate = true;
|
||||
@ -109,7 +109,7 @@ void DbObject::SendStatusUpdate(void)
|
||||
query.Fields->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query.Fields->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime()));
|
||||
query.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query.WhereCriteria = make_shared<Dictionary>();
|
||||
query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
|
||||
query.Object = GetSelf();
|
||||
query.StatusUpdate = true;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "db_ido/dbquery.h"
|
||||
#include "db_ido/dbtype.h"
|
||||
#include "base/dynamicobject.h"
|
||||
#include <boost/smart_ptr.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -69,7 +68,7 @@ public:
|
||||
|
||||
String GetName1(void) const;
|
||||
String GetName2(void) const;
|
||||
boost::shared_ptr<DbType> GetType(void) const;
|
||||
shared_ptr<DbType> GetType(void) const;
|
||||
|
||||
virtual Dictionary::Ptr GetConfigFields(void) const = 0;
|
||||
virtual Dictionary::Ptr GetStatusFields(void) const = 0;
|
||||
@ -85,7 +84,7 @@ public:
|
||||
double GetLastStatusUpdate(void) const;
|
||||
|
||||
protected:
|
||||
DbObject(const boost::shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
DbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
|
||||
virtual bool IsStatusAttribute(const String& attribute) const;
|
||||
|
||||
@ -95,7 +94,7 @@ protected:
|
||||
private:
|
||||
String m_Name1;
|
||||
String m_Name2;
|
||||
boost::shared_ptr<DbType> m_Type;
|
||||
shared_ptr<DbType> m_Type;
|
||||
DynamicObject::Ptr m_Object;
|
||||
double m_LastConfigUpdate;
|
||||
double m_LastStatusUpdate;
|
||||
|
@ -64,7 +64,7 @@ struct I2_DB_IDO_API DbQuery
|
||||
String IdColumn;
|
||||
Dictionary::Ptr Fields;
|
||||
Dictionary::Ptr WhereCriteria;
|
||||
boost::shared_ptr<DbObject> Object;
|
||||
shared_ptr<DbObject> Object;
|
||||
bool ConfigUpdate;
|
||||
bool StatusUpdate;
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "db_ido/i2-db_ido.h"
|
||||
#include "base/object.h"
|
||||
#include "base/registry.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -40,9 +39,9 @@ class I2_DB_IDO_API DbType : public Object
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbType);
|
||||
|
||||
typedef boost::function<boost::shared_ptr<DbObject> (const boost::shared_ptr<DbType>&, const String&, const String&)> ObjectFactory;
|
||||
typedef boost::function<shared_ptr<DbObject> (const shared_ptr<DbType>&, const String&, const String&)> ObjectFactory;
|
||||
typedef std::map<String, DbType::Ptr, string_iless> TypeMap;
|
||||
typedef std::map<std::pair<String, String>, boost::shared_ptr<DbObject>, pair_string_iless> ObjectMap;
|
||||
typedef std::map<std::pair<String, String>, shared_ptr<DbObject>, pair_string_iless> ObjectMap;
|
||||
|
||||
DbType(const String& name, const String& table, long tid, const String& idcolumn, const ObjectFactory& factory);
|
||||
|
||||
@ -56,7 +55,7 @@ public:
|
||||
static DbType::Ptr GetByName(const String& name);
|
||||
static DbType::Ptr GetByID(long tid);
|
||||
|
||||
boost::shared_ptr<DbObject> GetOrCreateObjectByName(const String& name1, const String& name2);
|
||||
shared_ptr<DbObject> GetOrCreateObjectByName(const String& name1, const String& name2);
|
||||
|
||||
private:
|
||||
String m_Name;
|
||||
@ -89,7 +88,7 @@ class RegisterDbTypeHelper
|
||||
public:
|
||||
RegisterDbTypeHelper(const String& name, const String& table, long tid, const String& idcolumn, const DbType::ObjectFactory& factory)
|
||||
{
|
||||
DbType::Ptr dbtype = boost::make_shared<DbType>(name, table, tid, idcolumn, factory);
|
||||
DbType::Ptr dbtype = make_shared<DbType>(name, table, tid, idcolumn, factory);
|
||||
DbType::RegisterType(dbtype);
|
||||
}
|
||||
};
|
||||
@ -102,7 +101,7 @@ public:
|
||||
template<typename T>
|
||||
shared_ptr<T> DbObjectFactory(const DbType::Ptr& type, const String& name1, const String& name2)
|
||||
{
|
||||
return boost::make_shared<T>(type, name1, name2);
|
||||
return make_shared<T>(type, name1, name2);
|
||||
}
|
||||
|
||||
#define REGISTER_DBTYPE(name, table, tid, idcolumn, type) \
|
||||
|
@ -30,12 +30,12 @@ Value DbValue::FromTimestamp(const Value& ts)
|
||||
if (ts.IsEmpty() || ts == 0)
|
||||
return Empty;
|
||||
|
||||
return boost::make_shared<DbValue>(DbValueTimestamp, ts);
|
||||
return make_shared<DbValue>(DbValueTimestamp, ts);
|
||||
}
|
||||
|
||||
Value DbValue::FromTimestampNow(void)
|
||||
{
|
||||
return boost::make_shared<DbValue>(DbValueTimestampNow, Empty);
|
||||
return make_shared<DbValue>(DbValueTimestampNow, Empty);
|
||||
}
|
||||
|
||||
Value DbValue::FromValue(const Value& value)
|
||||
@ -45,7 +45,7 @@ Value DbValue::FromValue(const Value& value)
|
||||
|
||||
Value DbValue::FromObjectInsertID(const Value& value)
|
||||
{
|
||||
return boost::make_shared<DbValue>(DbValueObjectInsertID, value);
|
||||
return make_shared<DbValue>(DbValueObjectInsertID, value);
|
||||
}
|
||||
|
||||
bool DbValue::IsTimestamp(const Value& value)
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "db_ido/i2-db_ido.h"
|
||||
#include "base/object.h"
|
||||
#include "base/value.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ HostDbObject::HostDbObject(const DbType::Ptr& type, const String& name1, const S
|
||||
|
||||
Dictionary::Ptr HostDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Host::Ptr host = static_pointer_cast<Host>(GetObject());
|
||||
|
||||
Service::Ptr service = host->GetCheckService();
|
||||
@ -124,7 +124,7 @@ Dictionary::Ptr HostDbObject::GetConfigFields(void) const
|
||||
|
||||
Dictionary::Ptr HostDbObject::GetStatusFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Host::Ptr host = static_pointer_cast<Host>(GetObject());
|
||||
Service::Ptr service = host->GetCheckService();
|
||||
|
||||
@ -198,7 +198,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
query_del1.Table = GetType()->GetTable() + "_parenthosts";
|
||||
query_del1.Type = DbQueryDelete;
|
||||
query_del1.Category = DbCatConfig;
|
||||
query_del1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria->Set(GetType()->GetTable() + "_id", DbValue::FromObjectInsertID(GetObject()));
|
||||
OnQuery(query_del1);
|
||||
|
||||
@ -206,7 +206,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
query_del2.Table = GetType()->GetTable() + "dependencies";
|
||||
query_del2.Type = DbQueryDelete;
|
||||
query_del2.Category = DbCatConfig;
|
||||
query_del2.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del2.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del2.WhereCriteria->Set("dependent_host_object_id", host);
|
||||
OnQuery(query_del2);
|
||||
|
||||
@ -214,7 +214,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
Log(LogDebug, "db_ido", "host parents: " + parent->GetName());
|
||||
|
||||
/* parents: host_id, parent_host_object_id */
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set(GetType()->GetTable() + "_id", DbValue::FromObjectInsertID(GetObject()));
|
||||
fields1->Set("parent_host_object_id", parent);
|
||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -227,7 +227,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
OnQuery(query1);
|
||||
|
||||
/* host dependencies */
|
||||
Dictionary::Ptr fields2 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields2 = make_shared<Dictionary>();
|
||||
fields2->Set("host_object_id", parent);
|
||||
fields2->Set("dependent_host_object_id", host);
|
||||
fields2->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -249,7 +249,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetServiceNotificationUsers(service)) {
|
||||
Log(LogDebug, "db_ido", "host contacts: " + user->GetName());
|
||||
|
||||
Dictionary::Ptr fields_contact = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
|
||||
fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
|
||||
fields_contact->Set("contact_object_id", user);
|
||||
fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -267,7 +267,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(service)) {
|
||||
Log(LogDebug, "db_ido", "host contactgroups: " + usergroup->GetName());
|
||||
|
||||
Dictionary::Ptr fields_contact = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
|
||||
fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
|
||||
fields_contact->Set("contactgroup_object_id", usergroup);
|
||||
fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -288,7 +288,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
query_del3.Table = "customvariables";
|
||||
query_del3.Type = DbQueryDelete;
|
||||
query_del3.Category = DbCatConfig;
|
||||
query_del3.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del3.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del3.WhereCriteria->Set("object_id", host);
|
||||
OnQuery(query_del3);
|
||||
|
||||
@ -306,7 +306,7 @@ void HostDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(boost::tie(key, value), customvars) {
|
||||
Log(LogDebug, "db_ido", "host customvar key: '" + key + "' value: '" + Convert::ToString(value) + "'");
|
||||
|
||||
Dictionary::Ptr fields3 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields3 = make_shared<Dictionary>();
|
||||
fields3->Set("varname", Convert::ToString(key));
|
||||
fields3->Set("varvalue", Convert::ToString(value));
|
||||
fields3->Set("config_type", 1);
|
||||
|
@ -35,7 +35,7 @@ HostGroupDbObject::HostGroupDbObject(const DbType::Ptr& type, const String& name
|
||||
|
||||
Dictionary::Ptr HostGroupDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
HostGroup::Ptr group = static_pointer_cast<HostGroup>(GetObject());
|
||||
|
||||
fields->Set("alias", group->GetDisplayName());
|
||||
@ -56,7 +56,7 @@ void HostGroupDbObject::OnConfigUpdate(void)
|
||||
query1.Table = DbType::GetByName("HostGroup")->GetTable() + "_members";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatConfig;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("hostgroup_id", DbValue::FromObjectInsertID(group));
|
||||
OnQuery(query1);
|
||||
|
||||
@ -65,7 +65,7 @@ void HostGroupDbObject::OnConfigUpdate(void)
|
||||
query2.Table = DbType::GetByName("HostGroup")->GetTable() + "_members";
|
||||
query2.Type = DbQueryInsert;
|
||||
query2.Category = DbCatConfig;
|
||||
query2.Fields = boost::make_shared<Dictionary>();
|
||||
query2.Fields = make_shared<Dictionary>();
|
||||
query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query2.Fields->Set("hostgroup_id", DbValue::FromObjectInsertID(group));
|
||||
query2.Fields->Set("host_object_id", host);
|
||||
|
@ -78,7 +78,7 @@ ServiceDbObject::ServiceDbObject(const DbType::Ptr& type, const String& name1, c
|
||||
|
||||
Dictionary::Ptr ServiceDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Service::Ptr service = static_pointer_cast<Service>(GetObject());
|
||||
|
||||
Host::Ptr host = service->GetHost();
|
||||
@ -147,7 +147,7 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields(void) const
|
||||
|
||||
Dictionary::Ptr ServiceDbObject::GetStatusFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
Service::Ptr service = static_pointer_cast<Service>(GetObject());
|
||||
Dictionary::Ptr attrs;
|
||||
|
||||
@ -218,7 +218,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
query_del1.Table = GetType()->GetTable() + "dependencies";
|
||||
query_del1.Type = DbQueryDelete;
|
||||
query_del1.Category = DbCatConfig;
|
||||
query_del1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria->Set("dependent_service_object_id", service);
|
||||
OnQuery(query_del1);
|
||||
|
||||
@ -226,7 +226,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
Log(LogDebug, "db_ido", "service parents: " + parent->GetName());
|
||||
|
||||
/* service dependencies */
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("service_object_id", parent);
|
||||
fields1->Set("dependent_service_object_id", service);
|
||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -245,7 +245,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetServiceNotificationUsers(service)) {
|
||||
Log(LogDebug, "db_ido", "service contacts: " + user->GetName());
|
||||
|
||||
Dictionary::Ptr fields_contact = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
|
||||
fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));
|
||||
fields_contact->Set("contact_object_id", user);
|
||||
fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -263,7 +263,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(service)) {
|
||||
Log(LogDebug, "db_ido", "service contactgroups: " + usergroup->GetName());
|
||||
|
||||
Dictionary::Ptr fields_contact = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields_contact = make_shared<Dictionary>();
|
||||
fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));
|
||||
fields_contact->Set("contactgroup_object_id", usergroup);
|
||||
fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -283,7 +283,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
query_del2.Table = "customvariables";
|
||||
query_del2.Type = DbQueryDelete;
|
||||
query_del2.Category = DbCatConfig;
|
||||
query_del2.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del2.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del2.WhereCriteria->Set("object_id", service);
|
||||
OnQuery(query_del2);
|
||||
|
||||
@ -302,7 +302,7 @@ void ServiceDbObject::OnConfigUpdate(void)
|
||||
BOOST_FOREACH(boost::tie(key, value), customvars) {
|
||||
Log(LogDebug, "db_ido", "service customvar key: '" + key + "' value: '" + Convert::ToString(value) + "'");
|
||||
|
||||
Dictionary::Ptr fields2 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields2 = make_shared<Dictionary>();
|
||||
fields2->Set("varname", Convert::ToString(key));
|
||||
fields2->Set("varvalue", Convert::ToString(value));
|
||||
fields2->Set("config_type", 1);
|
||||
@ -416,7 +416,7 @@ void ServiceDbObject::AddCommentByType(const DynamicObject::Ptr& object, const D
|
||||
unsigned long entry_time = static_cast<long>(comment->Get("entry_time"));
|
||||
unsigned long entry_time_usec = (comment->Get("entry_time") - entry_time) * 1000 * 1000;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("entry_time", DbValue::FromTimestamp(entry_time));
|
||||
fields1->Set("entry_time_usec", entry_time_usec);
|
||||
fields1->Set("entry_type", comment->Get("entry_type"));
|
||||
@ -468,7 +468,7 @@ void ServiceDbObject::RemoveComments(const Service::Ptr& service)
|
||||
query1.Table = "comments";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatComment;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("object_id", service);
|
||||
OnQuery(query1);
|
||||
|
||||
@ -498,7 +498,7 @@ void ServiceDbObject::RemoveComment(const Service::Ptr& service, const Dictionar
|
||||
query1.Table = "comments";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatComment;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("object_id", service);
|
||||
query1.WhereCriteria->Set("internal_comment_id", comment->Get("legacy_id"));
|
||||
OnQuery(query1);
|
||||
@ -520,12 +520,12 @@ void ServiceDbObject::RemoveComment(const Service::Ptr& service, const Dictionar
|
||||
query2.Type = DbQueryUpdate;
|
||||
query2.Category = DbCatComment;
|
||||
|
||||
Dictionary::Ptr fields2 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields2 = make_shared<Dictionary>();
|
||||
fields2->Set("deletion_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields2->Set("deletion_time_usec", time_bag->Get("time_usec"));
|
||||
query2.Fields = fields2;
|
||||
|
||||
query2.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query2.WhereCriteria = make_shared<Dictionary>();
|
||||
query2.WhereCriteria->Set("internal_comment_id", comment->Get("legacy_id"));
|
||||
query2.WhereCriteria->Set("comment_time", DbValue::FromTimestamp(entry_time));
|
||||
query2.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
@ -584,7 +584,7 @@ void ServiceDbObject::AddDowntimeInternal(const Service::Ptr& service, const Dic
|
||||
|
||||
void ServiceDbObject::AddDowntimeByType(const DynamicObject::Ptr& object, const Dictionary::Ptr& downtime, bool historical)
|
||||
{
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("entry_time", DbValue::FromTimestamp(downtime->Get("entry_time")));
|
||||
fields1->Set("object_id", object);
|
||||
|
||||
@ -638,7 +638,7 @@ void ServiceDbObject::RemoveDowntimes(const Service::Ptr& service)
|
||||
query1.Table = "scheduleddowntime";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatDowntime;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("object_id", service);
|
||||
OnQuery(query1);
|
||||
|
||||
@ -668,7 +668,7 @@ void ServiceDbObject::RemoveDowntime(const Service::Ptr& service, const Dictiona
|
||||
query1.Table = "scheduleddowntime";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatDowntime;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("object_id", service);
|
||||
query1.WhereCriteria->Set("internal_downtime_id", downtime->Get("legacy_id"));
|
||||
OnQuery(query1);
|
||||
@ -688,13 +688,13 @@ void ServiceDbObject::RemoveDowntime(const Service::Ptr& service, const Dictiona
|
||||
query3.Type = DbQueryUpdate;
|
||||
query3.Category = DbCatDowntime;
|
||||
|
||||
Dictionary::Ptr fields3 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields3 = make_shared<Dictionary>();
|
||||
fields3->Set("was_cancelled", downtime->Get("was_cancelled") ? 1 : 0);
|
||||
fields3->Set("actual_end_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields3->Set("actual_end_time_usec", time_bag->Get("time_usec"));
|
||||
query3.Fields = fields3;
|
||||
|
||||
query3.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query3.WhereCriteria = make_shared<Dictionary>();
|
||||
query3.WhereCriteria->Set("internal_downtime_id", downtime->Get("legacy_id"));
|
||||
query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->Get("entry_time")));
|
||||
query3.WhereCriteria->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->Get("start_time")));
|
||||
@ -727,7 +727,7 @@ void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Diction
|
||||
query1.Type = DbQueryUpdate;
|
||||
query1.Category = DbCatDowntime;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("was_started", 1);
|
||||
fields1->Set("actual_start_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("actual_start_time_usec", time_bag->Get("time_usec"));
|
||||
@ -735,7 +735,7 @@ void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Diction
|
||||
fields1->Set("trigger_time", DbValue::FromTimestamp(downtime->Get("trigger_time")));
|
||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("object_id", service);
|
||||
query1.WhereCriteria->Set("internal_downtime_id", downtime->Get("legacy_id"));
|
||||
|
||||
@ -754,7 +754,7 @@ void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Diction
|
||||
query3.Type = DbQueryUpdate;
|
||||
query3.Category = DbCatDowntime;
|
||||
|
||||
Dictionary::Ptr fields3 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields3 = make_shared<Dictionary>();
|
||||
fields3->Set("was_started", 1);
|
||||
fields3->Set("is_in_effect", 1);
|
||||
fields3->Set("actual_start_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
@ -762,7 +762,7 @@ void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Diction
|
||||
fields3->Set("trigger_time", DbValue::FromTimestamp(downtime->Get("trigger_time")));
|
||||
query3.Fields = fields3;
|
||||
|
||||
query3.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query3.WhereCriteria = make_shared<Dictionary>();
|
||||
query3.WhereCriteria->Set("internal_downtime_id", downtime->Get("legacy_id"));
|
||||
query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->Get("entry_time")));
|
||||
query3.WhereCriteria->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->Get("start_time")));
|
||||
@ -793,7 +793,7 @@ void ServiceDbObject::AddAcknowledgementHistory(const Service::Ptr& service, con
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatAcknowledgement;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("entry_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("entry_time_usec", time_bag->Get("time_usec"));
|
||||
fields1->Set("acknowledgement_type", type);
|
||||
@ -836,7 +836,7 @@ void ServiceDbObject::AddContactNotificationHistory(const Service::Ptr& service,
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatNotification;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("contact_object_id", user);
|
||||
fields1->Set("start_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("start_time_usec", time_bag->Get("time_usec"));
|
||||
@ -874,7 +874,7 @@ void ServiceDbObject::AddNotificationHistory(const Service::Ptr& service, const
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatNotification;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("notification_type", 1); /* service */
|
||||
fields1->Set("notification_reason", CompatUtility::MapNotificationReasonType(type));
|
||||
fields1->Set("object_id", service);
|
||||
@ -924,7 +924,7 @@ void ServiceDbObject::AddStateChangeHistory(const Service::Ptr& service, const D
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatStateHistory;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("state_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("state_time_usec", time_bag->Get("time_usec"));
|
||||
fields1->Set("object_id", service);
|
||||
@ -1258,7 +1258,7 @@ void ServiceDbObject::AddLogHistory(const Service::Ptr& service, String buffer,
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatLog;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
fields1->Set("logentry_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("entry_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("entry_time_usec", time_bag->Get("time_usec"));
|
||||
@ -1296,7 +1296,7 @@ void ServiceDbObject::AddFlappingHistory(const Service::Ptr& service, FlappingSt
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatFlapping;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
|
||||
fields1->Set("event_time", DbValue::FromTimestamp(time_bag->Get("time_sec")));
|
||||
fields1->Set("event_time_usec", time_bag->Get("time_usec"));
|
||||
@ -1352,7 +1352,7 @@ void ServiceDbObject::AddServiceCheckHistory(const Service::Ptr& service, const
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatCheck;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
Dictionary::Ptr attrs;
|
||||
|
||||
{
|
||||
@ -1421,7 +1421,7 @@ void ServiceDbObject::AddEventHandlerHistory(const Service::Ptr& service)
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatEventHandler;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
|
||||
fields1->Set("eventhandler_type", 1); /* service */
|
||||
fields1->Set("object_id", service);
|
||||
@ -1459,7 +1459,7 @@ void ServiceDbObject::AddExternalCommandHistory(double time, const String& comma
|
||||
query1.Type = DbQueryInsert;
|
||||
query1.Category = DbCatExternalCommand;
|
||||
|
||||
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields1 = make_shared<Dictionary>();
|
||||
|
||||
fields1->Set("entry_time", DbValue::FromTimestamp(static_cast<long>(time)));
|
||||
fields1->Set("command_type", CompatUtility::MapExternalCommandType(command));
|
||||
|
@ -34,7 +34,7 @@ ServiceGroupDbObject::ServiceGroupDbObject(const DbType::Ptr& type, const String
|
||||
|
||||
Dictionary::Ptr ServiceGroupDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
ServiceGroup::Ptr group = static_pointer_cast<ServiceGroup>(GetObject());
|
||||
|
||||
fields->Set("alias", group->GetDisplayName());
|
||||
@ -55,7 +55,7 @@ void ServiceGroupDbObject::OnConfigUpdate(void)
|
||||
query1.Table = DbType::GetByName("ServiceGroup")->GetTable() + "_members";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatConfig;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("servicegroup_id", DbValue::FromObjectInsertID(group));
|
||||
OnQuery(query1);
|
||||
|
||||
@ -64,7 +64,7 @@ void ServiceGroupDbObject::OnConfigUpdate(void)
|
||||
query2.Table = DbType::GetByName("ServiceGroup")->GetTable() + "_members";
|
||||
query2.Type = DbQueryInsert;
|
||||
query2.Category = DbCatConfig;
|
||||
query2.Fields = boost::make_shared<Dictionary>();
|
||||
query2.Fields = make_shared<Dictionary>();
|
||||
query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query2.Fields->Set("servicegroup_id", DbValue::FromObjectInsertID(group));
|
||||
query2.Fields->Set("service_object_id", service);
|
||||
|
@ -38,7 +38,7 @@ TimePeriodDbObject::TimePeriodDbObject(const DbType::Ptr& type, const String& na
|
||||
|
||||
Dictionary::Ptr TimePeriodDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
TimePeriod::Ptr tp = static_pointer_cast<TimePeriod>(GetObject());
|
||||
|
||||
fields->Set("alias", tp->GetDisplayName());
|
||||
@ -59,7 +59,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
|
||||
query_del1.Table = GetType()->GetTable() + "_timeranges";
|
||||
query_del1.Type = DbQueryDelete;
|
||||
query_del1.Category = DbCatConfig;
|
||||
query_del1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria = make_shared<Dictionary>();
|
||||
query_del1.WhereCriteria->Set("timeperiod_id", DbValue::FromObjectInsertID(tp));
|
||||
OnQuery(query_del1);
|
||||
|
||||
@ -98,7 +98,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
|
||||
}
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
Array::Ptr segments = boost::make_shared<Array>();
|
||||
Array::Ptr segments = make_shared<Array>();
|
||||
LegacyTimePeriod::ProcessTimeRanges(value, &reference, segments);
|
||||
|
||||
ObjectLock olock(segments);
|
||||
@ -111,7 +111,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
|
||||
query.Table = GetType()->GetTable() + "_timeranges";
|
||||
query.Type = DbQueryInsert;
|
||||
query.Category = DbCatConfig;
|
||||
query.Fields = boost::make_shared<Dictionary>();
|
||||
query.Fields = make_shared<Dictionary>();
|
||||
query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query.Fields->Set("timeperiod_id", DbValue::FromObjectInsertID(tp));
|
||||
query.Fields->Set("day", wday);
|
||||
|
@ -37,7 +37,7 @@ UserDbObject::UserDbObject(const DbType::Ptr& type, const String& name1, const S
|
||||
|
||||
Dictionary::Ptr UserDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
User::Ptr user = static_pointer_cast<User>(GetObject());
|
||||
|
||||
fields->Set("alias", user->GetDisplayName());
|
||||
@ -71,7 +71,7 @@ Dictionary::Ptr UserDbObject::GetConfigFields(void) const
|
||||
|
||||
Dictionary::Ptr UserDbObject::GetStatusFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
User::Ptr user = static_pointer_cast<User>(GetObject());
|
||||
|
||||
fields->Set("host_notifications_enabled", user->GetEnableNotifications());
|
||||
@ -87,7 +87,7 @@ Dictionary::Ptr UserDbObject::GetStatusFields(void) const
|
||||
|
||||
void UserDbObject::OnConfigUpdate(void)
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
User::Ptr user = static_pointer_cast<User>(GetObject());
|
||||
|
||||
/* contact addresses */
|
||||
|
@ -35,7 +35,7 @@ UserGroupDbObject::UserGroupDbObject(const DbType::Ptr& type, const String& name
|
||||
|
||||
Dictionary::Ptr UserGroupDbObject::GetConfigFields(void) const
|
||||
{
|
||||
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr fields = make_shared<Dictionary>();
|
||||
UserGroup::Ptr group = static_pointer_cast<UserGroup>(GetObject());
|
||||
|
||||
fields->Set("alias", group->GetDisplayName());
|
||||
@ -56,7 +56,7 @@ void UserGroupDbObject::OnConfigUpdate(void)
|
||||
query1.Table = DbType::GetByName("UserGroup")->GetTable() + "_members";
|
||||
query1.Type = DbQueryDelete;
|
||||
query1.Category = DbCatConfig;
|
||||
query1.WhereCriteria = boost::make_shared<Dictionary>();
|
||||
query1.WhereCriteria = make_shared<Dictionary>();
|
||||
query1.WhereCriteria->Set("instance_id", 0);
|
||||
query1.WhereCriteria->Set("contactgroup_id", DbValue::FromObjectInsertID(group));
|
||||
OnQuery(query1);
|
||||
@ -66,7 +66,7 @@ void UserGroupDbObject::OnConfigUpdate(void)
|
||||
query2.Table = DbType::GetByName("UserGroup")->GetTable() + "_members";
|
||||
query2.Type = DbQueryInsert;
|
||||
query2.Category = DbCatConfig;
|
||||
query2.Fields = boost::make_shared<Dictionary>();
|
||||
query2.Fields = make_shared<Dictionary>();
|
||||
query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||
query2.Fields->Set("contactgroup_id", DbValue::FromObjectInsertID(group));
|
||||
query2.Fields->Set("contact_object_id", user);
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/objectlock.h"
|
||||
#include "base/debug.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
@ -36,8 +35,8 @@ using namespace icinga;
|
||||
|
||||
Dictionary::Ptr CompatUtility::GetHostConfigAttributes(const Host::Ptr& host)
|
||||
{
|
||||
Dictionary::Ptr attr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr service_attr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attr = make_shared<Dictionary>();
|
||||
Dictionary::Ptr service_attr = make_shared<Dictionary>();
|
||||
|
||||
ASSERT(host->OwnsLock());
|
||||
|
||||
@ -166,7 +165,7 @@ Dictionary::Ptr CompatUtility::GetHostConfigAttributes(const Host::Ptr& host)
|
||||
|
||||
Dictionary::Ptr CompatUtility::GetServiceStatusAttributes(const Service::Ptr& service, CompatObjectType type)
|
||||
{
|
||||
Dictionary::Ptr attr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attr = make_shared<Dictionary>();
|
||||
|
||||
ASSERT(service->OwnsLock());
|
||||
|
||||
@ -291,7 +290,7 @@ Dictionary::Ptr CompatUtility::GetServiceStatusAttributes(const Service::Ptr& se
|
||||
|
||||
Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& service)
|
||||
{
|
||||
Dictionary::Ptr attr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attr = make_shared<Dictionary>();
|
||||
|
||||
ASSERT(service->OwnsLock());
|
||||
|
||||
@ -418,7 +417,7 @@ Dictionary::Ptr CompatUtility::GetServiceConfigAttributes(const Service::Ptr& se
|
||||
|
||||
Dictionary::Ptr CompatUtility::GetCommandConfigAttributes(const Command::Ptr& command)
|
||||
{
|
||||
Dictionary::Ptr attr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr attr = make_shared<Dictionary>();
|
||||
|
||||
Value commandLine = command->GetCommandLine();
|
||||
|
||||
@ -459,7 +458,7 @@ Dictionary::Ptr CompatUtility::GetCustomVariableConfig(const DynamicObject::Ptr&
|
||||
return Dictionary::Ptr();
|
||||
}
|
||||
|
||||
Dictionary::Ptr customvars = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr customvars = make_shared<Dictionary>();
|
||||
|
||||
if (!custom)
|
||||
return Dictionary::Ptr();
|
||||
@ -528,7 +527,7 @@ Dictionary::Ptr CompatUtility::GetCheckResultOutput(const Dictionary::Ptr& cr)
|
||||
|
||||
String long_output;
|
||||
String output;
|
||||
Dictionary::Ptr bag = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr bag = make_shared<Dictionary>();
|
||||
|
||||
String raw_output = cr->Get("output");
|
||||
|
||||
@ -574,7 +573,7 @@ String CompatUtility::EscapeString(const String& str)
|
||||
|
||||
Dictionary::Ptr CompatUtility::ConvertTimestamp(double time)
|
||||
{
|
||||
Dictionary::Ptr time_bag = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr time_bag = make_shared<Dictionary>();
|
||||
|
||||
unsigned long time_sec = static_cast<long>(time);
|
||||
unsigned long time_usec = (time - time_sec) * 1000 * 1000;
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "config/configitembuilder.h"
|
||||
#include "config/configcompilercontext.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -170,7 +169,7 @@ void Host::UpdateSlaveServices(void)
|
||||
if (di.Path.IsEmpty())
|
||||
di = item->GetDebugInfo();
|
||||
|
||||
ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>(di);
|
||||
ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
|
||||
builder->SetType("Service");
|
||||
builder->SetName(name);
|
||||
builder->AddExpression("host", OperatorSet, GetName());
|
||||
@ -193,7 +192,7 @@ void Host::UpdateSlaveServices(void)
|
||||
}
|
||||
|
||||
/* Clone attributes from the service expression list. */
|
||||
ExpressionList::Ptr svc_exprl = boost::make_shared<ExpressionList>();
|
||||
ExpressionList::Ptr svc_exprl = make_shared<ExpressionList>();
|
||||
item->GetLinkedExpressionList()->ExtractPath(path, svc_exprl);
|
||||
|
||||
std::vector<String> dpath;
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/timer.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "base/timer.h"
|
||||
#include "base/scriptvariable.h"
|
||||
#include "base/initialize.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -55,7 +54,7 @@ int IcingaApplication::Main(void)
|
||||
Log(LogDebug, "icinga", "In IcingaApplication::Main()");
|
||||
|
||||
/* periodically dump the program state */
|
||||
l_RetentionTimer = boost::make_shared<Timer>();
|
||||
l_RetentionTimer = make_shared<Timer>();
|
||||
l_RetentionTimer->SetInterval(300);
|
||||
l_RetentionTimer->OnTimerExpired.connect(boost::bind(&IcingaApplication::DumpProgramState, this));
|
||||
l_RetentionTimer->Start();
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -40,7 +39,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const std::vector<MacroRes
|
||||
if (str.IsScalar()) {
|
||||
result = InternalResolveMacros(str, resolvers, cr, escapeFn, escapeMacros);
|
||||
} else if (str.IsObjectType<Array>()) {
|
||||
Array::Ptr resultArr = boost::make_shared<Array>();
|
||||
Array::Ptr resultArr = make_shared<Array>();
|
||||
Array::Ptr arr = str;
|
||||
|
||||
ObjectLock olock(arr);
|
||||
|
@ -18,12 +18,11 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/macroresolver.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
StaticMacroResolver::StaticMacroResolver(void)
|
||||
: m_Macros(boost::make_shared<Dictionary>())
|
||||
: m_Macros(make_shared<Dictionary>())
|
||||
{ }
|
||||
|
||||
void StaticMacroResolver::Add(const String& macro, const String& value)
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "base/process.h"
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -49,7 +48,7 @@ ServiceState PluginUtility::ExitStatusToState(int exitStatus)
|
||||
|
||||
Dictionary::Ptr PluginUtility::ParseCheckOutput(const String& output)
|
||||
{
|
||||
Dictionary::Ptr result = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr result = make_shared<Dictionary>();
|
||||
|
||||
String text;
|
||||
String perfdata;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/convert.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
@ -334,7 +333,7 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr, const String& author
|
||||
if (remove_acknowledgement_comments)
|
||||
RemoveCommentsByType(CommentAcknowledgement);
|
||||
|
||||
Dictionary::Ptr vars_after = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr vars_after = make_shared<Dictionary>();
|
||||
vars_after->Set("state", GetState());
|
||||
vars_after->Set("state_type", GetStateType());
|
||||
vars_after->Set("attempt", GetCheckAttempt());
|
||||
@ -458,7 +457,7 @@ void Service::ExecuteCheck(void)
|
||||
}
|
||||
|
||||
/* keep track of scheduling info in case the check type doesn't provide its own information */
|
||||
Dictionary::Ptr checkInfo = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr checkInfo = make_shared<Dictionary>();
|
||||
checkInfo->Set("schedule_start", GetNextCheck());
|
||||
checkInfo->Set("execution_start", Utility::GetTime());
|
||||
|
||||
@ -483,7 +482,7 @@ void Service::ExecuteCheck(void)
|
||||
|
||||
Log(LogWarning, "icinga", message);
|
||||
|
||||
result = boost::make_shared<Dictionary>();
|
||||
result = make_shared<Dictionary>();
|
||||
result->Set("state", StateUnknown);
|
||||
result->Set("output", message);
|
||||
}
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
@ -55,7 +54,7 @@ String Service::AddComment(CommentType entryType, const String& author,
|
||||
else
|
||||
uid = id;
|
||||
|
||||
Dictionary::Ptr comment = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr comment = make_shared<Dictionary>();
|
||||
comment->Set("id", uid);
|
||||
comment->Set("entry_time", Utility::GetTime());
|
||||
comment->Set("entry_type", entryType);
|
||||
@ -183,7 +182,7 @@ void Service::AddCommentsToCache(void)
|
||||
|
||||
String id;
|
||||
Dictionary::Ptr comment;
|
||||
BOOST_FOREACH(tie(id, comment), comments) {
|
||||
BOOST_FOREACH(boost::tie(id, comment), comments) {
|
||||
int legacy_id = comment->Get("legacy_id");
|
||||
|
||||
if (legacy_id >= l_NextCommentID)
|
||||
@ -205,7 +204,7 @@ void Service::RemoveCommentsByType(int type)
|
||||
|
||||
String id;
|
||||
Dictionary::Ptr comment;
|
||||
BOOST_FOREACH(tie(id, comment), comments) {
|
||||
BOOST_FOREACH(boost::tie(id, comment), comments) {
|
||||
if (comment->Get("entry_type") == type)
|
||||
removedComments.push_back(id);
|
||||
}
|
||||
@ -227,7 +226,7 @@ void Service::RemoveExpiredComments(void)
|
||||
|
||||
String id;
|
||||
Dictionary::Ptr comment;
|
||||
BOOST_FOREACH(tie(id, comment), comments) {
|
||||
BOOST_FOREACH(boost::tie(id, comment), comments) {
|
||||
if (IsCommentExpired(comment))
|
||||
expiredComments.push_back(id);
|
||||
}
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/timer.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -57,7 +56,7 @@ String Service::AddDowntime(const String& comment_id,
|
||||
else
|
||||
uid = id;
|
||||
|
||||
Dictionary::Ptr downtime = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr downtime = make_shared<Dictionary>();
|
||||
downtime->Set("id", uid);
|
||||
downtime->Set("entry_time", Utility::GetTime());
|
||||
downtime->Set("comment_id", comment_id);
|
||||
@ -66,7 +65,7 @@ String Service::AddDowntime(const String& comment_id,
|
||||
downtime->Set("fixed", fixed);
|
||||
downtime->Set("duration", duration);
|
||||
downtime->Set("triggered_by", triggeredBy);
|
||||
downtime->Set("triggers", boost::make_shared<Dictionary>());
|
||||
downtime->Set("triggers", make_shared<Dictionary>());
|
||||
downtime->Set("trigger_time", 0);
|
||||
|
||||
int legacy_id;
|
||||
@ -268,7 +267,7 @@ bool Service::IsDowntimeExpired(const Dictionary::Ptr& downtime)
|
||||
void Service::StartDowntimesExpiredTimer(void)
|
||||
{
|
||||
if (!l_DowntimesExpireTimer) {
|
||||
l_DowntimesExpireTimer = boost::make_shared<Timer>();
|
||||
l_DowntimesExpireTimer = make_shared<Timer>();
|
||||
l_DowntimesExpireTimer->SetInterval(60);
|
||||
l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Service::DowntimesExpireTimerHandler));
|
||||
l_DowntimesExpireTimer->Start();
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/utility.h"
|
||||
#include "base/convert.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/utility.h"
|
||||
#include "config/configitembuilder.h"
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
|
||||
@ -125,7 +124,7 @@ void Service::UpdateSlaveNotifications(void)
|
||||
if (di.Path.IsEmpty())
|
||||
di = item->GetDebugInfo();
|
||||
|
||||
ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>(di);
|
||||
ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
|
||||
builder->SetType("Notification");
|
||||
builder->SetName(name);
|
||||
builder->AddExpression("host", OperatorSet, GetHost()->GetName());
|
||||
@ -147,7 +146,7 @@ void Service::UpdateSlaveNotifications(void)
|
||||
}
|
||||
|
||||
/* Clone attributes from the notification expression list. */
|
||||
ExpressionList::Ptr nfc_exprl = boost::make_shared<ExpressionList>();
|
||||
ExpressionList::Ptr nfc_exprl = make_shared<ExpressionList>();
|
||||
item->GetLinkedExpressionList()->ExtractPath(path, nfc_exprl);
|
||||
|
||||
std::vector<String> dpath;
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/convert.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/bind/apply.hpp>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "icinga/host.h"
|
||||
#include "icinga/icingaapplication.h"
|
||||
#include "base/dynamicobject.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -111,10 +110,10 @@ class Service : DynamicObject
|
||||
};
|
||||
[state] double acknowledgement_expiry;
|
||||
[state] Dictionary::Ptr comments {
|
||||
default {{{ return boost::make_shared<Dictionary>(); }}}
|
||||
default {{{ return make_shared<Dictionary>(); }}}
|
||||
};
|
||||
[state] Dictionary::Ptr downtimes {
|
||||
default {{{ return boost::make_shared<Dictionary>(); }}}
|
||||
default {{{ return make_shared<Dictionary>(); }}}
|
||||
};
|
||||
[state] bool enable_notifications (EnableNotificationsRaw) {
|
||||
default {{{ return true; }}}
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -41,7 +40,7 @@ void TimePeriod::Start(void)
|
||||
DynamicObject::Start();
|
||||
|
||||
if (!l_UpdateTimer) {
|
||||
l_UpdateTimer = boost::make_shared<Timer>();
|
||||
l_UpdateTimer = make_shared<Timer>();
|
||||
l_UpdateTimer->SetInterval(300);
|
||||
l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
|
||||
l_UpdateTimer->Start();
|
||||
@ -87,12 +86,12 @@ void TimePeriod::AddSegment(double begin, double end)
|
||||
}
|
||||
|
||||
/* Create new segment if we weren't able to merge this into an existing segment. */
|
||||
Dictionary::Ptr segment = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr segment = make_shared<Dictionary>();
|
||||
segment->Set("begin", begin);
|
||||
segment->Set("end", end);
|
||||
|
||||
if (!segments) {
|
||||
segments = boost::make_shared<Array>();
|
||||
segments = make_shared<Array>();
|
||||
SetSegments(segments);
|
||||
}
|
||||
|
||||
@ -121,7 +120,7 @@ void TimePeriod::RemoveSegment(double begin, double end)
|
||||
if (!segments)
|
||||
return;
|
||||
|
||||
Array::Ptr newSegments = boost::make_shared<Array>();
|
||||
Array::Ptr newSegments = make_shared<Array>();
|
||||
|
||||
/* Try to split or adjust an existing segment. */
|
||||
ObjectLock dlock(segments);
|
||||
@ -168,7 +167,7 @@ void TimePeriod::PurgeSegments(double end)
|
||||
if (!segments)
|
||||
return;
|
||||
|
||||
Array::Ptr newSegments = boost::make_shared<Array>();
|
||||
Array::Ptr newSegments = make_shared<Array>();
|
||||
|
||||
/* Remove old segments. */
|
||||
ObjectLock dlock(segments);
|
||||
@ -275,17 +274,17 @@ void TimePeriod::UpdateTimerHandler(void)
|
||||
|
||||
Array::Ptr TimePeriod::EmptyTimePeriodUpdate(const TimePeriod::Ptr&, double, double)
|
||||
{
|
||||
Array::Ptr segments = boost::make_shared<Array>();
|
||||
Array::Ptr segments = make_shared<Array>();
|
||||
return segments;
|
||||
}
|
||||
|
||||
Array::Ptr TimePeriod::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr&, double begin, double end)
|
||||
{
|
||||
Array::Ptr segments = boost::make_shared<Array>();
|
||||
Array::Ptr segments = make_shared<Array>();
|
||||
|
||||
for (long t = begin / 60 - 1; t * 60 < end; t++) {
|
||||
if ((t % 2) == 0) {
|
||||
Dictionary::Ptr segment = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr segment = make_shared<Dictionary>();
|
||||
segment->Set("begin", t * 60);
|
||||
segment->Set("end", (t + 1) * 60);
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/utility.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "base/objectlock.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/debug.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
@ -364,7 +363,7 @@ Dictionary::Ptr LegacyTimePeriod::ProcessTimeRange(const String& timestamp, tm *
|
||||
{
|
||||
tm begin, end;
|
||||
ProcessTimeRangeRaw(timestamp, reference, &begin, &end);
|
||||
Dictionary::Ptr segment = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr segment = make_shared<Dictionary>();
|
||||
segment->Set("begin", (long)mktime(&begin));
|
||||
segment->Set("end", (long)mktime(&end));
|
||||
return segment;
|
||||
@ -384,7 +383,7 @@ void LegacyTimePeriod::ProcessTimeRanges(const String& timeranges, tm *reference
|
||||
|
||||
Array::Ptr LegacyTimePeriod::ScriptFunc(const TimePeriod::Ptr& tp, double begin, double end)
|
||||
{
|
||||
Array::Ptr segments = boost::make_shared<Array>();
|
||||
Array::Ptr segments = make_shared<Array>();
|
||||
|
||||
Dictionary::Ptr ranges = tp->GetRanges();
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -42,7 +41,7 @@ Dictionary::Ptr NullCheckTask::ScriptFunc(const Service::Ptr&)
|
||||
output += name;
|
||||
String perfdata = "time=" + Convert::ToString(static_cast<double>(Utility::GetTime()));
|
||||
|
||||
Dictionary::Ptr cr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr cr = make_shared<Dictionary>();
|
||||
cr->Set("output", output);
|
||||
cr->Set("performance_data_raw", perfdata);
|
||||
cr->Set("state", StateOK);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "methods/nulleventtask.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "base/process.h"
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -49,7 +48,7 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service)
|
||||
|
||||
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, service->GetLastCheckResult(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
||||
|
||||
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr envMacros = make_shared<Dictionary>();
|
||||
|
||||
Array::Ptr export_macros = commandObj->GetExportMacros();
|
||||
|
||||
@ -66,7 +65,7 @@ Dictionary::Ptr PluginCheckTask::ScriptFunc(const Service::Ptr& service)
|
||||
}
|
||||
}
|
||||
|
||||
Process::Ptr process = boost::make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
Process::Ptr process = make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
|
||||
process->SetTimeout(commandObj->GetTimeout());
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/process.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -46,7 +45,7 @@ void PluginEventTask::ScriptFunc(const Service::Ptr& service)
|
||||
|
||||
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, service->GetLastCheckResult(), Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
||||
|
||||
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr envMacros = make_shared<Dictionary>();
|
||||
|
||||
Array::Ptr export_macros = commandObj->GetExportMacros();
|
||||
|
||||
@ -63,7 +62,7 @@ void PluginEventTask::ScriptFunc(const Service::Ptr& service)
|
||||
}
|
||||
}
|
||||
|
||||
Process::Ptr process = boost::make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
Process::Ptr process = make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
|
||||
process->SetTimeout(commandObj->GetTimeout());
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "base/logger_fwd.h"
|
||||
#include "base/utility.h"
|
||||
#include "base/process.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -45,7 +44,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, c
|
||||
|
||||
Value raw_command = commandObj->GetCommandLine();
|
||||
|
||||
StaticMacroResolver::Ptr notificationMacroResolver = boost::make_shared<StaticMacroResolver>();
|
||||
StaticMacroResolver::Ptr notificationMacroResolver = make_shared<StaticMacroResolver>();
|
||||
notificationMacroResolver->Add("NOTIFICATIONTYPE", Notification::NotificationTypeToString(type));
|
||||
notificationMacroResolver->Add("NOTIFICATIONAUTHOR", author);
|
||||
notificationMacroResolver->Add("NOTIFICATIONAUTHORNAME", author);
|
||||
@ -62,7 +61,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, c
|
||||
|
||||
Value command = MacroProcessor::ResolveMacros(raw_command, resolvers, cr, Utility::EscapeShellCmd, commandObj->GetEscapeMacros());
|
||||
|
||||
Dictionary::Ptr envMacros = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr envMacros = make_shared<Dictionary>();
|
||||
|
||||
Array::Ptr export_macros = commandObj->GetExportMacros();
|
||||
|
||||
@ -79,7 +78,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, c
|
||||
}
|
||||
}
|
||||
|
||||
Process::Ptr process = boost::make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
Process::Ptr process = make_shared<Process>(Process::SplitCommand(command), envMacros);
|
||||
|
||||
process->SetTimeout(commandObj->GetTimeout());
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/scriptfunction.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -42,7 +41,7 @@ Dictionary::Ptr RandomCheckTask::ScriptFunc(const Service::Ptr&)
|
||||
output += name;
|
||||
String perfdata = "time=" + Convert::ToString(static_cast<double>(Utility::GetTime()));
|
||||
|
||||
Dictionary::Ptr cr = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr cr = make_shared<Dictionary>();
|
||||
cr->Set("output", output);
|
||||
cr->Set("performance_data_raw", perfdata);
|
||||
cr->Set("state", static_cast<ServiceState>(Utility::Random() % 4));
|
||||
|
@ -90,7 +90,7 @@ ScriptInterpreter::Ptr PythonLanguage::CreateInterpreter(const Script::Ptr& scri
|
||||
{
|
||||
InitializeOnce();
|
||||
|
||||
return boost::make_shared<PythonInterpreter>(GetSelf(), script);
|
||||
return make_shared<PythonInterpreter>(GetSelf(), script);
|
||||
}
|
||||
|
||||
PyThreadState *PythonLanguage::GetMainThreadState(void) const
|
||||
@ -196,7 +196,7 @@ Value PythonLanguage::MarshalFromPython(PyObject *value)
|
||||
if (value == Py_None) {
|
||||
return Empty;
|
||||
} else if (PyDict_Check(value)) {
|
||||
Dictionary::Ptr dict = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dict = make_shared<Dictionary>();
|
||||
|
||||
PyObject *dk, *dv;
|
||||
Py_ssize_t pos = 0;
|
||||
@ -210,7 +210,7 @@ Value PythonLanguage::MarshalFromPython(PyObject *value)
|
||||
|
||||
return dict;
|
||||
} else if (PyList_Check(value)) {
|
||||
Array::Ptr arr = boost::make_shared<Array>();
|
||||
Array::Ptr arr = make_shared<Array>();
|
||||
|
||||
for (Py_ssize_t pos = 0; pos < PyList_Size(value); pos++) {
|
||||
PyObject *dv = PyList_GetItem(value, pos);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/array.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -29,14 +28,14 @@ BOOST_AUTO_TEST_SUITE(base_array)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(construct)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
BOOST_CHECK(array);
|
||||
BOOST_CHECK(array->GetLength() == 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(getset)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
array->Add(7);
|
||||
array->Add(2);
|
||||
array->Add(5);
|
||||
@ -55,7 +54,7 @@ BOOST_AUTO_TEST_CASE(getset)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(remove)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
array->Add(7);
|
||||
array->Add(2);
|
||||
array->Add(5);
|
||||
@ -72,7 +71,7 @@ BOOST_AUTO_TEST_CASE(remove)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(foreach)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
array->Add(7);
|
||||
array->Add(2);
|
||||
array->Add(5);
|
||||
@ -92,7 +91,7 @@ BOOST_AUTO_TEST_CASE(foreach)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(clone)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
array->Add(7);
|
||||
array->Add(2);
|
||||
array->Add(5);
|
||||
@ -107,7 +106,7 @@ BOOST_AUTO_TEST_CASE(clone)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(serialize)
|
||||
{
|
||||
Array::Ptr array = boost::make_shared<Array>();
|
||||
Array::Ptr array = make_shared<Array>();
|
||||
array->Add(7);
|
||||
array->Add(2);
|
||||
array->Add(5);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/convert.h"
|
||||
#include "base/object.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace icinga;
|
||||
@ -47,7 +46,7 @@ BOOST_AUTO_TEST_CASE(tostring)
|
||||
BOOST_CHECK(Convert::ToString(7.3) == "7.3");
|
||||
BOOST_CHECK(Convert::ToString("hello") == "hello");
|
||||
|
||||
Object::Ptr object = boost::make_shared<Object>();
|
||||
Object::Ptr object = make_shared<Object>();
|
||||
BOOST_CHECK(Convert::ToString(object) == "Object of type 'icinga::Object'");
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/dictionary.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
@ -30,13 +29,13 @@ BOOST_AUTO_TEST_SUITE(base_dictionary)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(construct)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
BOOST_CHECK(dictionary);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get1)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
dictionary->Set("test1", 7);
|
||||
dictionary->Set("test2", "hello world");
|
||||
|
||||
@ -58,8 +57,8 @@ BOOST_AUTO_TEST_CASE(get1)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(get2)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr other = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
Dictionary::Ptr other = make_shared<Dictionary>();
|
||||
|
||||
dictionary->Set("test1", other);
|
||||
|
||||
@ -74,7 +73,7 @@ BOOST_AUTO_TEST_CASE(get2)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(foreach)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
dictionary->Set("test1", 7);
|
||||
dictionary->Set("test2", "hello world");
|
||||
|
||||
@ -108,7 +107,7 @@ BOOST_AUTO_TEST_CASE(foreach)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(remove)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
|
||||
dictionary->Set("test1", 7);
|
||||
dictionary->Set("test2", "hello world");
|
||||
@ -141,7 +140,7 @@ BOOST_AUTO_TEST_CASE(remove)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(clone)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
|
||||
dictionary->Set("test1", 7);
|
||||
dictionary->Set("test2", "hello world");
|
||||
@ -164,7 +163,7 @@ BOOST_AUTO_TEST_CASE(clone)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(serialize)
|
||||
{
|
||||
Dictionary::Ptr dictionary = boost::make_shared<Dictionary>();
|
||||
Dictionary::Ptr dictionary = make_shared<Dictionary>();
|
||||
|
||||
dictionary->Set("test1", 7);
|
||||
dictionary->Set("test2", "hello world");
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/fifo.h"
|
||||
#include "base/objectlock.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -29,7 +28,7 @@ BOOST_AUTO_TEST_SUITE(base_fifo)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(construct)
|
||||
{
|
||||
FIFO::Ptr fifo = boost::make_shared<FIFO>();
|
||||
FIFO::Ptr fifo = make_shared<FIFO>();
|
||||
BOOST_CHECK(fifo);
|
||||
BOOST_CHECK(fifo->GetAvailableBytes() == 0);
|
||||
|
||||
@ -38,7 +37,7 @@ BOOST_AUTO_TEST_CASE(construct)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(io)
|
||||
{
|
||||
FIFO::Ptr fifo = boost::make_shared<FIFO>();
|
||||
FIFO::Ptr fifo = make_shared<FIFO>();
|
||||
|
||||
fifo->Write("hello", 5);
|
||||
BOOST_CHECK(fifo->GetAvailableBytes() == 5);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "base/netstring.h"
|
||||
#include "base/fifo.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
@ -28,7 +27,7 @@ BOOST_AUTO_TEST_SUITE(base_netstring)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(netstring)
|
||||
{
|
||||
FIFO::Ptr fifo = boost::make_shared<FIFO>();
|
||||
FIFO::Ptr fifo = make_shared<FIFO>();
|
||||
|
||||
NetString::WriteStringToStream(fifo, "hello");
|
||||
|
||||
|
@ -20,15 +20,13 @@
|
||||
#include "base/object.h"
|
||||
#include "base/value.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
class TestObject : public Object
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<TestObject> Ptr;
|
||||
typedef boost::weak_ptr<TestObject> WeakPtr;
|
||||
DECLARE_PTR_TYPEDEFS(TestObject);
|
||||
|
||||
TestObject::Ptr GetTestRef(void)
|
||||
{
|
||||
@ -40,13 +38,13 @@ BOOST_AUTO_TEST_SUITE(base_object)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(construct)
|
||||
{
|
||||
Object::Ptr tobject = boost::make_shared<TestObject>();
|
||||
Object::Ptr tobject = make_shared<TestObject>();
|
||||
BOOST_CHECK(tobject);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(getself)
|
||||
{
|
||||
TestObject::Ptr tobject = boost::make_shared<TestObject>();
|
||||
TestObject::Ptr tobject = make_shared<TestObject>();
|
||||
TestObject::Ptr tobject_self = tobject->GetTestRef();
|
||||
BOOST_CHECK(tobject == tobject_self);
|
||||
|
||||
@ -57,7 +55,7 @@ BOOST_AUTO_TEST_CASE(getself)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(weak)
|
||||
{
|
||||
TestObject::Ptr tobject = boost::make_shared<TestObject>();
|
||||
TestObject::Ptr tobject = make_shared<TestObject>();
|
||||
TestObject::WeakPtr wtobject = tobject;
|
||||
tobject.reset();
|
||||
BOOST_CHECK(!tobject);
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include "base/utility.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "base/utility.h"
|
||||
#include "base/application.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
@ -43,13 +42,13 @@ BOOST_FIXTURE_TEST_SUITE(base_timer, TimerFixture)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(construct)
|
||||
{
|
||||
Timer::Ptr timer = boost::make_shared<Timer>();
|
||||
Timer::Ptr timer = make_shared<Timer>();
|
||||
BOOST_CHECK(timer);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(interval)
|
||||
{
|
||||
Timer::Ptr timer = boost::make_shared<Timer>();
|
||||
Timer::Ptr timer = make_shared<Timer>();
|
||||
timer->SetInterval(1.5);
|
||||
BOOST_CHECK(timer->GetInterval() == 1.5);
|
||||
}
|
||||
@ -62,7 +61,7 @@ static void Callback(int *counter)
|
||||
BOOST_AUTO_TEST_CASE(invoke)
|
||||
{
|
||||
int counter;
|
||||
Timer::Ptr timer = boost::make_shared<Timer>();
|
||||
Timer::Ptr timer = make_shared<Timer>();
|
||||
timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
|
||||
timer->SetInterval(1);
|
||||
|
||||
@ -77,7 +76,7 @@ BOOST_AUTO_TEST_CASE(invoke)
|
||||
BOOST_AUTO_TEST_CASE(scope)
|
||||
{
|
||||
int counter;
|
||||
Timer::Ptr timer = boost::make_shared<Timer>();
|
||||
Timer::Ptr timer = make_shared<Timer>();
|
||||
timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
|
||||
timer->SetInterval(1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user