diff --git a/components/checker/checkercomponent.cpp b/components/checker/checkercomponent.cpp index e06eb6830..9d806ca53 100644 --- a/components/checker/checkercomponent.cpp +++ b/components/checker/checkercomponent.cpp @@ -44,7 +44,7 @@ void CheckerComponent::Start(void) m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this)); - m_ResultTimer = boost::make_shared(); + m_ResultTimer = make_shared(); m_ResultTimer->SetInterval(5); m_ResultTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::ResultTimerHandler, this)); m_ResultTimer->Start(); diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index 9ece96ae5..876c991ae 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -29,7 +29,6 @@ #include "base/zlibstream.h" #include "base/application.h" #include "base/convert.h" -#include #include #include @@ -66,7 +65,7 @@ void ClusterListener::Start(void) if (!GetBindPort().IsEmpty()) AddListener(GetBindPort()); - m_ClusterTimer = boost::make_shared(); + m_ClusterTimer = make_shared(); 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::Ptr server = make_shared(); 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::Ptr client = make_shared(); 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::Ptr pmessage = make_shared(); pmessage->Set("timestamp", ts); if (source) @@ -303,9 +302,9 @@ void ClusterListener::OpenLogFile(void) return; } - StdioStream::Ptr logStream = boost::make_shared(fp, true); + StdioStream::Ptr logStream = make_shared(fp, true); #ifdef HAVE_BIOZLIB - m_LogFile = boost::make_shared(logStream); + m_LogFile = make_shared(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(fp, true); + StdioStream::Ptr logStream = make_shared(fp, true); #ifdef HAVE_BIOZLIB - ZlibStream::Ptr lstream = boost::make_shared(logStream); + ZlibStream::Ptr lstream = make_shared(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::Ptr elem = make_shared(); 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(client); + NetworkStream::Ptr netStream = make_shared(client); - TlsStream::Ptr tlsStream = boost::make_shared(netStream, role, m_SSLContext); + TlsStream::Ptr tlsStream = make_shared(netStream, role, m_SSLContext); tlsStream->Handshake(); shared_ptr 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::Ptr config = make_shared(); 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(config->GetLength())) + " config files to endpoint '" + endpoint->GetName() + "'."); - Dictionary::Ptr params = boost::make_shared(); + Dictionary::Ptr params = make_shared(); params->Set("identity", GetIdentity()); params->Set("config_files", config); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("identity", GetIdentity()); /* Eww. */ - Dictionary::Ptr features = boost::make_shared(); + Dictionary::Ptr features = make_shared(); features->Set("checker", SupportsChecks() ? 1 : 0); features->Set("notification", SupportsNotifications() ? 1 : 0); params->Set("features", features); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr security = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("check_result", cr); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("next_check", nextCheck); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("notification", notification->GetName()); params->Set("next_notification", nextNotification); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("forced", forced); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("forced", forced); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("enabled", enabled); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("enabled", enabled); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("enabled", enabled); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("enabled", enabled); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("comment", comment); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("id", comment->Get("id")); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("downtime", downtime); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); params->Set("id", downtime->Get("id")); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr params = make_shared(); 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::Ptr message = make_shared(); 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::Ptr params = make_shared(); params->Set("service", service->GetName()); - Dictionary::Ptr message = boost::make_shared(); + Dictionary::Ptr message = make_shared(); 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::Ptr lparams = make_shared(); lparams->Set("log_position", message->Get("ts")); - Dictionary::Ptr lmessage = boost::make_shared(); + Dictionary::Ptr lmessage = make_shared(); 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::Ptr localConfig = make_shared(); Utility::Glob(dir + "/*", boost::bind(&ClusterListener::ConfigGlobHandler, boost::cref(localConfig), _1, true)); bool configChange = false; diff --git a/components/cluster/endpoint.cpp b/components/cluster/endpoint.cpp index 56f6c021a..396ecd751 100644 --- a/components/cluster/endpoint.cpp +++ b/components/cluster/endpoint.cpp @@ -25,7 +25,6 @@ #include "base/utility.h" #include "base/logger_fwd.h" #include "config/configitembuilder.h" -#include using namespace icinga; diff --git a/components/compat/checkresultreader.cpp b/components/compat/checkresultreader.cpp index acb7c8d42..1059314ef 100644 --- a/components/compat/checkresultreader.cpp +++ b/components/compat/checkresultreader.cpp @@ -26,7 +26,6 @@ #include "base/convert.h" #include "base/application.h" #include "base/utility.h" -#include #include using namespace icinga; @@ -38,7 +37,7 @@ REGISTER_TYPE(CheckResultReader); */ void CheckResultReader::Start(void) { - m_ReadTimer = boost::make_shared(); + m_ReadTimer = make_shared(); m_ReadTimer->OnTimerExpired.connect(boost::bind(&CheckResultReader::ReadTimerHandler, this)); m_ReadTimer->SetInterval(5); m_ReadTimer->Start(); diff --git a/components/compat/compatlogger.cpp b/components/compat/compatlogger.cpp index ef61f1ccb..2574a75fc 100644 --- a/components/compat/compatlogger.cpp +++ b/components/compat/compatlogger.cpp @@ -34,7 +34,6 @@ #include "base/application.h" #include "base/utility.h" #include "base/scriptfunction.h" -#include #include #include @@ -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(); + m_RotationTimer = make_shared(); m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this)); m_RotationTimer->Start(); diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index 72725b940..cb69a0998 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -33,7 +33,6 @@ #include "base/logger_fwd.h" #include "base/exception.h" #include "base/application.h" -#include #include #include #include @@ -57,7 +56,7 @@ void StatusDataWriter::Start(void) { DynamicObject::Start(); - m_StatusTimer = boost::make_shared(); + m_StatusTimer = make_shared(); m_StatusTimer->SetInterval(15); m_StatusTimer->OnTimerExpired.connect(boost::bind(&StatusDataWriter::StatusTimerHandler, this)); m_StatusTimer->Start(); diff --git a/components/db_ido_mysql/idomysqlconnection.cpp b/components/db_ido_mysql/idomysqlconnection.cpp index a2c4c171b..cf80061d7 100644 --- a/components/db_ido_mysql/idomysqlconnection.cpp +++ b/components/db_ido_mysql/idomysqlconnection.cpp @@ -29,7 +29,6 @@ #include "db_ido_mysql/idomysqlconnection.h" #include #include -#include #include 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(); + m_TxTimer = make_shared(); m_TxTimer->SetInterval(5); m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::TxTimerHandler, this)); m_TxTimer->Start(); - m_ReconnectTimer = boost::make_shared(); + m_ReconnectTimer = make_shared(); 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::Ptr rows = make_shared(); 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::Ptr dict = make_shared(); mysql_field_seek(result, 0); for (field = mysql_fetch_field(result), i = 0; field; field = mysql_fetch_field(result), i++) { diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index 86ad7f5a7..677771e8f 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -29,7 +29,6 @@ #include "db_ido_pgsql/idopgsqlconnection.h" #include #include -#include #include 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(); + m_TxTimer = make_shared(); m_TxTimer->SetInterval(5); m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::TxTimerHandler, this)); m_TxTimer->Start(); - m_ReconnectTimer = boost::make_shared(); + m_ReconnectTimer = make_shared(); 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::Ptr rows = make_shared(); 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::Ptr dict = make_shared(); for (int column = 0; column < columns; column++) { Value value; diff --git a/components/demo/demo.cpp b/components/demo/demo.cpp index 4ec78f9f7..ad5446ce1 100644 --- a/components/demo/demo.cpp +++ b/components/demo/demo.cpp @@ -20,7 +20,6 @@ #include "demo/demo.h" #include "base/dynamictype.h" #include "base/logger_fwd.h" -#include using namespace icinga; @@ -33,7 +32,7 @@ void Demo::Start(void) { DynamicObject::Start(); - m_DemoTimer = boost::make_shared(); + m_DemoTimer = make_shared(); m_DemoTimer->SetInterval(5); m_DemoTimer->OnTimerExpired.connect(boost::bind(&Demo::DemoTimerHandler, this)); m_DemoTimer->Start(); diff --git a/components/livestatus/contactgroupstable.cpp b/components/livestatus/contactgroupstable.cpp index 727e835ac..edcd8ce6c 100644 --- a/components/livestatus/contactgroupstable.cpp +++ b/components/livestatus/contactgroupstable.cpp @@ -77,7 +77,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row) if(!user_group) return Empty; - Array::Ptr members = boost::make_shared(); + Array::Ptr members = make_shared(); BOOST_FOREACH(const User::Ptr& user, user_group->GetMembers()) { members->Add(user->GetName()); diff --git a/components/livestatus/contactstable.cpp b/components/livestatus/contactstable.cpp index a5ce49f34..b2c3bf2ba 100644 --- a/components/livestatus/contactstable.cpp +++ b/components/livestatus/contactstable.cpp @@ -23,7 +23,6 @@ #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/utility.h" -#include #include #include @@ -211,7 +210,7 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row) if (!custom) return Empty; - Array::Ptr cv = boost::make_shared(); + Array::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr key_val = make_shared(); key_val->Add(key); key_val->Add(value); cv->Add(key_val); diff --git a/components/livestatus/hostgroupstable.cpp b/components/livestatus/hostgroupstable.cpp index 676ce1530..ece872772 100644 --- a/components/livestatus/hostgroupstable.cpp +++ b/components/livestatus/hostgroupstable.cpp @@ -116,7 +116,7 @@ Value HostGroupsTable::ActionUrlAccessor(const Value& row) Value HostGroupsTable::MembersAccessor(const Value& row) { - Array::Ptr members = boost::make_shared(); + Array::Ptr members = make_shared(); BOOST_FOREACH(const Host::Ptr& host, static_cast(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::Ptr members = make_shared(); BOOST_FOREACH(const Host::Ptr& host, static_cast(row)->GetMembers()) { - Array::Ptr member_state = boost::make_shared(); + Array::Ptr member_state = make_shared(); member_state->Add(host->GetName()); member_state->Add(host->GetState()); members->Add(member_state); diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index a385cf527..72663ee93 100644 --- a/components/livestatus/hoststable.cpp +++ b/components/livestatus/hoststable.cpp @@ -32,7 +32,6 @@ #include "base/utility.h" #include #include -#include #include #include #include @@ -1403,7 +1402,7 @@ Value HostsTable::ContactsAccessor(const Value& row) if (!hc) return Empty; - Array::Ptr contact_names = boost::make_shared(); + Array::Ptr contact_names = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr downtime_info = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr comment_info = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr comment_info = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); String key; Value value; BOOST_FOREACH(boost::tie(key, value), customvars) { - Array::Ptr key_val = boost::make_shared(); + Array::Ptr key_val = make_shared(); 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::Ptr parents = make_shared(); 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::Ptr childs = make_shared(); 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::Ptr contactgroup_names = make_shared(); 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::Ptr services = make_shared(); 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::Ptr services = make_shared(); BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { - Array::Ptr svc_add = boost::make_shared(); + Array::Ptr svc_add = make_shared(); 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::Ptr services = make_shared(); BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { - Array::Ptr svc_add = boost::make_shared(); + Array::Ptr svc_add = make_shared(); svc_add->Add(service->GetShortName()); svc_add->Add(service->GetState()); diff --git a/components/livestatus/listener.cpp b/components/livestatus/listener.cpp index 421de6150..c2ce431a0 100644 --- a/components/livestatus/listener.cpp +++ b/components/livestatus/listener.cpp @@ -29,7 +29,6 @@ #include "base/application.h" #include "base/scriptfunction.h" #include "base/convert.h" -#include #include using namespace icinga; @@ -50,7 +49,7 @@ void LivestatusListener::Start(void) DynamicObject::Start(); if (GetSocketType() == "tcp") { - TcpSocket::Ptr socket = boost::make_shared(); + TcpSocket::Ptr socket = make_shared(); 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::Ptr socket = make_shared(); 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(client); + Stream::Ptr stream = make_shared(client); for (;;) { String line; @@ -134,7 +133,7 @@ void LivestatusListener::ClientThreadProc(const Socket::Ptr& client) break; } - Query::Ptr query = boost::make_shared(lines); + Query::Ptr query = make_shared(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."); } -} \ No newline at end of file +} diff --git a/components/livestatus/logtable.cpp b/components/livestatus/logtable.cpp index c5f9a67bb..947ced159 100644 --- a/components/livestatus/logtable.cpp +++ b/components/livestatus/logtable.cpp @@ -35,7 +35,6 @@ #include "base/logger_fwd.h" #include "base/application.h" #include "base/objectlock.h" -#include #include #include #include @@ -555,7 +554,7 @@ Dictionary::Ptr LogTable::GetLogEntryAttributes(const String& type, const String } else return Dictionary::Ptr(); - Dictionary::Ptr bag = boost::make_shared(); + Dictionary::Ptr bag = make_shared(); bag->Set("class", log_class); /* 0 is the default if not populated */ bag->Set("comment", comment); diff --git a/components/livestatus/query.cpp b/components/livestatus/query.cpp index f6d4ebb5c..28f3bf2ba 100644 --- a/components/livestatus/query.cpp +++ b/components/livestatus/query.cpp @@ -38,7 +38,6 @@ #include "base/exception.h" #include "base/utility.h" #include -#include #include #include @@ -156,19 +155,19 @@ Query::Query(const std::vector& lines) Filter::Ptr filter; if (aggregate_arg == "sum") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "min") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "max") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "avg") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "std") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "suminv") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else if (aggregate_arg == "avginv") { - aggregator = boost::make_shared(aggregate_attr); + aggregator = make_shared(aggregate_attr); } else { filter = ParseFilter(params, m_LogTimeFrom, m_LogTimeUntil); @@ -179,7 +178,7 @@ Query::Query(const std::vector& lines) return; } - aggregator = boost::make_shared(); + aggregator = make_shared(); } aggregator->SetFilter(filter); @@ -193,10 +192,10 @@ Query::Query(const std::vector& lines) CombinerFilter::Ptr filter; if (header == "Or" || header == "StatsOr") { - filter = boost::make_shared(); + filter = make_shared(); Log(LogDebug, "livestatus", "Add OR filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available."); } else { - filter = boost::make_shared(); + filter = make_shared(); 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& lines) return; } - deq.push_back(boost::make_shared(filter)); + deq.push_back(make_shared(filter)); if (deq == stats) { Aggregator::Ptr aggregator = aggregators.back(); @@ -244,7 +243,7 @@ Query::Query(const std::vector& lines) } /* Combine all top-level filters into a single filter. */ - AndFilter::Ptr top_filter = boost::make_shared(); + AndFilter::Ptr top_filter = make_shared(); 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(attr, op, val); + Filter::Ptr filter = make_shared(attr, op, val); if (negate) - filter = boost::make_shared(filter); + filter = make_shared(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::Ptr rs = make_shared(); if (m_Aggregators.empty()) { BOOST_FOREACH(const Value& object, objects) { - Array::Ptr row = boost::make_shared(); + Array::Ptr row = make_shared(); 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::Ptr row = make_shared(); for (size_t i = 0; i < m_Aggregators.size(); i++) row->Add(stats[i]); diff --git a/components/livestatus/servicegroupstable.cpp b/components/livestatus/servicegroupstable.cpp index 7afae561c..6b6204f57 100644 --- a/components/livestatus/servicegroupstable.cpp +++ b/components/livestatus/servicegroupstable.cpp @@ -107,10 +107,10 @@ Value ServiceGroupsTable::ActionUrlAccessor(const Value& row) Value ServiceGroupsTable::MembersAccessor(const Value& row) { - Array::Ptr members = boost::make_shared(); + Array::Ptr members = make_shared(); BOOST_FOREACH(const Service::Ptr& service, static_cast(row)->GetMembers()) { - Array::Ptr host_svc = boost::make_shared(); + Array::Ptr host_svc = make_shared(); 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::Ptr members = make_shared(); BOOST_FOREACH(const Service::Ptr& service, static_cast(row)->GetMembers()) { - Array::Ptr host_svc = boost::make_shared(); + Array::Ptr host_svc = make_shared(); host_svc->Add(service->GetHost()->GetName()); host_svc->Add(service->GetShortName()); host_svc->Add(service->GetHost()->GetState()); diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp index 92692460d..94a340f4c 100644 --- a/components/livestatus/servicestable.cpp +++ b/components/livestatus/servicestable.cpp @@ -1033,7 +1033,7 @@ Value ServicesTable::ContactsAccessor(const Value& row) if (!service) return Empty; - Array::Ptr contact_names = boost::make_shared(); + Array::Ptr contact_names = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr downtime_info = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr comment_info = make_shared(); 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::Ptr ids = make_shared(); 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::Ptr comment_info = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); 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::Ptr cv = make_shared(); String key; Value value; BOOST_FOREACH(boost::tie(key, value), customvars) { - Array::Ptr key_val = boost::make_shared(); + Array::Ptr key_val = make_shared(); 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::Ptr contactgroup_names = make_shared(); BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(service)) { contactgroup_names->Add(usergroup->GetName()); diff --git a/components/livestatus/statehisttable.cpp b/components/livestatus/statehisttable.cpp index d8d767bca..45a3ef1be 100644 --- a/components/livestatus/statehisttable.cpp +++ b/components/livestatus/statehisttable.cpp @@ -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(); - state_hist_bag = boost::make_shared(); + state_hist_service_states = make_shared(); + state_hist_bag = make_shared(); 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::Ptr state_hist_bag_new = make_shared(); 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::Ptr bag = make_shared(); bag->Set("log_class", log_class); /* 0 is the default if not populated */ bag->Set("log_type", log_type); diff --git a/components/livestatus/statustable.cpp b/components/livestatus/statustable.cpp index 58d94395b..36824e117 100644 --- a/components/livestatus/statustable.cpp +++ b/components/livestatus/statustable.cpp @@ -26,7 +26,6 @@ #include "base/dynamictype.h" #include "base/utility.h" #include "base/application.h" -#include 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::Ptr obj = make_shared(); /* Return a fake row. */ addRowFn(obj); diff --git a/components/livestatus/table.cpp b/components/livestatus/table.cpp index c6a1f0826..57625fc31 100644 --- a/components/livestatus/table.cpp +++ b/components/livestatus/table.cpp @@ -35,7 +35,6 @@ #include "base/array.h" #include "base/dictionary.h" #include -#include #include #include @@ -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(); + return make_shared(); else if (name == "contactgroups") - return boost::make_shared(); + return make_shared(); else if (name == "contacts") - return boost::make_shared(); + return make_shared(); else if (name == "hostgroups") - return boost::make_shared(); + return make_shared(); else if (name == "hosts") - return boost::make_shared(); + return make_shared(); else if (name == "servicegroups") - return boost::make_shared(); + return make_shared(); else if (name == "services") - return boost::make_shared(); + return make_shared(); else if (name == "commands") - return boost::make_shared(); + return make_shared(); else if (name == "comments") - return boost::make_shared(); + return make_shared(); else if (name == "downtimes") - return boost::make_shared(); + return make_shared(); else if (name == "timeperiods") - return boost::make_shared(); + return make_shared(); else if (name == "log") - return boost::make_shared(from, until); + return make_shared(from, until); else if (name == "statehist") - return boost::make_shared(from, until); + return make_shared(from, until); return Table::Ptr(); } @@ -141,10 +140,10 @@ Value Table::EmptyStringAccessor(const Value&) Value Table::EmptyArrayAccessor(const Value&) { - return boost::make_shared(); + return make_shared(); } Value Table::EmptyDictionaryAccessor(const Value&) { - return boost::make_shared(); + return make_shared(); } diff --git a/components/notification/notificationcomponent.cpp b/components/notification/notificationcomponent.cpp index e4d84da75..b3d3d108f 100644 --- a/components/notification/notificationcomponent.cpp +++ b/components/notification/notificationcomponent.cpp @@ -23,7 +23,6 @@ #include "base/objectlock.h" #include "base/logger_fwd.h" #include "base/utility.h" -#include #include #include @@ -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(); + m_NotificationTimer = make_shared(); m_NotificationTimer->SetInterval(5); m_NotificationTimer->OnTimerExpired.connect(boost::bind(&NotificationComponent::NotificationTimerHandler, this)); m_NotificationTimer->Start(); diff --git a/components/perfdata/graphitewriter.cpp b/components/perfdata/graphitewriter.cpp index 31ba55fb5..f5284888d 100644 --- a/components/perfdata/graphitewriter.cpp +++ b/components/perfdata/graphitewriter.cpp @@ -34,7 +34,6 @@ #include "base/bufferedstream.h" #include #include -#include #include #include #include @@ -48,7 +47,7 @@ void GraphiteWriter::Start(void) { DynamicObject::Start(); - m_ReconnectTimer = boost::make_shared(); + m_ReconnectTimer = make_shared(); 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::Ptr socket = make_shared(); Log(LogDebug, "perfdata", "GraphiteWriter: Reconnect to tcp socket on host '" + GetHost() + "' port '" + GetPort() + "'."); socket->Connect(GetHost(), GetPort()); - NetworkStream::Ptr net_stream = boost::make_shared(socket); - m_Stream = boost::make_shared(net_stream); + NetworkStream::Ptr net_stream = make_shared(socket); + m_Stream = make_shared(net_stream); } void GraphiteWriter::CheckResultHandler(const Service::Ptr& service, const Dictionary::Ptr& cr) diff --git a/components/perfdata/perfdatawriter.cpp b/components/perfdata/perfdatawriter.cpp index 853968672..4a88cd71c 100644 --- a/components/perfdata/perfdatawriter.cpp +++ b/components/perfdata/perfdatawriter.cpp @@ -27,7 +27,6 @@ #include "base/convert.h" #include "base/utility.h" #include "base/application.h" -#include 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(); + m_RotationTimer = make_shared(); m_RotationTimer->OnTimerExpired.connect(boost::bind(&PerfdataWriter::RotationTimerHandler, this)); m_RotationTimer->SetInterval(GetRotationInterval()); m_RotationTimer->Start(); diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index efe55cf24..ba0abe392 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -30,7 +30,6 @@ #include "config.h" #include #include -#include #include #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::Ptr builder = make_shared(); builder->SetType(appType); builder->SetName("application"); ConfigItem::Ptr item = builder->Compile(); diff --git a/lib/base/array.cpp b/lib/base/array.cpp index 72d373fe3..a1ef7aeb6 100644 --- a/lib/base/array.cpp +++ b/lib/base/array.cpp @@ -143,7 +143,7 @@ Array::Ptr Array::ShallowClone(void) const ASSERT(!OwnsLock()); ObjectLock olock(this); - Array::Ptr clone = boost::make_shared(); + Array::Ptr clone = make_shared(); 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::Ptr array = make_shared(); ASSERT(json->type == cJSON_Array); diff --git a/lib/base/bufferedstream.cpp b/lib/base/bufferedstream.cpp index 7ab51dd5b..b06f06925 100644 --- a/lib/base/bufferedstream.cpp +++ b/lib/base/bufferedstream.cpp @@ -21,14 +21,13 @@ #include "base/objectlock.h" #include "base/utility.h" #include "base/logger_fwd.h" -#include #include 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()), m_SendQ(boost::make_shared()), + m_RecvQ(make_shared()), m_SendQ(make_shared()), m_Blocking(true), m_MaxBufferSize(maxBufferSize), m_Exception() { m_ReadThread = boost::thread(boost::bind(&BufferedStream::ReadThreadProc, this)); diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp index adb998910..70aad23e3 100644 --- a/lib/base/dictionary.cpp +++ b/lib/base/dictionary.cpp @@ -209,7 +209,7 @@ Dictionary::Ptr Dictionary::ShallowClone(void) const ASSERT(!OwnsLock()); ObjectLock olock(this); - Dictionary::Ptr clone = boost::make_shared(); + Dictionary::Ptr clone = make_shared(); 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::Ptr dictionary = make_shared(); ASSERT(json->type == cJSON_Object); diff --git a/lib/base/dynamicobject.cpp b/lib/base/dynamicobject.cpp index 46bdfe1fc..f6421498b 100644 --- a/lib/base/dynamicobject.cpp +++ b/lib/base/dynamicobject.cpp @@ -112,7 +112,7 @@ void DynamicObject::SetExtension(const String& key, const Object::Ptr& object) Dictionary::Ptr extensions = GetExtensions(); if (!extensions) { - extensions = boost::make_shared(); + extensions = make_shared(); 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(&fp, false); + StdioStream::Ptr sfp = make_shared(&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::Ptr persistentObject = make_shared(); 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(&fp, false); + StdioStream::Ptr sfp = make_shared(&fp, false); unsigned long restored = 0; diff --git a/lib/base/dynamicobject.ti b/lib/base/dynamicobject.ti index 5e982697e..ab26f4f47 100644 --- a/lib/base/dynamicobject.ti +++ b/lib/base/dynamicobject.ti @@ -1,5 +1,3 @@ -#include - 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(); }}} + default {{{ return make_shared(); }}} }; [protected] Dictionary::Ptr extensions; }; diff --git a/lib/base/dynamictype.h b/lib/base/dynamictype.h index 304fcd372..1737976c0 100644 --- a/lib/base/dynamictype.h +++ b/lib/base/dynamictype.h @@ -27,7 +27,6 @@ #include #include #include -#include namespace icinga { @@ -109,7 +108,7 @@ class RegisterTypeHelper public: RegisterTypeHelper(const String& name, const DynamicType::ObjectFactory& factory) { - DynamicType::Ptr type = boost::make_shared(name, factory); + DynamicType::Ptr type = make_shared(name, factory); DynamicType::RegisterType(type); } }; @@ -122,7 +121,7 @@ public: template shared_ptr DynamicObjectFactory(void) { - return boost::make_shared(); + return make_shared(); } #define REGISTER_TYPE_ALIAS(type, alias) \ diff --git a/lib/base/object.h b/lib/base/object.h index 7dd38e718..dd31dfa3f 100644 --- a/lib/base/object.h +++ b/lib/base/object.h @@ -33,11 +33,14 @@ #include #include #include +#include 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 +class I2_BASE_API Object : public enable_shared_from_this { public: DECLARE_PTR_TYPEDEFS(Object); diff --git a/lib/base/scriptfunction.cpp b/lib/base/scriptfunction.cpp index 04a9c72cc..5a1e93619 100644 --- a/lib/base/scriptfunction.cpp +++ b/lib/base/scriptfunction.cpp @@ -19,7 +19,6 @@ #include "base/scriptfunction.h" #include "base/registry.h" -#include using namespace icinga; @@ -34,6 +33,6 @@ Value ScriptFunction::Invoke(const std::vector& arguments) RegisterFunctionHelper::RegisterFunctionHelper(const String& name, const ScriptFunction::Callback& function) { - ScriptFunction::Ptr func = boost::make_shared(function); + ScriptFunction::Ptr func = make_shared(function); ScriptFunctionRegistry::GetInstance()->Register(name, func); } diff --git a/lib/base/scriptinterpreter.cpp b/lib/base/scriptinterpreter.cpp index d5777e038..37f29b642 100644 --- a/lib/base/scriptinterpreter.cpp +++ b/lib/base/scriptinterpreter.cpp @@ -21,7 +21,6 @@ #include "base/scriptfunction.h" #include "base/objectlock.h" #include -#include #include using namespace icinga; @@ -42,7 +41,7 @@ void ScriptInterpreter::SubscribeFunction(const String& name) m_SubscribedFunctions.insert(name); - ScriptFunction::Ptr sf = boost::make_shared(boost::bind(&ScriptInterpreter::ProcessCall, this, name, _1)); + ScriptFunction::Ptr sf = make_shared(boost::bind(&ScriptInterpreter::ProcessCall, this, name, _1)); ScriptFunctionRegistry::GetInstance()->Register(name, sf); } diff --git a/lib/base/scriptlanguage.h b/lib/base/scriptlanguage.h index aad185f84..4a202d428 100644 --- a/lib/base/scriptlanguage.h +++ b/lib/base/scriptlanguage.h @@ -70,7 +70,7 @@ public: }; #define REGISTER_SCRIPTLANGUAGE(name, klass) \ - static RegisterLanguageHelper g_RegisterSL_ ## type(name, boost::make_shared()) + static RegisterLanguageHelper g_RegisterSL_ ## type(name, make_shared()) } diff --git a/lib/base/serializer.cpp b/lib/base/serializer.cpp index 77126db5c..9449bd1e7 100644 --- a/lib/base/serializer.cpp +++ b/lib/base/serializer.cpp @@ -19,7 +19,6 @@ #include "base/serializer.h" #include "base/type.h" -#include 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::Ptr update = make_shared(); for (int i = 0; i < type->GetFieldCount(); i++) { Field field = type->GetFieldInfo(i); diff --git a/lib/base/socket.cpp b/lib/base/socket.cpp index 32facc858..cba7d4307 100644 --- a/lib/base/socket.cpp +++ b/lib/base/socket.cpp @@ -282,5 +282,5 @@ Socket::Ptr Socket::Accept(void) #endif /* _WIN32 */ } - return boost::make_shared(fd); + return make_shared(fd); } diff --git a/lib/base/streamlogger.cpp b/lib/base/streamlogger.cpp index 09ec40ca7..37e5957e8 100644 --- a/lib/base/streamlogger.cpp +++ b/lib/base/streamlogger.cpp @@ -21,7 +21,6 @@ #include "base/utility.h" #include "base/objectlock.h" #include -#include #include #include @@ -63,7 +62,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream) m_OwnsStream = ownsStream; m_Tty = IsTty(*stream); - m_FlushLogTimer = boost::make_shared(); + m_FlushLogTimer = make_shared(); m_FlushLogTimer->SetInterval(1); m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this)); m_FlushLogTimer->Start(); diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp index 5da7fa0f0..dd116afd2 100644 --- a/lib/base/tlsstream.cpp +++ b/lib/base/tlsstream.cpp @@ -43,7 +43,7 @@ TlsStream::TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr(innerStream); if (!m_InnerStream) - m_InnerStream = boost::make_shared(innerStream); + m_InnerStream = make_shared(innerStream); m_InnerStream->MakeNonBlocking(); diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index f007a6e80..7886bcdf3 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -33,7 +33,6 @@ #include "base/scriptvariable.h" #include #include -#include #include #include @@ -178,7 +177,7 @@ variable: T_SET identifier T_EQUAL value { Value *value = $4; if (value->IsObjectType()) { - Dictionary::Ptr dict = boost::make_shared(); + Dictionary::Ptr dict = make_shared(); 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(name, yylloc); + m_Type = make_shared(name, yylloc); m_Type->Register(); } } @@ -238,7 +237,7 @@ partial_specifier: /* Empty */ typerulelist: '{' { - m_RuleLists.push(boost::make_shared()); + m_RuleLists.push(make_shared()); } typerules '}' @@ -316,7 +315,7 @@ object: } object_declaration identifier T_STRING object_inherits_specifier expressionlist { - ConfigItemBuilder::Ptr item = boost::make_shared(yylloc); + ConfigItemBuilder::Ptr item = make_shared(yylloc); item->SetType($3); @@ -442,7 +441,7 @@ expression: identifier operator value free($3); delete $6; - ExpressionList::Ptr subexprl = boost::make_shared(); + ExpressionList::Ptr subexprl = make_shared(); subexprl->AddExpression(subexpr); $$ = new Expression($1, OperatorPlus, subexprl, yylloc); @@ -485,7 +484,7 @@ array_items_inner: /* empty */ if ($1->IsObjectType()) { ExpressionList::Ptr exprl = *$1; - Dictionary::Ptr dict = boost::make_shared(); + Dictionary::Ptr dict = make_shared(); exprl->Execute(dict); delete $1; $1 = new Value(dict); @@ -503,7 +502,7 @@ array_items_inner: /* empty */ if ($3->IsObjectType()) { ExpressionList::Ptr exprl = *$3; - Dictionary::Ptr dict = boost::make_shared(); + Dictionary::Ptr dict = make_shared(); exprl->Execute(dict); delete $3; $3 = new Value(dict); @@ -544,63 +543,63 @@ aterm: '(' aexpression ')' aexpression: T_STRING { - $$ = new Value(boost::make_shared(AEReturn, AValue(ATSimple, $1))); + $$ = new Value(make_shared(AEReturn, AValue(ATSimple, $1))); free($1); } | T_NUMBER { - $$ = new Value(boost::make_shared(AEReturn, AValue(ATSimple, $1))); + $$ = new Value(make_shared(AEReturn, AValue(ATSimple, $1))); } | T_IDENTIFIER { - $$ = new Value(boost::make_shared(AEReturn, AValue(ATVariable, $1))); + $$ = new Value(make_shared(AEReturn, AValue(ATVariable, $1))); free($1); } | aexpression '+' aexpression { - $$ = new Value(boost::make_shared(AEAdd, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEAdd, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression '-' aexpression { - $$ = new Value(boost::make_shared(AESubtract, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AESubtract, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression '*' aexpression { - $$ = new Value(boost::make_shared(AEMultiply, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEMultiply, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression '/' aexpression { - $$ = new Value(boost::make_shared(AEDivide, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEDivide, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression '&' aexpression { - $$ = new Value(boost::make_shared(AEBinaryAnd, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEBinaryAnd, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression '|' aexpression { - $$ = new Value(boost::make_shared(AEBinaryOr, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEBinaryOr, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression T_SHIFT_LEFT aexpression { - $$ = new Value(boost::make_shared(AEShiftLeft, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEShiftLeft, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } | aexpression T_SHIFT_RIGHT aexpression { - $$ = new Value(boost::make_shared(AEShiftRight, static_cast(*$1), static_cast(*$3))); + $$ = new Value(make_shared(AEShiftRight, static_cast(*$1), static_cast(*$3))); delete $1; delete $3; } diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index bdf186423..9f0b76734 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -26,7 +26,6 @@ #include "base/debug.h" #include #include -#include #include using namespace icinga; @@ -107,7 +106,7 @@ void ConfigItem::Link(void) { ObjectLock olock(this); - m_LinkedExpressionList = boost::make_shared(); + m_LinkedExpressionList = make_shared(); 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::Ptr attrs = make_shared(); Link(); - Dictionary::Ptr properties = boost::make_shared(); + Dictionary::Ptr properties = make_shared(); GetLinkedExpressionList()->Execute(properties); { diff --git a/lib/config/configitembuilder.cpp b/lib/config/configitembuilder.cpp index 83598fb7e..0ed521e4b 100644 --- a/lib/config/configitembuilder.cpp +++ b/lib/config/configitembuilder.cpp @@ -20,14 +20,13 @@ #include "config/configitembuilder.h" #include "config/configcompilercontext.h" #include "base/dynamictype.h" -#include #include #include using namespace icinga; ConfigItemBuilder::ConfigItemBuilder(void) - : m_Abstract(false), m_ExpressionList(boost::make_shared()) + : m_Abstract(false), m_ExpressionList(make_shared()) { 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()) + : m_Abstract(false), m_ExpressionList(make_shared()) { 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::Ptr exprl = make_shared(); 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(m_Type, m_Name, m_Abstract, exprl, + return make_shared(m_Type, m_Name, m_Abstract, exprl, m_Parents, m_DebugInfo); } diff --git a/lib/config/configtype.cpp b/lib/config/configtype.cpp index ca4fef596..8cc412b20 100644 --- a/lib/config/configtype.cpp +++ b/lib/config/configtype.cpp @@ -23,13 +23,12 @@ #include "base/convert.h" #include "base/scriptfunction.h" #include -#include #include using namespace icinga; ConfigType::ConfigType(const String& name, const DebugInfo& debuginfo) - : m_Name(name), m_RuleList(boost::make_shared()), m_DebugInfo(debuginfo) + : m_Name(name), m_RuleList(make_shared()), 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::Ptr attrs = make_shared(); item->GetLinkedExpressionList()->Execute(attrs); std::vector locations; diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 3a186462e..6719095ba 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -24,7 +24,6 @@ #include "base/array.h" #include #include -#include #include using namespace icinga; @@ -73,7 +72,7 @@ void Expression::Execute(const Dictionary::Ptr& dictionary) const case OperatorSet: if (valueExprl) { - dict = boost::make_shared(); + dict = make_shared(); 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(); + dict = make_shared(); valueExprl->Execute(dict); newValue = dict; } else if (valueDict) { if (!dict) - dict = boost::make_shared(); + dict = make_shared(); 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 = make_shared(); ObjectLock olock(valueArray); diff --git a/lib/db_ido/commanddbobject.cpp b/lib/db_ido/commanddbobject.cpp index 40b96f394..675dd0f9e 100644 --- a/lib/db_ido/commanddbobject.cpp +++ b/lib/db_ido/commanddbobject.cpp @@ -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::Ptr fields = make_shared(); Command::Ptr command = static_pointer_cast(GetObject()); Dictionary::Ptr attrs; diff --git a/lib/db_ido/commanddbobject.h b/lib/db_ido/commanddbobject.h index e7ea98415..3f06fd6be 100644 --- a/lib/db_ido/commanddbobject.h +++ b/lib/db_ido/commanddbobject.h @@ -36,7 +36,7 @@ class CommandDbObject : public DbObject public: DECLARE_PTR_TYPEDEFS(CommandDbObject); - CommandDbObject(const boost::shared_ptr& type, const String& name1, const String& name2); + CommandDbObject(const shared_ptr& type, const String& name1, const String& name2); virtual Dictionary::Ptr GetConfigFields(void) const; virtual Dictionary::Ptr GetStatusFields(void) const; diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp index 78dc98791..c1a112311 100644 --- a/lib/db_ido/dbconnection.cpp +++ b/lib/db_ido/dbconnection.cpp @@ -41,7 +41,7 @@ void DbConnection::Start(void) DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1)); - m_CleanUpTimer = boost::make_shared(); + m_CleanUpTimer = make_shared(); 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(); + m_ProgramStatusTimer = make_shared(); 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(); + query.Fields = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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(); + query2.Fields = make_shared(); 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(); + query3.WhereCriteria = make_shared(); query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */ DbObject::OnQuery(query3); diff --git a/lib/db_ido/dbconnection.ti b/lib/db_ido/dbconnection.ti index dd595a890..68835220c 100644 --- a/lib/db_ido/dbconnection.ti +++ b/lib/db_ido/dbconnection.ti @@ -1,6 +1,5 @@ #include "db_ido/dbquery.h" #include "base/dynamicobject.h" -#include namespace icinga { @@ -12,7 +11,7 @@ class DbConnection : DynamicObject }; [config] Dictionary::Ptr cleanup { - default {{{ return boost::make_shared(); }}} + default {{{ return make_shared(); }}} }; [config] int categories { diff --git a/lib/db_ido/dbobject.cpp b/lib/db_ido/dbobject.cpp index eeff007fe..df7afaa8a 100644 --- a/lib/db_ido/dbobject.cpp +++ b/lib/db_ido/dbobject.cpp @@ -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(); + query.WhereCriteria = make_shared(); 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(); + query.WhereCriteria = make_shared(); query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject()); query.Object = GetSelf(); query.StatusUpdate = true; diff --git a/lib/db_ido/dbobject.h b/lib/db_ido/dbobject.h index feab08eaa..2030337f4 100644 --- a/lib/db_ido/dbobject.h +++ b/lib/db_ido/dbobject.h @@ -25,7 +25,6 @@ #include "db_ido/dbquery.h" #include "db_ido/dbtype.h" #include "base/dynamicobject.h" -#include namespace icinga { @@ -69,7 +68,7 @@ public: String GetName1(void) const; String GetName2(void) const; - boost::shared_ptr GetType(void) const; + shared_ptr 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& type, const String& name1, const String& name2); + DbObject(const shared_ptr& 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 m_Type; + shared_ptr m_Type; DynamicObject::Ptr m_Object; double m_LastConfigUpdate; double m_LastStatusUpdate; diff --git a/lib/db_ido/dbquery.h b/lib/db_ido/dbquery.h index dad43fa2c..71828e589 100644 --- a/lib/db_ido/dbquery.h +++ b/lib/db_ido/dbquery.h @@ -64,7 +64,7 @@ struct I2_DB_IDO_API DbQuery String IdColumn; Dictionary::Ptr Fields; Dictionary::Ptr WhereCriteria; - boost::shared_ptr Object; + shared_ptr Object; bool ConfigUpdate; bool StatusUpdate; diff --git a/lib/db_ido/dbtype.h b/lib/db_ido/dbtype.h index 396fbec59..e888436f5 100644 --- a/lib/db_ido/dbtype.h +++ b/lib/db_ido/dbtype.h @@ -23,7 +23,6 @@ #include "db_ido/i2-db_ido.h" #include "base/object.h" #include "base/registry.h" -#include namespace icinga { @@ -40,9 +39,9 @@ class I2_DB_IDO_API DbType : public Object public: DECLARE_PTR_TYPEDEFS(DbType); - typedef boost::function (const boost::shared_ptr&, const String&, const String&)> ObjectFactory; + typedef boost::function (const shared_ptr&, const String&, const String&)> ObjectFactory; typedef std::map TypeMap; - typedef std::map, boost::shared_ptr, pair_string_iless> ObjectMap; + typedef std::map, shared_ptr, 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 GetOrCreateObjectByName(const String& name1, const String& name2); + shared_ptr 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(name, table, tid, idcolumn, factory); + DbType::Ptr dbtype = make_shared(name, table, tid, idcolumn, factory); DbType::RegisterType(dbtype); } }; @@ -102,7 +101,7 @@ public: template shared_ptr DbObjectFactory(const DbType::Ptr& type, const String& name1, const String& name2) { - return boost::make_shared(type, name1, name2); + return make_shared(type, name1, name2); } #define REGISTER_DBTYPE(name, table, tid, idcolumn, type) \ diff --git a/lib/db_ido/dbvalue.cpp b/lib/db_ido/dbvalue.cpp index 2a0337572..392df4d92 100644 --- a/lib/db_ido/dbvalue.cpp +++ b/lib/db_ido/dbvalue.cpp @@ -30,12 +30,12 @@ Value DbValue::FromTimestamp(const Value& ts) if (ts.IsEmpty() || ts == 0) return Empty; - return boost::make_shared(DbValueTimestamp, ts); + return make_shared(DbValueTimestamp, ts); } Value DbValue::FromTimestampNow(void) { - return boost::make_shared(DbValueTimestampNow, Empty); + return make_shared(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(DbValueObjectInsertID, value); + return make_shared(DbValueObjectInsertID, value); } bool DbValue::IsTimestamp(const Value& value) diff --git a/lib/db_ido/dbvalue.h b/lib/db_ido/dbvalue.h index e1dbd60e1..bea0f8c5a 100644 --- a/lib/db_ido/dbvalue.h +++ b/lib/db_ido/dbvalue.h @@ -23,7 +23,6 @@ #include "db_ido/i2-db_ido.h" #include "base/object.h" #include "base/value.h" -#include namespace icinga { diff --git a/lib/db_ido/hostdbobject.cpp b/lib/db_ido/hostdbobject.cpp index 106a9d6b7..b95513d96 100644 --- a/lib/db_ido/hostdbobject.cpp +++ b/lib/db_ido/hostdbobject.cpp @@ -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::Ptr fields = make_shared(); Host::Ptr host = static_pointer_cast(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::Ptr fields = make_shared(); Host::Ptr host = static_pointer_cast(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(); + query_del1.WhereCriteria = make_shared(); 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(); + query_del2.WhereCriteria = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields2 = make_shared(); 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::Ptr fields_contact = make_shared(); 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::Ptr fields_contact = make_shared(); 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(); + query_del3.WhereCriteria = make_shared(); 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::Ptr fields3 = make_shared(); fields3->Set("varname", Convert::ToString(key)); fields3->Set("varvalue", Convert::ToString(value)); fields3->Set("config_type", 1); diff --git a/lib/db_ido/hostgroupdbobject.cpp b/lib/db_ido/hostgroupdbobject.cpp index 3e20c8c96..41d08c719 100644 --- a/lib/db_ido/hostgroupdbobject.cpp +++ b/lib/db_ido/hostgroupdbobject.cpp @@ -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::Ptr fields = make_shared(); HostGroup::Ptr group = static_pointer_cast(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(); + query1.WhereCriteria = make_shared(); 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(); + query2.Fields = make_shared(); 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); diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index 13a7be4d1..6c9862db1 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -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::Ptr fields = make_shared(); Service::Ptr service = static_pointer_cast(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::Ptr fields = make_shared(); Service::Ptr service = static_pointer_cast(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(); + query_del1.WhereCriteria = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields_contact = make_shared(); 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::Ptr fields_contact = make_shared(); 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(); + query_del2.WhereCriteria = make_shared(); 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::Ptr fields2 = make_shared(); 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(comment->Get("entry_time")); unsigned long entry_time_usec = (comment->Get("entry_time") - entry_time) * 1000 * 1000; - Dictionary::Ptr fields1 = boost::make_shared(); + Dictionary::Ptr fields1 = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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::Ptr fields2 = make_shared(); 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(); + query2.WhereCriteria = make_shared(); 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::Ptr fields1 = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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::Ptr fields3 = make_shared(); 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(); + query3.WhereCriteria = make_shared(); 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::Ptr fields1 = make_shared(); 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(); + query1.WhereCriteria = make_shared(); 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::Ptr fields3 = make_shared(); 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(); + query3.WhereCriteria = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); 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::Ptr fields1 = make_shared(); fields1->Set("entry_time", DbValue::FromTimestamp(static_cast(time))); fields1->Set("command_type", CompatUtility::MapExternalCommandType(command)); diff --git a/lib/db_ido/servicegroupdbobject.cpp b/lib/db_ido/servicegroupdbobject.cpp index 5d24cb3b5..d1af2b2b4 100644 --- a/lib/db_ido/servicegroupdbobject.cpp +++ b/lib/db_ido/servicegroupdbobject.cpp @@ -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::Ptr fields = make_shared(); ServiceGroup::Ptr group = static_pointer_cast(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(); + query1.WhereCriteria = make_shared(); 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(); + query2.Fields = make_shared(); 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); diff --git a/lib/db_ido/timeperioddbobject.cpp b/lib/db_ido/timeperioddbobject.cpp index 03bd78f61..327bba42b 100644 --- a/lib/db_ido/timeperioddbobject.cpp +++ b/lib/db_ido/timeperioddbobject.cpp @@ -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::Ptr fields = make_shared(); TimePeriod::Ptr tp = static_pointer_cast(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(); + query_del1.WhereCriteria = make_shared(); 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::Ptr segments = make_shared(); 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(); + query.Fields = make_shared(); 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); diff --git a/lib/db_ido/userdbobject.cpp b/lib/db_ido/userdbobject.cpp index ad0278a2d..1a05ed144 100644 --- a/lib/db_ido/userdbobject.cpp +++ b/lib/db_ido/userdbobject.cpp @@ -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::Ptr fields = make_shared(); User::Ptr user = static_pointer_cast(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::Ptr fields = make_shared(); User::Ptr user = static_pointer_cast(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::Ptr fields = make_shared(); User::Ptr user = static_pointer_cast(GetObject()); /* contact addresses */ diff --git a/lib/db_ido/usergroupdbobject.cpp b/lib/db_ido/usergroupdbobject.cpp index 928b71374..8aba6e69b 100644 --- a/lib/db_ido/usergroupdbobject.cpp +++ b/lib/db_ido/usergroupdbobject.cpp @@ -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::Ptr fields = make_shared(); UserGroup::Ptr group = static_pointer_cast(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(); + query1.WhereCriteria = make_shared(); 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(); + query2.Fields = make_shared(); 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); diff --git a/lib/icinga/compatutility.cpp b/lib/icinga/compatutility.cpp index b2360fcf4..511701756 100644 --- a/lib/icinga/compatutility.cpp +++ b/lib/icinga/compatutility.cpp @@ -24,7 +24,6 @@ #include "base/dynamictype.h" #include "base/objectlock.h" #include "base/debug.h" -#include #include #include #include @@ -36,8 +35,8 @@ using namespace icinga; Dictionary::Ptr CompatUtility::GetHostConfigAttributes(const Host::Ptr& host) { - Dictionary::Ptr attr = boost::make_shared(); - Dictionary::Ptr service_attr = boost::make_shared(); + Dictionary::Ptr attr = make_shared(); + Dictionary::Ptr service_attr = make_shared(); 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::Ptr attr = make_shared(); 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::Ptr attr = make_shared(); 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::Ptr attr = make_shared(); 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::Ptr customvars = make_shared(); 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::Ptr bag = make_shared(); 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::Ptr time_bag = make_shared(); unsigned long time_sec = static_cast(time); unsigned long time_usec = (time - time_sec) * 1000 * 1000; diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 5b85af1cb..13e6d82cf 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -32,7 +32,6 @@ #include "config/configitembuilder.h" #include "config/configcompilercontext.h" #include -#include #include using namespace icinga; @@ -170,7 +169,7 @@ void Host::UpdateSlaveServices(void) if (di.Path.IsEmpty()) di = item->GetDebugInfo(); - ConfigItemBuilder::Ptr builder = boost::make_shared(di); + ConfigItemBuilder::Ptr builder = make_shared(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::Ptr svc_exprl = make_shared(); item->GetLinkedExpressionList()->ExtractPath(path, svc_exprl); std::vector dpath; diff --git a/lib/icinga/hostgroup.cpp b/lib/icinga/hostgroup.cpp index 8a5590283..108251463 100644 --- a/lib/icinga/hostgroup.cpp +++ b/lib/icinga/hostgroup.cpp @@ -23,7 +23,6 @@ #include "base/objectlock.h" #include "base/utility.h" #include "base/timer.h" -#include #include using namespace icinga; diff --git a/lib/icinga/icingaapplication.cpp b/lib/icinga/icingaapplication.cpp index f8e567515..c0502a2c8 100644 --- a/lib/icinga/icingaapplication.cpp +++ b/lib/icinga/icingaapplication.cpp @@ -27,7 +27,6 @@ #include "base/timer.h" #include "base/scriptvariable.h" #include "base/initialize.h" -#include 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(); + l_RetentionTimer = make_shared(); l_RetentionTimer->SetInterval(300); l_RetentionTimer->OnTimerExpired.connect(boost::bind(&IcingaApplication::DumpProgramState, this)); l_RetentionTimer->Start(); diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index 011aaa862..2fffffb44 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -24,7 +24,6 @@ #include "base/objectlock.h" #include "base/logger_fwd.h" #include -#include #include using namespace icinga; @@ -40,7 +39,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const std::vector()) { - Array::Ptr resultArr = boost::make_shared(); + Array::Ptr resultArr = make_shared(); Array::Ptr arr = str; ObjectLock olock(arr); diff --git a/lib/icinga/macroresolver.cpp b/lib/icinga/macroresolver.cpp index ecce4fcf3..17a2923a7 100644 --- a/lib/icinga/macroresolver.cpp +++ b/lib/icinga/macroresolver.cpp @@ -18,12 +18,11 @@ ******************************************************************************/ #include "icinga/macroresolver.h" -#include using namespace icinga; StaticMacroResolver::StaticMacroResolver(void) - : m_Macros(boost::make_shared()) + : m_Macros(make_shared()) { } void StaticMacroResolver::Add(const String& macro, const String& value) diff --git a/lib/icinga/pluginutility.cpp b/lib/icinga/pluginutility.cpp index a5b3dfb2f..b7696dbe2 100644 --- a/lib/icinga/pluginutility.cpp +++ b/lib/icinga/pluginutility.cpp @@ -28,7 +28,6 @@ #include "base/process.h" #include #include -#include #include 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::Ptr result = make_shared(); String text; String perfdata; diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index cdcf874cf..2c84fc052 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -26,7 +26,6 @@ #include "base/logger_fwd.h" #include "base/convert.h" #include "base/utility.h" -#include #include #include #include @@ -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::Ptr vars_after = make_shared(); 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::Ptr checkInfo = make_shared(); 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(); + result = make_shared(); result->Set("state", StateUnknown); result->Set("output", message); } diff --git a/lib/icinga/service-comment.cpp b/lib/icinga/service-comment.cpp index 758e0212d..775e2ed3b 100644 --- a/lib/icinga/service-comment.cpp +++ b/lib/icinga/service-comment.cpp @@ -23,7 +23,6 @@ #include "base/logger_fwd.h" #include "base/timer.h" #include "base/utility.h" -#include #include #include @@ -55,7 +54,7 @@ String Service::AddComment(CommentType entryType, const String& author, else uid = id; - Dictionary::Ptr comment = boost::make_shared(); + Dictionary::Ptr comment = make_shared(); 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); } diff --git a/lib/icinga/service-downtime.cpp b/lib/icinga/service-downtime.cpp index 9eab76ec9..2626457ff 100644 --- a/lib/icinga/service-downtime.cpp +++ b/lib/icinga/service-downtime.cpp @@ -24,7 +24,6 @@ #include "base/timer.h" #include "base/utility.h" #include -#include #include using namespace icinga; @@ -57,7 +56,7 @@ String Service::AddDowntime(const String& comment_id, else uid = id; - Dictionary::Ptr downtime = boost::make_shared(); + Dictionary::Ptr downtime = make_shared(); 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()); + downtime->Set("triggers", make_shared()); 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(); + l_DowntimesExpireTimer = make_shared(); l_DowntimesExpireTimer->SetInterval(60); l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Service::DowntimesExpireTimerHandler)); l_DowntimesExpireTimer->Start(); diff --git a/lib/icinga/service-flapping.cpp b/lib/icinga/service-flapping.cpp index 86a6d94e1..ac9a01b48 100644 --- a/lib/icinga/service-flapping.cpp +++ b/lib/icinga/service-flapping.cpp @@ -26,7 +26,6 @@ #include "base/utility.h" #include "base/convert.h" #include -#include #include using namespace icinga; diff --git a/lib/icinga/service-notification.cpp b/lib/icinga/service-notification.cpp index 463470fe5..132f97fe5 100644 --- a/lib/icinga/service-notification.cpp +++ b/lib/icinga/service-notification.cpp @@ -26,7 +26,6 @@ #include "base/utility.h" #include "config/configitembuilder.h" #include -#include #include #include @@ -125,7 +124,7 @@ void Service::UpdateSlaveNotifications(void) if (di.Path.IsEmpty()) di = item->GetDebugInfo(); - ConfigItemBuilder::Ptr builder = boost::make_shared(di); + ConfigItemBuilder::Ptr builder = make_shared(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::Ptr nfc_exprl = make_shared(); item->GetLinkedExpressionList()->ExtractPath(path, nfc_exprl); std::vector dpath; diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 8db89814a..38d9848f9 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -27,7 +27,6 @@ #include "base/objectlock.h" #include "base/convert.h" #include "base/utility.h" -#include #include #include diff --git a/lib/icinga/service.ti b/lib/icinga/service.ti index 6122b8313..056a4e165 100644 --- a/lib/icinga/service.ti +++ b/lib/icinga/service.ti @@ -1,7 +1,6 @@ #include "icinga/host.h" #include "icinga/icingaapplication.h" #include "base/dynamicobject.h" -#include namespace icinga { @@ -111,10 +110,10 @@ class Service : DynamicObject }; [state] double acknowledgement_expiry; [state] Dictionary::Ptr comments { - default {{{ return boost::make_shared(); }}} + default {{{ return make_shared(); }}} }; [state] Dictionary::Ptr downtimes { - default {{{ return boost::make_shared(); }}} + default {{{ return make_shared(); }}} }; [state] bool enable_notifications (EnableNotificationsRaw) { default {{{ return true; }}} diff --git a/lib/icinga/servicegroup.cpp b/lib/icinga/servicegroup.cpp index 3b8cf4c83..a81783c63 100644 --- a/lib/icinga/servicegroup.cpp +++ b/lib/icinga/servicegroup.cpp @@ -24,7 +24,6 @@ #include "base/logger_fwd.h" #include "base/timer.h" #include "base/utility.h" -#include #include using namespace icinga; diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index f362ff13b..2c963e7ed 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -25,7 +25,6 @@ #include "base/logger_fwd.h" #include "base/timer.h" #include "base/utility.h" -#include #include using namespace icinga; @@ -41,7 +40,7 @@ void TimePeriod::Start(void) DynamicObject::Start(); if (!l_UpdateTimer) { - l_UpdateTimer = boost::make_shared(); + l_UpdateTimer = make_shared(); 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::Ptr segment = make_shared(); segment->Set("begin", begin); segment->Set("end", end); if (!segments) { - segments = boost::make_shared(); + segments = make_shared(); SetSegments(segments); } @@ -121,7 +120,7 @@ void TimePeriod::RemoveSegment(double begin, double end) if (!segments) return; - Array::Ptr newSegments = boost::make_shared(); + Array::Ptr newSegments = make_shared(); /* 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::Ptr newSegments = make_shared(); /* 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::Ptr segments = make_shared(); return segments; } Array::Ptr TimePeriod::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr&, double begin, double end) { - Array::Ptr segments = boost::make_shared(); + Array::Ptr segments = make_shared(); for (long t = begin / 60 - 1; t * 60 < end; t++) { if ((t % 2) == 0) { - Dictionary::Ptr segment = boost::make_shared(); + Dictionary::Ptr segment = make_shared(); segment->Set("begin", t * 60); segment->Set("end", (t + 1) * 60); diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index d02f12c52..7a8cddb13 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -22,7 +22,6 @@ #include "base/dynamictype.h" #include "base/utility.h" #include "base/objectlock.h" -#include using namespace icinga; diff --git a/lib/icinga/usergroup.cpp b/lib/icinga/usergroup.cpp index c06c52c30..0278fb5e2 100644 --- a/lib/icinga/usergroup.cpp +++ b/lib/icinga/usergroup.cpp @@ -23,7 +23,6 @@ #include "base/logger_fwd.h" #include "base/timer.h" #include "base/utility.h" -#include #include using namespace icinga; diff --git a/lib/methods/legacytimeperiod.cpp b/lib/methods/legacytimeperiod.cpp index c2e7e552e..027df543a 100644 --- a/lib/methods/legacytimeperiod.cpp +++ b/lib/methods/legacytimeperiod.cpp @@ -24,7 +24,6 @@ #include "base/objectlock.h" #include "base/logger_fwd.h" #include "base/debug.h" -#include #include #include #include @@ -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::Ptr segment = make_shared(); 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::Ptr segments = make_shared(); Dictionary::Ptr ranges = tp->GetRanges(); diff --git a/lib/methods/nullchecktask.cpp b/lib/methods/nullchecktask.cpp index 58f5ca70e..42368c572 100644 --- a/lib/methods/nullchecktask.cpp +++ b/lib/methods/nullchecktask.cpp @@ -25,7 +25,6 @@ #include "base/convert.h" #include "base/scriptfunction.h" #include "base/logger_fwd.h" -#include using namespace icinga; @@ -42,7 +41,7 @@ Dictionary::Ptr NullCheckTask::ScriptFunc(const Service::Ptr&) output += name; String perfdata = "time=" + Convert::ToString(static_cast(Utility::GetTime())); - Dictionary::Ptr cr = boost::make_shared(); + Dictionary::Ptr cr = make_shared(); cr->Set("output", output); cr->Set("performance_data_raw", perfdata); cr->Set("state", StateOK); diff --git a/lib/methods/nulleventtask.cpp b/lib/methods/nulleventtask.cpp index 5e19fcf4d..a95e9de4d 100644 --- a/lib/methods/nulleventtask.cpp +++ b/lib/methods/nulleventtask.cpp @@ -20,7 +20,6 @@ #include "methods/nulleventtask.h" #include "base/scriptfunction.h" #include "base/logger_fwd.h" -#include using namespace icinga; diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp index 4869a5d7f..a99dd1b0b 100644 --- a/lib/methods/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -29,7 +29,6 @@ #include "base/process.h" #include #include -#include #include 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::Ptr envMacros = make_shared(); 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::SplitCommand(command), envMacros); + Process::Ptr process = make_shared(Process::SplitCommand(command), envMacros); process->SetTimeout(commandObj->GetTimeout()); diff --git a/lib/methods/plugineventtask.cpp b/lib/methods/plugineventtask.cpp index 4aaf42a03..222a814d5 100644 --- a/lib/methods/plugineventtask.cpp +++ b/lib/methods/plugineventtask.cpp @@ -26,7 +26,6 @@ #include "base/scriptfunction.h" #include "base/utility.h" #include "base/process.h" -#include #include 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::Ptr envMacros = make_shared(); Array::Ptr export_macros = commandObj->GetExportMacros(); @@ -63,7 +62,7 @@ void PluginEventTask::ScriptFunc(const Service::Ptr& service) } } - Process::Ptr process = boost::make_shared(Process::SplitCommand(command), envMacros); + Process::Ptr process = make_shared(Process::SplitCommand(command), envMacros); process->SetTimeout(commandObj->GetTimeout()); diff --git a/lib/methods/pluginnotificationtask.cpp b/lib/methods/pluginnotificationtask.cpp index a94b1a110..6247499fc 100644 --- a/lib/methods/pluginnotificationtask.cpp +++ b/lib/methods/pluginnotificationtask.cpp @@ -27,7 +27,6 @@ #include "base/logger_fwd.h" #include "base/utility.h" #include "base/process.h" -#include #include 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::Ptr notificationMacroResolver = make_shared(); 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::Ptr envMacros = make_shared(); 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::SplitCommand(command), envMacros); + Process::Ptr process = make_shared(Process::SplitCommand(command), envMacros); process->SetTimeout(commandObj->GetTimeout()); diff --git a/lib/methods/randomchecktask.cpp b/lib/methods/randomchecktask.cpp index 2fb8ea110..9c6f9b8fe 100644 --- a/lib/methods/randomchecktask.cpp +++ b/lib/methods/randomchecktask.cpp @@ -25,7 +25,6 @@ #include "base/convert.h" #include "base/scriptfunction.h" #include "base/logger_fwd.h" -#include using namespace icinga; @@ -42,7 +41,7 @@ Dictionary::Ptr RandomCheckTask::ScriptFunc(const Service::Ptr&) output += name; String perfdata = "time=" + Convert::ToString(static_cast(Utility::GetTime())); - Dictionary::Ptr cr = boost::make_shared(); + Dictionary::Ptr cr = make_shared(); cr->Set("output", output); cr->Set("performance_data_raw", perfdata); cr->Set("state", static_cast(Utility::Random() % 4)); diff --git a/lib/python/pythonlanguage.cpp b/lib/python/pythonlanguage.cpp index b02d04207..d6cedf5e5 100644 --- a/lib/python/pythonlanguage.cpp +++ b/lib/python/pythonlanguage.cpp @@ -90,7 +90,7 @@ ScriptInterpreter::Ptr PythonLanguage::CreateInterpreter(const Script::Ptr& scri { InitializeOnce(); - return boost::make_shared(GetSelf(), script); + return make_shared(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::Ptr dict = make_shared(); 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::Ptr arr = make_shared(); for (Py_ssize_t pos = 0; pos < PyList_Size(value); pos++) { PyObject *dv = PyList_GetItem(value, pos); diff --git a/test/base-array.cpp b/test/base-array.cpp index 28cc33c16..d6433b5b7 100644 --- a/test/base-array.cpp +++ b/test/base-array.cpp @@ -20,7 +20,6 @@ #include "base/array.h" #include "base/objectlock.h" #include -#include #include 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::Ptr array = make_shared(); BOOST_CHECK(array); BOOST_CHECK(array->GetLength() == 0); } BOOST_AUTO_TEST_CASE(getset) { - Array::Ptr array = boost::make_shared(); + Array::Ptr array = make_shared(); 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::Ptr array = make_shared(); 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::Ptr array = make_shared(); 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::Ptr array = make_shared(); 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::Ptr array = make_shared(); array->Add(7); array->Add(2); array->Add(5); diff --git a/test/base-convert.cpp b/test/base-convert.cpp index 7ecde6d5a..4656d2327 100644 --- a/test/base-convert.cpp +++ b/test/base-convert.cpp @@ -20,7 +20,6 @@ #include "base/convert.h" #include "base/object.h" #include -#include #include 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::Ptr object = make_shared(); BOOST_CHECK(Convert::ToString(object) == "Object of type 'icinga::Object'"); } diff --git a/test/base-dictionary.cpp b/test/base-dictionary.cpp index 0ededfc04..82c31f7c7 100644 --- a/test/base-dictionary.cpp +++ b/test/base-dictionary.cpp @@ -20,7 +20,6 @@ #include "base/dictionary.h" #include "base/objectlock.h" #include -#include #include #include @@ -30,13 +29,13 @@ BOOST_AUTO_TEST_SUITE(base_dictionary) BOOST_AUTO_TEST_CASE(construct) { - Dictionary::Ptr dictionary = boost::make_shared(); + Dictionary::Ptr dictionary = make_shared(); BOOST_CHECK(dictionary); } BOOST_AUTO_TEST_CASE(get1) { - Dictionary::Ptr dictionary = boost::make_shared(); + Dictionary::Ptr dictionary = make_shared(); 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::Ptr other = boost::make_shared(); + Dictionary::Ptr dictionary = make_shared(); + Dictionary::Ptr other = make_shared(); 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::Ptr dictionary = make_shared(); 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::Ptr dictionary = make_shared(); 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::Ptr dictionary = make_shared(); 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::Ptr dictionary = make_shared(); dictionary->Set("test1", 7); dictionary->Set("test2", "hello world"); diff --git a/test/base-fifo.cpp b/test/base-fifo.cpp index 2bab95758..c0f8daa9d 100644 --- a/test/base-fifo.cpp +++ b/test/base-fifo.cpp @@ -20,7 +20,6 @@ #include "base/fifo.h" #include "base/objectlock.h" #include -#include #include 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::Ptr fifo = make_shared(); 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::Ptr fifo = make_shared(); fifo->Write("hello", 5); BOOST_CHECK(fifo->GetAvailableBytes() == 5); diff --git a/test/base-netstring.cpp b/test/base-netstring.cpp index 22c7ef576..14e40fa54 100644 --- a/test/base-netstring.cpp +++ b/test/base-netstring.cpp @@ -20,7 +20,6 @@ #include "base/netstring.h" #include "base/fifo.h" #include -#include 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::Ptr fifo = make_shared(); NetString::WriteStringToStream(fifo, "hello"); diff --git a/test/base-object.cpp b/test/base-object.cpp index c09479a4b..4def3a468 100644 --- a/test/base-object.cpp +++ b/test/base-object.cpp @@ -20,15 +20,13 @@ #include "base/object.h" #include "base/value.h" #include -#include using namespace icinga; class TestObject : public Object { public: - typedef boost::shared_ptr Ptr; - typedef boost::weak_ptr 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(); + Object::Ptr tobject = make_shared(); BOOST_CHECK(tobject); } BOOST_AUTO_TEST_CASE(getself) { - TestObject::Ptr tobject = boost::make_shared(); + TestObject::Ptr tobject = make_shared(); 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::Ptr tobject = make_shared(); TestObject::WeakPtr wtobject = tobject; tobject.reset(); BOOST_CHECK(!tobject); diff --git a/test/base-shellescape.cpp b/test/base-shellescape.cpp index bb0f06b9a..a9b2d3a59 100644 --- a/test/base-shellescape.cpp +++ b/test/base-shellescape.cpp @@ -19,7 +19,6 @@ #include "base/utility.h" #include -#include #include using namespace icinga; diff --git a/test/base-timer.cpp b/test/base-timer.cpp index 648459c7a..f4b6a5175 100644 --- a/test/base-timer.cpp +++ b/test/base-timer.cpp @@ -21,7 +21,6 @@ #include "base/utility.h" #include "base/application.h" #include -#include #include 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::Ptr timer = make_shared(); BOOST_CHECK(timer); } BOOST_AUTO_TEST_CASE(interval) { - Timer::Ptr timer = boost::make_shared(); + Timer::Ptr timer = make_shared(); 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::Ptr timer = make_shared(); 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::Ptr timer = make_shared(); timer->OnTimerExpired.connect(boost::bind(&Callback, &counter)); timer->SetInterval(1);