From: Alexander A. Klimov Date: Thu, 25 Jul 2019 12:55:22 +0000 (+0200) Subject: Replace std::shared_ptr with Shared::Ptr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26ce2cfb7345947405bc70f585a5ba040284c815;p=icinga2 Replace std::shared_ptr with Shared::Ptr --- diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp index 1d81f7793..f78ec0ce6 100644 --- a/lib/base/tlsstream.hpp +++ b/lib/base/tlsstream.hpp @@ -86,7 +86,7 @@ private: }; typedef boost::asio::buffered_stream AsioTcpStream; -typedef std::pair::Ptr, std::shared_ptr> OptionalTlsStream; +typedef std::pair::Ptr, Shared::Ptr> OptionalTlsStream; } diff --git a/lib/perfdata/elasticsearchwriter.cpp b/lib/perfdata/elasticsearchwriter.cpp index a9d38d36f..9e9a91978 100644 --- a/lib/perfdata/elasticsearchwriter.cpp +++ b/lib/perfdata/elasticsearchwriter.cpp @@ -601,7 +601,7 @@ OptionalTlsStream ElasticsearchWriter::Connect() stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { - stream.second = std::make_shared(IoEngine::Get().GetIoContext()); + stream.second = Shared::Make(IoEngine::Get().GetIoContext()); } try { diff --git a/lib/perfdata/gelfwriter.cpp b/lib/perfdata/gelfwriter.cpp index 3094dd71f..ed3b678c3 100644 --- a/lib/perfdata/gelfwriter.cpp +++ b/lib/perfdata/gelfwriter.cpp @@ -176,7 +176,7 @@ void GelfWriter::ReconnectInternal() m_Stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { - m_Stream.second = std::make_shared(IoEngine::Get().GetIoContext()); + m_Stream.second = Shared::Make(IoEngine::Get().GetIoContext()); } try { diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp index 642926f66..a1f5a19ec 100644 --- a/lib/perfdata/graphitewriter.cpp +++ b/lib/perfdata/graphitewriter.cpp @@ -187,7 +187,7 @@ void GraphiteWriter::ReconnectInternal() Log(LogNotice, "GraphiteWriter") << "Reconnecting to Graphite on host '" << GetHost() << "' port '" << GetPort() << "'."; - m_Stream = std::make_shared(IoEngine::Get().GetIoContext()); + m_Stream = Shared::Make(IoEngine::Get().GetIoContext()); try { icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort()); diff --git a/lib/perfdata/graphitewriter.hpp b/lib/perfdata/graphitewriter.hpp index 42f741cee..34118ab94 100644 --- a/lib/perfdata/graphitewriter.hpp +++ b/lib/perfdata/graphitewriter.hpp @@ -37,7 +37,7 @@ protected: void Pause() override; private: - std::shared_ptr m_Stream; + Shared::Ptr m_Stream; boost::mutex m_StreamMutex; WorkQueue m_WorkQueue{10000000, 1}; diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp index 866dc25a0..9036a79dc 100644 --- a/lib/perfdata/influxdbwriter.cpp +++ b/lib/perfdata/influxdbwriter.cpp @@ -190,7 +190,7 @@ OptionalTlsStream InfluxdbWriter::Connect() stream.first = Shared::Make(IoEngine::Get().GetIoContext(), *sslContext, GetHost()); } else { - stream.second = std::make_shared(IoEngine::Get().GetIoContext()); + stream.second = Shared::Make(IoEngine::Get().GetIoContext()); } try { diff --git a/lib/perfdata/opentsdbwriter.cpp b/lib/perfdata/opentsdbwriter.cpp index b936b3083..38405a2a3 100644 --- a/lib/perfdata/opentsdbwriter.cpp +++ b/lib/perfdata/opentsdbwriter.cpp @@ -120,8 +120,7 @@ void OpenTsdbWriter::ReconnectTimerHandler() * We're using telnet as input method. Future PRs may change this into using the HTTP API. * http://opentsdb.net/docs/build/html/user_guide/writing/index.html#telnet */ - - m_Stream = std::make_shared(IoEngine::Get().GetIoContext()); + m_Stream = Shared::Make(IoEngine::Get().GetIoContext()); try { icinga::Connect(m_Stream->lowest_layer(), GetHost(), GetPort()); diff --git a/lib/perfdata/opentsdbwriter.hpp b/lib/perfdata/opentsdbwriter.hpp index bf0fc8eb1..5aff981cd 100644 --- a/lib/perfdata/opentsdbwriter.hpp +++ b/lib/perfdata/opentsdbwriter.hpp @@ -32,7 +32,7 @@ protected: void Pause() override; private: - std::shared_ptr m_Stream; + Shared::Ptr m_Stream; Timer::Ptr m_ReconnectTimer;