]> granicus.if.org Git - icinga2/commitdiff
Use nullptr instead of <Type>::Ptr() 5824/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 30 Nov 2017 07:36:35 +0000 (08:36 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 30 Nov 2017 16:47:09 +0000 (17:47 +0100)
72 files changed:
lib/base/configobject.cpp
lib/base/configtype.cpp
lib/base/configwriter.hpp
lib/base/objecttype.cpp
lib/base/primitivetype.cpp
lib/base/process.hpp
lib/base/scriptutils.cpp
lib/base/serializer.cpp
lib/base/type.cpp
lib/base/value.cpp
lib/base/value.hpp
lib/cli/clicommand.cpp
lib/config/activationcontext.hpp
lib/config/configitem.cpp
lib/config/expression.hpp
lib/config/vmops.hpp
lib/db_ido/commanddbobject.cpp
lib/db_ido/dbobject.cpp
lib/db_ido/dbtype.cpp
lib/db_ido/hostgroupdbobject.cpp
lib/db_ido/servicegroupdbobject.cpp
lib/db_ido/usergroupdbobject.cpp
lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp
lib/demo/demo.cpp
lib/icinga/apiactions.cpp
lib/icinga/apiactions.hpp
lib/icinga/checkable-check.cpp
lib/icinga/checkable-dependency.cpp
lib/icinga/checkable.cpp
lib/icinga/checkable.hpp
lib/icinga/checkcommand.hpp
lib/icinga/clusterevents.cpp
lib/icinga/comment.cpp
lib/icinga/comment.hpp
lib/icinga/comment.ti
lib/icinga/compatutility.cpp
lib/icinga/dependency.ti
lib/icinga/downtime.cpp
lib/icinga/downtime.hpp
lib/icinga/downtime.ti
lib/icinga/eventcommand.hpp
lib/icinga/externalcommandprocessor.cpp
lib/icinga/host.cpp
lib/icinga/legacytimeperiod.cpp
lib/icinga/macroprocessor.cpp
lib/icinga/macroprocessor.hpp
lib/icinga/notification.cpp
lib/icinga/notification.ti
lib/icinga/notificationcommand.hpp
lib/icinga/objectutils.cpp
lib/icinga/scheduleddowntime.ti
lib/icinga/service.cpp
lib/livestatus/hoststable.cpp
lib/livestatus/livestatusquery.cpp
lib/livestatus/logtable.cpp
lib/livestatus/servicestable.cpp
lib/livestatus/statehisttable.cpp
lib/livestatus/table.cpp
lib/remote/actionshandler.cpp
lib/remote/apiclient.cpp
lib/remote/apilistener-configsync.cpp
lib/remote/apilistener.cpp
lib/remote/apilistener.hpp
lib/remote/apiuser.cpp
lib/remote/configpackageutility.hpp
lib/remote/endpoint.cpp
lib/remote/eventqueue.cpp
lib/remote/filterutility.cpp
lib/remote/httpserverconnection.cpp
lib/remote/jsonrpcconnection-pki.cpp
lib/remote/zone.cpp

index 55b780e13c141390c5f6d55fd0f008947d0af95f..ea8d106a13b23c2d0daa0f644304e817768f83d6 100644 (file)
@@ -706,7 +706,7 @@ ConfigObject::Ptr ConfigObject::GetObject(const String& type, const String& name
        ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
 
        if (!ctype)
-               return ConfigObject::Ptr();
+               return nullptr;
 
        return ctype->GetObject(name);
 }
index b3b8e0a39d21014af63b716c0b46588464d972a3..a21eb142c45c34b756de344caf8de057e764bd02 100644 (file)
@@ -33,7 +33,7 @@ ConfigObject::Ptr ConfigType::GetObject(const String& name) const
        auto nt = m_ObjectMap.find(name);
 
        if (nt == m_ObjectMap.end())
-               return ConfigObject::Ptr();
+               return nullptr;
 
        return nt->second;
 }
index c39a046caf98b9a02b8009853eb83f9a3ddb83ff..9573050d04b5d710b38f880c64717de7d8882fff 100644 (file)
@@ -61,7 +61,7 @@ public:
        static void EmitArray(std::ostream& fp, int indentLevel, const Array::Ptr& val);
        static void EmitArrayItems(std::ostream& fp, int indentLevel, const Array::Ptr& val);
        static void EmitScope(std::ostream& fp, int indentLevel, const Dictionary::Ptr& val,
-           const Array::Ptr& imports = Array::Ptr(), bool splitDot = false);
+           const Array::Ptr& imports = nullptr, bool splitDot = false);
        static void EmitValue(std::ostream& fp, int indentLevel, const Value& val);
        static void EmitRaw(std::ostream& fp, const String& val);
        static void EmitIndent(std::ostream& fp, int indentLevel);
index a172cf23d138447abb0a43c55b4bffb530fbf11b..e5cdba37248aac2751ea0f93d76b9af6a94fe487 100644 (file)
@@ -39,7 +39,7 @@ String ObjectType::GetName(void) const
 
 Type::Ptr ObjectType::GetBaseType(void) const
 {
-       return Type::Ptr();
+       return nullptr;
 }
 
 int ObjectType::GetAttributes(void) const
index 6a31d1a69e38ca5a1bbdd53ce306294d6b2a390a..6c4f37bfc0dbf1862b143519b10d0d6fc10850b7 100644 (file)
@@ -34,7 +34,7 @@ String PrimitiveType::GetName(void) const
 Type::Ptr PrimitiveType::GetBaseType(void) const
 {
        if (m_Base == "None")
-               return Type::Ptr();
+               return nullptr;
        else
                return Type::GetByName(m_Base);
 }
index 9414c68da37e8b75efbaae3a74280a8085ebfb92..8e39e7998dc9bd3e4d84b90e2327f396fa81ee4c 100644 (file)
@@ -66,7 +66,7 @@ public:
 
        static const std::deque<Process::Ptr>::size_type MaxTasksPerThread = 512;
 
-       Process(const Arguments& arguments, const Dictionary::Ptr& extraEnvironment = Dictionary::Ptr());
+       Process(const Arguments& arguments, const Dictionary::Ptr& extraEnvironment = nullptr);
        ~Process(void);
 
        void SetTimeout(double timeout);
index e3a1b64a7005ae792c71c51b52bbf4e699e53325..785b4b942bdd906eeeeb511927d8aca2e7716a8b 100644 (file)
@@ -405,7 +405,7 @@ ConfigObject::Ptr ScriptUtils::GetObject(const Value& vtype, const String& name)
        ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
 
        if (!ctype)
-               return ConfigObject::Ptr();
+               return nullptr;
 
        return ctype->GetObject(name);
 }
index 5485c12b47775b19a4985cafb0c811446c330ba7..f51493aeaf58acb35e62d0ec9e4eac7142023f06 100644 (file)
@@ -55,7 +55,7 @@ static Object::Ptr SerializeObject(const Object::Ptr& input, int attributeTypes)
        Type::Ptr type = input->GetReflectionType();
 
        if (!type)
-               return Object::Ptr();
+               return nullptr;
 
        Dictionary::Ptr fields = new Dictionary();
 
@@ -168,7 +168,7 @@ Value icinga::Serialize(const Value& value, int attributeTypes)
 
 Value icinga::Deserialize(const Value& value, bool safe_mode, int attributeTypes)
 {
-       return Deserialize(Object::Ptr(), value, safe_mode, attributeTypes);
+       return Deserialize(nullptr, value, safe_mode, attributeTypes);
 }
 
 Value icinga::Deserialize(const Object::Ptr& object, const Value& value, bool safe_mode, int attributeTypes)
index cb2b2e2fa719dd424ab8d48982b9b99211e6255a..f58d6e19352dbc5a8167092aa834602d7b9cdf50 100644 (file)
@@ -49,12 +49,12 @@ Type::Ptr Type::GetByName(const String& name)
        Dictionary::Ptr typesNS = ScriptGlobal::Get("Types", &Empty);
 
        if (!typesNS)
-               return Type::Ptr();
+               return nullptr;
 
        Value ptype = typesNS->Get(name);
 
        if (!ptype.IsObjectType<Type>())
-               return Type::Ptr();
+               return nullptr;
 
        return ptype;
 }
index 6b1db8e8b2c96c0438037f3979c78dd8afcd7104..e219fd60e8229ac0b8a54d94308e5e52f0dfe1ae 100644 (file)
@@ -100,7 +100,7 @@ Type::Ptr Value::GetReflectionType(void) const
                case ValueObject:
                        return boost::get<Object::Ptr>(m_Value)->GetReflectionType();
                default:
-                       return Type::Ptr();
+                       return nullptr;
        }
 }
 
index 85f4aedde31b1ccd2a646550609bbee8b8588fe5..bb32a9b0a01ec8b344262aa8945603bcc9285b38 100644 (file)
@@ -55,6 +55,9 @@ public:
        inline Value(void)
        { }
 
+       inline Value(std::nullptr_t)
+       { }
+
        inline Value(int value)
                : m_Value(double(value))
        { }
index ec8a04e3aeda9d4737bb2807da5dc17c70d94dc5..6e4b8b2f2c6c23eae9a79d476618988ebca5d1a6 100644 (file)
@@ -130,7 +130,7 @@ CLICommand::Ptr CLICommand::GetByName(const std::vector<String>& name)
        auto it = GetRegistry().find(name);
 
        if (it == GetRegistry().end())
-               return CLICommand::Ptr();
+               return nullptr;
 
        return it->second;
 }
index 22ba2200964f06c6373424f7a0aade8f678be4a5..324be2b2bdf96ae9b871edf5f191771466a4f220 100644 (file)
@@ -49,7 +49,7 @@ private:
 class I2_CONFIG_API ActivationScope
 {
 public:
-       ActivationScope(const ActivationContext::Ptr& context = ActivationContext::Ptr());
+       ActivationScope(const ActivationContext::Ptr& context = nullptr);
        ~ActivationScope(void);
 
        ActivationContext::Ptr GetContext(void) const;
index edb0527bae1576461ade0ff46763703b2fb5c4e6..9227db3e60ed94cd9cb99eb85fcd933a34b5343d 100644 (file)
@@ -185,7 +185,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
                BOOST_THROW_EXCEPTION(ScriptError("Type '" + GetType() + "' does not exist.", m_DebugInfo));
 
        if (IsAbstract())
-               return ConfigObject::Ptr();
+               return nullptr;
 
        ConfigObject::Ptr dobj = static_pointer_cast<ConfigObject>(type->Instantiate(std::vector<Value>()));
 
@@ -211,7 +211,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
                                m_IgnoredItems.push_back(m_DebugInfo.Path);
                        }
 
-                       return ConfigObject::Ptr();
+                       return nullptr;
                }
 
                throw;
@@ -263,7 +263,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
                                m_IgnoredItems.push_back(m_DebugInfo.Path);
                        }
 
-                       return ConfigObject::Ptr();
+                       return nullptr;
                }
 
                ex.SetDebugHint(dhint);
@@ -282,7 +282,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
                                m_IgnoredItems.push_back(m_DebugInfo.Path);
                        }
 
-                       return ConfigObject::Ptr();
+                       return nullptr;
                }
 
                throw;
@@ -378,12 +378,12 @@ ConfigItem::Ptr ConfigItem::GetByTypeAndName(const Type::Ptr& type, const String
        auto it = m_Items.find(type);
 
        if (it == m_Items.end())
-               return ConfigItem::Ptr();
+               return nullptr;
 
        auto it2 = it->second.find(name);
 
        if (it2 == it->second.end())
-               return ConfigItem::Ptr();
+               return nullptr;
 
        return it2->second;
 }
index dec6f1c75641d0410d8e089e31d2eb6ad27529a7..9c15096507d8bf360074482794c381a7d63f9b0f 100644 (file)
@@ -36,7 +36,7 @@ namespace icinga
 struct DebugHint
 {
 public:
-       DebugHint(const Dictionary::Ptr& hints = Dictionary::Ptr())
+       DebugHint(const Dictionary::Ptr& hints = nullptr)
                : m_Hints(hints)
        { }
 
index 4376f32d76d533a1de1b69269526ebf4d3d8e8cf..0c56fee71d98f44cb5262b8e206b1eb1f4a803fd 100644 (file)
@@ -152,7 +152,7 @@ public:
                        NameComposer *nc = dynamic_cast<NameComposer *>(type.get());
 
                        if (nc)
-                               checkName = nc->MakeName(name, Dictionary::Ptr());
+                               checkName = nc->MakeName(name, nullptr);
                }
 
                if (!checkName.IsEmpty()) {
index 1b059d2aa7ef7ef5324061f1c32d014b867bcb42..12e6d5869cd93302b856d5fd1ea8b42f9df3c9ac 100644 (file)
@@ -45,5 +45,5 @@ Dictionary::Ptr CommandDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr CommandDbObject::GetStatusFields(void) const
 {
-       return Dictionary::Ptr();
+       return nullptr;
 }
index a606a2e6733eb4789e49a0307b8ce9c1ab0e0703..ab39a5effc76d4c4cac04f23af0515e31084a97f 100644 (file)
@@ -354,7 +354,7 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const ConfigObject::Ptr& object)
        DbType::Ptr dbtype = DbType::GetByName(object->GetReflectionType()->GetName());
 
        if (!dbtype)
-               return DbObject::Ptr();
+               return nullptr;
 
        Service::Ptr service;
        String name1, name2;
index 6baf2d2bc61fc19f67c0fca94c948ad5ba174bd7..9877c5746de1edee0fd6e009ec9795a25b5446ee 100644 (file)
@@ -68,7 +68,7 @@ DbType::Ptr DbType::GetByName(const String& name)
        auto it = GetTypes().find(typeName);
 
        if (it == GetTypes().end())
-               return DbType::Ptr();
+               return nullptr;
 
        return it->second;
 }
@@ -82,7 +82,7 @@ DbType::Ptr DbType::GetByID(long tid)
                        return kv.second;
        }
 
-       return DbType::Ptr();
+       return nullptr;
 }
 
 DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String& name2)
index f9d9197440053326afb4411f82f3476d9d4ccf74..b1600006828c80d14db92df304d1d6a6e2581d0d 100644 (file)
@@ -47,5 +47,5 @@ Dictionary::Ptr HostGroupDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr HostGroupDbObject::GetStatusFields(void) const
 {
-       return Dictionary::Ptr();
+       return nullptr;
 }
index 06068ce32c39b6cfdf4204f122878494147d16b3..1cb529acb83f9c6116b1eef817275ae3c3b78477 100644 (file)
@@ -46,5 +46,5 @@ Dictionary::Ptr ServiceGroupDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr ServiceGroupDbObject::GetStatusFields(void) const
 {
-       return Dictionary::Ptr();
+       return nullptr;
 }
index 5954f16fe8f2b3ac82f10e31e931999e3c7c9ab8..60390325ffb4cca8c7be0adc0ac80f40441a0cd1 100644 (file)
@@ -44,5 +44,5 @@ Dictionary::Ptr UserGroupDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr UserGroupDbObject::GetStatusFields(void) const
 {
-       return Dictionary::Ptr();
+       return nullptr;
 }
index 1ed3a8c97917925082d743167880dc7d39f63f85..59be843ea2513ae206c20fd94e905534e479423e 100644 (file)
@@ -684,12 +684,12 @@ Dictionary::Ptr IdoMysqlConnection::FetchRow(const IdoMysqlResult& result)
        row = mysql_fetch_row(result.get());
 
        if (!row)
-               return Dictionary::Ptr();
+               return nullptr;
 
        lengths = mysql_fetch_lengths(result.get());
 
        if (!lengths)
-               return Dictionary::Ptr();
+               return nullptr;
 
        Dictionary::Ptr dict = new Dictionary();
 
index 035a9c9d07ed27a036ad84bee6404edb5ccc7f83..2db019072a9f654acab3419cd58a4200039ebcb2 100644 (file)
@@ -522,7 +522,7 @@ Dictionary::Ptr IdoPgsqlConnection::FetchRow(const IdoPgsqlResult& result, int r
        AssertOnWorkQueue();
 
        if (row >= PQntuples(result.get()))
-               return Dictionary::Ptr();
+               return nullptr;
 
        int columns = PQnfields(result.get());
 
index f54aa270b8f06cbd7b29fd842d7a55f87599091f..d213515c09976773c0eed2df2293c22d09156075 100644 (file)
@@ -54,7 +54,7 @@ void Demo::DemoTimerHandler(void)
        ApiListener::Ptr listener = ApiListener::GetInstance();
        if (listener) {
                MessageOrigin::Ptr origin = new MessageOrigin();
-               listener->RelayMessage(origin, ConfigObject::Ptr(), message, true);
+               listener->RelayMessage(origin, nullptr, message, true);
                Log(LogInformation, "Demo", "Sent demo::HelloWorld message");
        }
 }
index a44ebb29c4a6030e81e1c48fa385e805f8582204..e4070324ae59e4ce9a38b1a1aade4c1c0b348fd6 100644 (file)
@@ -165,7 +165,7 @@ Dictionary::Ptr ApiActions::SendCustomNotification(const ConfigObject::Ptr& obje
                checkable->SetForceNextNotification(true);
 
        Checkable::OnNotificationsRequested(checkable, NotificationCustom, checkable->GetLastCheckResult(),
-           HttpUtility::GetLastParameter(params, "author"), HttpUtility::GetLastParameter(params, "comment"), MessageOrigin::Ptr());
+           HttpUtility::GetLastParameter(params, "author"), HttpUtility::GetLastParameter(params, "comment"), nullptr);
 
        return ApiActions::CreateResult(200, "Successfully sent custom notification for object '" + checkable->GetName() + "'.");
 }
index 8bfcd8a4e4bb7fa0d262df477ccc05dc2f9c6f65..9b037183fba90f6d1a9226cd1f0d2f65d9ff11b8 100644 (file)
@@ -48,7 +48,7 @@ public:
        static Dictionary::Ptr GenerateTicket(const ConfigObject::Ptr& object, const Dictionary::Ptr& params);
 
 private:
-       static Dictionary::Ptr CreateResult(int code, const String& status, const Dictionary::Ptr& additional = Dictionary::Ptr());
+       static Dictionary::Ptr CreateResult(int code, const String& status, const Dictionary::Ptr& additional = nullptr);
 };
 
 }
index 893903ba41d0ac0b713eaf22d2f7e3e10dd3ad48..61a4905a2d7e0550cebe12f9b6e037af9ce99c50 100644 (file)
@@ -371,7 +371,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
        if (!in_downtime && !was_flapping && is_flapping) {
                /* FlappingStart notifications happen on state changes, not in downtimes */
                if (!IsPaused())
-                       OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr());
+                       OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", nullptr);
 
                Log(LogNotice, "Checkable")
                    << "Flapping Start: Checkable '" << GetName() << "' started flapping (Current flapping value "
@@ -381,7 +381,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
        } else if (!in_downtime && was_flapping && !is_flapping) {
                /* FlappingEnd notifications are independent from state changes, must not happen in downtine */
                if (!IsPaused())
-                       OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr());
+                       OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", nullptr);
 
                Log(LogNotice, "Checkable")
                    << "Flapping Stop: Checkable '" << GetName() << "' stopped flapping (Current flapping value "
@@ -392,7 +392,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 
        if (send_notification && !is_flapping) {
                if (!IsPaused())
-                       OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr());
+                       OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", nullptr);
        }
 }
 
index 90714fc9d1df079fca648aab13da937d4479ecfe..c567f474be4a71a2bae0dc6d9b18ed4e6175c3d5 100644 (file)
@@ -80,7 +80,7 @@ bool Checkable::IsReachable(DependencyType dt, Dependency::Ptr *failedDependency
 
                if (host && host->GetState() != HostUp && host->GetStateType() == StateTypeHard) {
                        if (failedDependency)
-                               *failedDependency = Dependency::Ptr();
+                               *failedDependency = nullptr;
 
                        return false;
                }
@@ -96,7 +96,7 @@ bool Checkable::IsReachable(DependencyType dt, Dependency::Ptr *failedDependency
        }
 
        if (failedDependency)
-               *failedDependency = Dependency::Ptr();
+               *failedDependency = nullptr;
 
        return true;
 }
index 1fbfa47ab1734bbef4f687edfca58630b2ebd19b..86cea0fc0b19cceced995f63789e1c11a1206d85 100644 (file)
@@ -128,7 +128,7 @@ void Checkable::AcknowledgeProblem(const String& author, const String& comment,
        SetAcknowledgementExpiry(expiry);
 
        if (notify && !IsPaused())
-               OnNotificationsRequested(this, NotificationAcknowledgement, GetLastCheckResult(), author, comment, MessageOrigin::Ptr());
+               OnNotificationsRequested(this, NotificationAcknowledgement, GetLastCheckResult(), author, comment, nullptr);
 
        OnAcknowledgementSet(this, author, comment, type, notify, persistent, expiry, origin);
 }
@@ -173,7 +173,7 @@ void Checkable::NotifyDowntimeInternal(const Downtime::Ptr& downtime)
        Checkable::Ptr checkable = downtime->GetCheckable();
 
        if (!checkable->IsPaused())
-               OnNotificationsRequested(checkable, NotificationDowntimeStart, checkable->GetLastCheckResult(), downtime->GetAuthor(), downtime->GetComment(), MessageOrigin::Ptr());
+               OnNotificationsRequested(checkable, NotificationDowntimeStart, checkable->GetLastCheckResult(), downtime->GetAuthor(), downtime->GetComment(), nullptr);
 }
 
 void Checkable::NotifyDowntimeEnd(const Downtime::Ptr& downtime)
@@ -185,7 +185,7 @@ void Checkable::NotifyDowntimeEnd(const Downtime::Ptr& downtime)
        Checkable::Ptr checkable = downtime->GetCheckable();
 
        if (!checkable->IsPaused())
-               OnNotificationsRequested(checkable, NotificationDowntimeEnd, checkable->GetLastCheckResult(), downtime->GetAuthor(), downtime->GetComment(), MessageOrigin::Ptr());
+               OnNotificationsRequested(checkable, NotificationDowntimeEnd, checkable->GetLastCheckResult(), downtime->GetAuthor(), downtime->GetComment(), nullptr);
 }
 
 void Checkable::ValidateCheckInterval(double value, const ValidationUtils& utils)
index b2d118c31e816fb5cb4aff122039a3bd76cb8bdf..ca7b479baa50c0b35b34830c105350fcfa007e82 100644 (file)
@@ -98,8 +98,8 @@ public:
 
        AcknowledgementType GetAcknowledgement(void);
 
-       void AcknowledgeProblem(const String& author, const String& comment, AcknowledgementType type, bool notify = true, bool persistent = false, double expiry = 0, const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
-       void ClearAcknowledgement(const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+       void AcknowledgeProblem(const String& author, const String& comment, AcknowledgementType type, bool notify = true, bool persistent = false, double expiry = 0, const MessageOrigin::Ptr& origin = nullptr);
+       void ClearAcknowledgement(const MessageOrigin::Ptr& origin = nullptr);
 
        virtual int GetSeverity(void) const override;
 
@@ -110,7 +110,7 @@ public:
        long GetSchedulingOffset(void);
        void SetSchedulingOffset(long offset);
 
-       void UpdateNextCheck(const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+       void UpdateNextCheck(const MessageOrigin::Ptr& origin = nullptr);
 
        bool HasBeenChecked(void) const;
        virtual bool IsStateOK(ServiceState state) = 0;
@@ -121,9 +121,9 @@ public:
 
        static void UpdateStatistics(const CheckResult::Ptr& cr, CheckableType type);
 
-       void ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr());
+       void ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros = nullptr);
        void ExecuteCheck();
-       void ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+       void ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrigin::Ptr& origin = nullptr);
 
        Endpoint::Ptr GetCommandEndpoint(void) const;
 
@@ -174,7 +174,7 @@ public:
        void ResetNotificationNumbers(void);
 
        /* Event Handler */
-       void ExecuteEventHandler(const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+       void ExecuteEventHandler(const Dictionary::Ptr& resolvedMacros = nullptr,
            bool useResolvedMacros = false);
 
        intrusive_ptr<EventCommand> GetEventCommand(void) const;
index 9be3521ec514b0b09fc9f57fd0045cfa9b53c264..91d8445ef644cbb88dbb0df027a8869da8c2a3f9 100644 (file)
@@ -38,7 +38,7 @@ public:
        DECLARE_OBJECTNAME(CheckCommand);
 
        virtual void Execute(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr,
-           const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+           const Dictionary::Ptr& resolvedMacros = nullptr,
            bool useResolvedMacros = false);
 };
 
index 57b4691e1913090964cf9cc3c48fc35b6086d2c8..3262d881bd7ee69a76e2253e79d0fc263982a0aa 100644 (file)
@@ -704,7 +704,7 @@ void ClusterEvents::SendNotificationsHandler(const Checkable::Ptr& checkable, No
        params->Set("author", author);
        params->Set("text", text);
 
-       listener->RelayMessage(origin, ConfigObject::Ptr(), message, true);
+       listener->RelayMessage(origin, nullptr, message, true);
 }
 
 Value ClusterEvents::SendNotificationsAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
@@ -798,7 +798,7 @@ void ClusterEvents::NotificationSentUserHandler(const Notification::Ptr& notific
        message->Set("method", "event::NotificationSentUser");
        message->Set("params", params);
 
-       listener->RelayMessage(origin, ConfigObject::Ptr(), message, true);
+       listener->RelayMessage(origin, nullptr, message, true);
 }
 
 Value ClusterEvents::NotificationSentUserAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
@@ -914,7 +914,7 @@ void ClusterEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& n
        message->Set("method", "event::NotificationSentToAllUsers");
        message->Set("params", params);
 
-       listener->RelayMessage(origin, ConfigObject::Ptr(), message, true);
+       listener->RelayMessage(origin, nullptr, message, true);
 }
 
 Value ClusterEvents::NotificationSentToAllUsersAPIHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
index 84f862e21597ac06b8323b8a2ce2d31295b9fd16..3bc736f15a1ba12774557c568af54843f67cb6ff 100644 (file)
@@ -181,7 +181,7 @@ String Comment::AddComment(const Checkable::Ptr& checkable, CommentType entryTyp
        if (!zone.IsEmpty())
                attrs->Set("zone", zone);
 
-       String config = ConfigObjectUtility::CreateObjectConfig(Comment::TypeInstance, fullName, true, Array::Ptr(), attrs);
+       String config = ConfigObjectUtility::CreateObjectConfig(Comment::TypeInstance, fullName, true, nullptr, attrs);
 
        Array::Ptr errors = new Array();
 
index d2ccfa8488a519b423d08db8e02b150e3b540767..26f824cec21972dadacf280be325d1d5bd2691db 100644 (file)
@@ -50,9 +50,9 @@ public:
 
        static String AddComment(const intrusive_ptr<Checkable>& checkable, CommentType entryType,
            const String& author, const String& text, bool persistent, double expireTime,
-           const String& id = String(), const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+           const String& id = String(), const MessageOrigin::Ptr& origin = nullptr);
 
-       static void RemoveComment(const String& id, const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+       static void RemoveComment(const String& id, const MessageOrigin::Ptr& origin = nullptr);
 
        static String GetCommentIDFromLegacyID(int id);
 
index aaf3e39863b3e98a2bee179a901ae53d487a8306..093195bebf8fba0bde0f40a63c84581fe2515df6 100644 (file)
@@ -72,7 +72,7 @@ class Comment : ConfigObject < CommentNameComposer
                }}}
                navigate {{{
                        if (GetServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetHostName());
                        return host->GetServiceByShortName(GetServiceName());
index b66f4b7b6f01ffce82e121436b0354c67c4b52c5..80a6a85baf7cf2f2aecaf5124555ed39de515351 100644 (file)
@@ -368,7 +368,7 @@ Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const CustomVarObject::P
        Dictionary::Ptr vars = object->GetVars();
 
        if (!vars)
-               return Dictionary::Ptr();
+               return nullptr;
 
        return vars;
 }
index 79a17bfacaa224c2ce046624652ed1cb75ae1d5f..bb347a2c2c71b6149a8b7b84f236d049ff74c34f 100644 (file)
@@ -60,7 +60,7 @@ class Dependency : CustomVarObject < DependencyNameComposer
                }}}
                navigate {{{
                        if (GetChildServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetChildHostName());
                        return host->GetServiceByShortName(GetChildServiceName());
@@ -87,7 +87,7 @@ class Dependency : CustomVarObject < DependencyNameComposer
                }}}
                navigate {{{
                        if (GetParentServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetParentHostName());
                        return host->GetServiceByShortName(GetParentServiceName());
index bf8b6d214d3eb6aa1cb8056aabf8e1863f0b13c0..6a873d3f8d8414fde010467760bbc62e87b0659c 100644 (file)
@@ -255,7 +255,7 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth
        if (!zone.IsEmpty())
                attrs->Set("zone", zone);
 
-       String config = ConfigObjectUtility::CreateObjectConfig(Downtime::TypeInstance, fullName, true, Array::Ptr(), attrs);
+       String config = ConfigObjectUtility::CreateObjectConfig(Downtime::TypeInstance, fullName, true, nullptr, attrs);
 
        Array::Ptr errors = new Array();
 
index c5e0ef66e97b8e7015667ddd5605bb5733479e6a..46de4a4d1364d1ef05652f9ca7673e53bf38c2f8 100644 (file)
@@ -57,9 +57,9 @@ public:
            const String& comment, double startTime, double endTime, bool fixed,
            const String& triggeredBy, double duration, const String& scheduledDowntime = String(),
            const String& scheduledBy = String(), const String& id = String(),
-           const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+           const MessageOrigin::Ptr& origin = nullptr);
 
-       static void RemoveDowntime(const String& id, bool cancelled, bool expired = false, const MessageOrigin::Ptr& origin = MessageOrigin::Ptr());
+       static void RemoveDowntime(const String& id, bool cancelled, bool expired = false, const MessageOrigin::Ptr& origin = nullptr);
 
        void TriggerDowntime(void);
 
index a392ebb22328bb0be442fcef391a651fcf2ea4d4..1ce92cef71be28f4c672e2269cccddc57b63a16b 100644 (file)
@@ -59,7 +59,7 @@ class Downtime : ConfigObject < DowntimeNameComposer
                }}}
                navigate {{{
                        if (GetServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetHostName());
                        return host->GetServiceByShortName(GetServiceName());
index a0d327ecdd3ab6b6c18dbf085ad53513b06e16dc..b762fae462205755ae470492977b952d70616101 100644 (file)
@@ -38,7 +38,7 @@ public:
        DECLARE_OBJECTNAME(EventCommand);
 
        virtual void Execute(const Checkable::Ptr& checkable,
-           const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+           const Dictionary::Ptr& resolvedMacros = nullptr,
            bool useResolvedMacros = false);
 };
 
index d1c9f73e0400b2b0f2115f5ae09df07e1d303a39..84d6484583c804afebbb911fad7d3329bd60209d 100644 (file)
@@ -1358,7 +1358,7 @@ void ExternalCommandProcessor::SendCustomHostNotification(double, const std::vec
        }
 
        Checkable::OnNotificationsRequested(host, NotificationCustom,
-           host->GetLastCheckResult(), arguments[2], arguments[3], MessageOrigin::Ptr());
+           host->GetLastCheckResult(), arguments[2], arguments[3], nullptr);
 }
 
 void ExternalCommandProcessor::SendCustomSvcNotification(double, const std::vector<String>& arguments)
@@ -1378,7 +1378,7 @@ void ExternalCommandProcessor::SendCustomSvcNotification(double, const std::vect
        }
 
        Service::OnNotificationsRequested(service, NotificationCustom,
-           service->GetLastCheckResult(), arguments[3], arguments[4], MessageOrigin::Ptr());
+           service->GetLastCheckResult(), arguments[3], arguments[4], nullptr);
 }
 
 void ExternalCommandProcessor::DelayHostNotification(double, const std::vector<String>& arguments)
index c84eddae28ae1f050c43fe3672ba3d3ed2b6315a..f90a6038c7eddf51fa0f515e7894dc39cd67268c 100644 (file)
@@ -144,7 +144,7 @@ Service::Ptr Host::GetServiceByShortName(const Value& name)
                                return it->second;
                }
 
-               return Service::Ptr();
+               return nullptr;
        } else if (name.IsObjectType<Dictionary>()) {
                Dictionary::Ptr dict = name;
                String short_name;
index 6d89839ea69876d2bf99d3bbd38273d59518c00e..4a831901a2663498c2a390b5b573a3ed59e0ec90 100644 (file)
@@ -451,7 +451,7 @@ Dictionary::Ptr LegacyTimePeriod::FindNextSegment(const String& daydef, const St
                } while (tsiter < tsend);
        }
 
-       return Dictionary::Ptr();
+       return nullptr;
 }
 
 Array::Ptr LegacyTimePeriod::ScriptFunc(const TimePeriod::Ptr& tp, double begin, double end)
index 465667ed4e241793ca3c07604e2d476c315c8141..fb9f918f3be6cf343a3354611d207b087cb83ca8 100644 (file)
@@ -291,7 +291,7 @@ Value MacroProcessor::InternalResolveMacros(const String& str, const ResolverLis
                                for (const Value& value : arr) {
                                        if (value.IsScalar()) {
                                                resolved_arr->Add(InternalResolveMacros(value,
-                                                       resolvers, cr, missingMacro, EscapeCallback(), Dictionary::Ptr(),
+                                                       resolvers, cr, missingMacro, EscapeCallback(), nullptr,
                                                        false, recursionLevel + 1));
                                        } else
                                                resolved_arr->Add(value);
@@ -300,7 +300,7 @@ Value MacroProcessor::InternalResolveMacros(const String& str, const ResolverLis
                                resolved_macro = resolved_arr;
                        } else if (resolved_macro.IsString()) {
                                resolved_macro = InternalResolveMacros(resolved_macro,
-                                       resolvers, cr, missingMacro, EscapeCallback(), Dictionary::Ptr(),
+                                       resolvers, cr, missingMacro, EscapeCallback(), nullptr,
                                        false, recursionLevel + 1);
                        }
                }
index bd5e0dac8f3aac66eff62d9abab4e89763067e90..0adc5acbce375bf0b3dc4089ed9f8e58df5e060a 100644 (file)
@@ -41,9 +41,9 @@ public:
        typedef std::vector<ResolverSpec> ResolverList;
 
        static Value ResolveMacros(const Value& str, const ResolverList& resolvers,
-           const CheckResult::Ptr& cr = CheckResult::Ptr(), String *missingMacro = NULL,
+           const CheckResult::Ptr& cr = nullptr, String *missingMacro = NULL,
            const EscapeCallback& escapeFn = EscapeCallback(),
-           const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+           const Dictionary::Ptr& resolvedMacros = nullptr,
            bool useResolvedMacros = false, int recursionLevel = 0);
 
        static Value ResolveArguments(const Value& command, const Dictionary::Ptr& arguments,
index 1738bd35908738d7b03eb9eca98d2789b0f6e8bc..fccd2cb9f56eb2e5e6460faff07866f19c8246ae 100644 (file)
@@ -431,7 +431,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
                notifiedProblemUsers->Clear();
 
        /* used in db_ido for notification history */
-       Service::OnNotificationSentToAllUsers(this, checkable, allNotifiedUsers, type, cr, author, text, MessageOrigin::Ptr());
+       Service::OnNotificationSentToAllUsers(this, checkable, allNotifiedUsers, type, cr, author, text, nullptr);
 }
 
 bool Notification::CheckNotificationUserFilters(NotificationType type, const User::Ptr& user, bool force, bool reminder)
@@ -518,7 +518,7 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User::
                command->Execute(this, user, cr, type, author, text);
 
                /* required by compatlogger */
-               Service::OnNotificationSentToUser(this, GetCheckable(), user, type, cr, author, text, command->GetName(), MessageOrigin::Ptr());
+               Service::OnNotificationSentToUser(this, GetCheckable(), user, type, cr, author, text, command->GetName(), nullptr);
 
                Log(LogInformation, "Notification")
                    << "Completed sending '" << NotificationTypeToStringInternal(type)
index 442146ec5e2529ca08c41002e9f352e80245907c..d4a454aae7f103468bf89fd324a28c40f94f56a6 100644 (file)
@@ -79,7 +79,7 @@ class Notification : CustomVarObject < NotificationNameComposer
                }}}
                navigate {{{
                        if (GetServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetHostName());
                        return host->GetServiceByShortName(GetServiceName());
index c059aea3a98bf701fdac8aff3990187d37586dec..21cf6c3904f1beb29740702a7ca8d5bfc0862d23 100644 (file)
@@ -42,7 +42,7 @@ public:
        virtual Dictionary::Ptr Execute(const intrusive_ptr<Notification>& notification,
                const User::Ptr& user, const CheckResult::Ptr& cr, const NotificationType& type,
            const String& author, const String& comment,
-           const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+           const Dictionary::Ptr& resolvedMacros = nullptr,
            bool useResolvedMacros = false);
 };
 
index bde6cfd9ab1647833897828f12035ed86c6ad0a4..94332e09706f61d82667aca79163e2b0c2688748 100644 (file)
@@ -51,7 +51,7 @@ Service::Ptr ObjectUtils::GetService(const Value& host, const String& name)
                hostObj = Host::GetByName(host);
 
        if (!hostObj)
-               return Service::Ptr();
+               return nullptr;
 
        return hostObj->GetServiceByShortName(name);
 }
@@ -66,7 +66,7 @@ Array::Ptr ObjectUtils::GetServices(const Value& host)
                hostObj = Host::GetByName(host);
 
        if (!hostObj)
-               return Array::Ptr();
+               return nullptr;
 
        return Array::FromVector(hostObj->GetServices());
 }
index f949edd6c6cd5eaa79d6628400775ebeb8b3fca1..de71ed8614b6c318f0de180bd433c61e37be28af 100644 (file)
@@ -58,7 +58,7 @@ class ScheduledDowntime : CustomVarObject < ScheduledDowntimeNameComposer
                }}}
                navigate {{{
                        if (GetServiceName().IsEmpty())
-                               return Service::Ptr();
+                               return nullptr;
 
                        Host::Ptr host = Host::GetByName(GetHostName());
                        return host->GetServiceByShortName(GetServiceName());
index 4426b35d78571f40bc546a0ae23304409fa4f1bc..4b8f245ea681cfabb2d97525ea8a9be79e816953 100644 (file)
@@ -111,7 +111,7 @@ Service::Ptr Service::GetByNamePair(const String& hostName, const String& servic
                Host::Ptr host = Host::GetByName(hostName);
 
                if (!host)
-                       return Service::Ptr();
+                       return nullptr;
 
                return host->GetServiceByShortName(serviceName);
        } else {
@@ -274,6 +274,6 @@ std::pair<Host::Ptr, Service::Ptr> icinga::GetHostService(const Checkable::Ptr&
        if (service)
                return std::make_pair(service->GetHost(), service);
        else
-               return std::make_pair(static_pointer_cast<Host>(checkable), Service::Ptr());
+               return std::make_pair(static_pointer_cast<Host>(checkable), nullptr);
 }
 
index e98a1aa251f200ecdaa1fec6967051fe3d5c3d51..9b10b8152d5a577f8981c659cc6b15f9fa55e067 100644 (file)
@@ -211,7 +211,7 @@ Object::Ptr HostsTable::HostGroupAccessor(const Value& row, LivestatusGroupByTyp
        if (groupByType == LivestatusGroupByHostGroup)
                return groupByObject;
 
-       return Object::Ptr();
+       return nullptr;
 }
 
 Value HostsTable::NameAccessor(const Value& row)
@@ -328,7 +328,7 @@ Value HostsTable::NotesExpandedAccessor(const Value& row)
            { "icinga", IcingaApplication::GetInstance() }
        };
 
-       return MacroProcessor::ResolveMacros(host->GetNotes(), resolvers, CheckResult::Ptr());
+       return MacroProcessor::ResolveMacros(host->GetNotes(), resolvers);
 }
 
 Value HostsTable::NotesUrlAccessor(const Value& row)
index 6dbb52c9a9906ceff5b3bde083d86ae9df9c9499..71d7402db6be9b186e6ed86520ad115444cf9a69 100644 (file)
@@ -320,7 +320,7 @@ Filter::Ptr LivestatusQuery::ParseFilter(const String& params, unsigned long& fr
                tokens.push_back("");
 
        if (tokens.size() < 3)
-               return Filter::Ptr();
+               return nullptr;
 
        bool negate = false;
        String attr = tokens[0];
index 73cf8deaa26ba521d049c8482b0cd40ddfd7035b..938660957942889f8e672dd6e423e5ed55db212d 100644 (file)
@@ -117,7 +117,7 @@ Object::Ptr LogTable::HostAccessor(const Value& row, const Column::ObjectAccesso
        String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
 
        if (host_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        return Host::GetByName(host_name);
 }
@@ -128,7 +128,7 @@ Object::Ptr LogTable::ServiceAccessor(const Value& row, const Column::ObjectAcce
        String service_description = static_cast<Dictionary::Ptr>(row)->Get("service_description");
 
        if (service_description.IsEmpty() || host_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        return Service::GetByNamePair(host_name, service_description);
 }
@@ -138,7 +138,7 @@ Object::Ptr LogTable::ContactAccessor(const Value& row, const Column::ObjectAcce
        String contact_name = static_cast<Dictionary::Ptr>(row)->Get("contact_name");
 
        if (contact_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        return User::GetByName(contact_name);
 }
@@ -148,7 +148,7 @@ Object::Ptr LogTable::CommandAccessor(const Value& row, const Column::ObjectAcce
        String command_name = static_cast<Dictionary::Ptr>(row)->Get("command_name");
 
        if (command_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        CheckCommand::Ptr check_command = CheckCommand::GetByName(command_name);
        if (!check_command) {
@@ -156,7 +156,7 @@ Object::Ptr LogTable::CommandAccessor(const Value& row, const Column::ObjectAcce
                if (!event_command) {
                        NotificationCommand::Ptr notification_command = NotificationCommand::GetByName(command_name);
                        if (!notification_command)
-                               return Object::Ptr();
+                               return nullptr;
                        else
                                return notification_command;
                } else
index 76baa3bcaa451578865ce14ba19ae0780fd2bbbc..b58d4c6cef05e648698956ba40b47b584084b7d1 100644 (file)
@@ -206,7 +206,7 @@ Object::Ptr ServicesTable::HostAccessor(const Value& row, const Column::ObjectAc
        Service::Ptr svc = static_cast<Service::Ptr>(service);
 
        if (!svc)
-               return Object::Ptr();
+               return nullptr;
 
        return svc->GetHost();
 }
@@ -220,7 +220,7 @@ Object::Ptr ServicesTable::ServiceGroupAccessor(const Value& row, LivestatusGrou
        if (groupByType == LivestatusGroupByServiceGroup)
                return groupByObject;
 
-       return Object::Ptr();
+       return nullptr;
 }
 
 Object::Ptr ServicesTable::HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject)
@@ -232,7 +232,7 @@ Object::Ptr ServicesTable::HostGroupAccessor(const Value& row, LivestatusGroupBy
        if (groupByType == LivestatusGroupByHostGroup)
                return groupByObject;
 
-       return Object::Ptr();
+       return nullptr;
 }
 
 Value ServicesTable::ShortNameAccessor(const Value& row)
index b8728472a5fcc5b5e6371a0cbf95e99003274f4f..9964646903816b671228b0631c61ec0fcbd54e88 100644 (file)
@@ -281,7 +281,7 @@ Object::Ptr StateHistTable::HostAccessor(const Value& row, const Column::ObjectA
        String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
 
        if (host_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        return Host::GetByName(host_name);
 }
@@ -292,7 +292,7 @@ Object::Ptr StateHistTable::ServiceAccessor(const Value& row, const Column::Obje
        String service_description = static_cast<Dictionary::Ptr>(row)->Get("service_description");
 
        if (service_description.IsEmpty() || host_name.IsEmpty())
-               return Object::Ptr();
+               return nullptr;
 
        return Service::GetByNamePair(host_name, service_description);
 }
index 1e121ecb109d07c665286ffc9e83c48f7fd6b556..dcb532374124a1f08b676ab7da43108b3857397e 100644 (file)
@@ -84,7 +84,7 @@ Table::Ptr Table::GetByName(const String& name, const String& compat_log_path, c
        else if (name == "zones")
                return new ZonesTable();
 
-       return Table::Ptr();
+       return nullptr;
 }
 
 void Table::AddColumn(const String& name, const Column& column)
index f6dcba79e3a4658d02a6be10691bc6229908d003..4995a1f04f8860674ac981e118f8de84bf01f181 100644 (file)
@@ -69,7 +69,7 @@ bool ActionsHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& reques
                }
        } else {
                FilterUtility::CheckPermission(user, permission);
-               objs.push_back(ConfigObject::Ptr());
+               objs.push_back(nullptr);
        }
 
        Array::Ptr results = new Array();
index 8e91669f5399fbb6d12d9d01981a2296e2e879e7..124c5b9d1493af3c12dd0124631b3dca917b08d5 100644 (file)
@@ -322,7 +322,7 @@ void ApiClient::AutocompleteScript(const String& session, const String& command,
                req->AddHeader("Accept", "application/json");
                m_Connection->SubmitRequest(req, std::bind(AutocompleteScriptHttpCompletionCallback, _1, _2, callback));
        } catch (const std::exception& ex) {
-               callback(boost::current_exception(), Array::Ptr());
+               callback(boost::current_exception(), nullptr);
        }
 }
 
@@ -363,6 +363,6 @@ void ApiClient::AutocompleteScriptHttpCompletionCallback(HttpRequest& request,
 
                callback(boost::exception_ptr(), suggestions);
        } catch (const std::exception& ex) {
-               callback(boost::current_exception(), Array::Ptr());
+               callback(boost::current_exception(), nullptr);
        }
 }
index c2065d87afaf86cb2abbd4b0d85ba0392bf4cca2..39345904888d09261f1faa352c2f275c9995b398 100644 (file)
@@ -425,7 +425,7 @@ void ApiListener::SendRuntimeConfigObjects(const JsonRpcConnection::Ptr& aclient
                                continue;
 
                        /* send the config object to the connected client */
-                       UpdateConfigObject(object, MessageOrigin::Ptr(), aclient);
+                       UpdateConfigObject(object, nullptr, aclient);
                }
        }
 
index 6e964c921e8887eae6cd0a5825a4df3170a14d3d..0cf810868608b878532f31d750c20ad0b0a377e6 100644 (file)
@@ -279,7 +279,7 @@ Endpoint::Ptr ApiListener::GetMaster(void) const
        Zone::Ptr zone = Zone::GetLocalZone();
 
        if (!zone)
-               return Endpoint::Ptr();
+               return nullptr;
 
        std::vector<String> names;
 
@@ -568,10 +568,10 @@ void ApiListener::SyncClient(const JsonRpcConnection::Ptr& aclient, const Endpoi
                        Log(LogInformation, "ApiListener")
                            << "Requesting new certificate for this Icinga instance from endpoint '" << endpoint->GetName() << "'.";
 
-                       JsonRpcConnection::SendCertificateRequest(aclient, MessageOrigin::Ptr(), String());
+                       JsonRpcConnection::SendCertificateRequest(aclient, nullptr, String());
 
                        if (Utility::PathExists(ApiListener::GetCertificateRequestsDir()))
-                               Utility::Glob(ApiListener::GetCertificateRequestsDir() + "/*.json", std::bind(&JsonRpcConnection::SendCertificateRequest, aclient, MessageOrigin::Ptr(), _1), GlobFile);
+                               Utility::Glob(ApiListener::GetCertificateRequestsDir() + "/*.json", std::bind(&JsonRpcConnection::SendCertificateRequest, aclient, nullptr, _1), GlobFile);
                }
 
                /* Make sure that the config updates are synced
index d258b6488e85d6d83bd655aac70e12a35c957d77..052209319b96d2a74bc2dfecdc6c503a365ac514 100644 (file)
@@ -176,9 +176,9 @@ private:
 
        /* configsync */
        void UpdateConfigObject(const ConfigObject::Ptr& object, const MessageOrigin::Ptr& origin,
-           const JsonRpcConnection::Ptr& client = JsonRpcConnection::Ptr());
+           const JsonRpcConnection::Ptr& client = nullptr);
        void DeleteConfigObject(const ConfigObject::Ptr& object, const MessageOrigin::Ptr& origin,
-           const JsonRpcConnection::Ptr& client = JsonRpcConnection::Ptr());
+           const JsonRpcConnection::Ptr& client = nullptr);
        void SendRuntimeConfigObjects(const JsonRpcConnection::Ptr& aclient);
 
        void SyncClient(const JsonRpcConnection::Ptr& aclient, const Endpoint::Ptr& endpoint, bool needSync);
index fd4aec9a54378c63c02ec3988c8710d45f89232a..7c09898343ae67b08d3ca89d1f99bcea445b309b 100644 (file)
@@ -32,5 +32,5 @@ ApiUser::Ptr ApiUser::GetByClientCN(const String& cn)
                        return user;
        }
 
-       return ApiUser::Ptr();
+       return nullptr;
 }
index a06eb33f7d45f238eedb40f91731098491cd1b6b..3561bdf797d4a9f2c34d37a8221159e6634bbb87 100644 (file)
@@ -46,7 +46,7 @@ public:
        static std::vector<String> GetPackages(void);
        static bool PackageExists(const String& name);
 
-       static String CreateStage(const String& packageName, const Dictionary::Ptr& files = Dictionary::Ptr());
+       static String CreateStage(const String& packageName, const Dictionary::Ptr& files = nullptr);
        static void DeleteStage(const String& packageName, const String& stageName);
        static std::vector<String> GetStages(const String& packageName);
        static String GetActiveStage(const String& packageName);
index e922cd09c592915c5c84743309022a32acdc8082..38aeb4fc346e59d1d0dff82843687b02f9d82e05 100644 (file)
@@ -113,7 +113,7 @@ Endpoint::Ptr Endpoint::GetLocalEndpoint(void)
        ApiListener::Ptr listener = ApiListener::GetInstance();
 
        if (!listener)
-               return Endpoint::Ptr();
+               return nullptr;
 
        return listener->GetLocalEndpoint();
 }
index 77c1eec0ff11503d241c2379b3b55b80491f7c55..5681214a2b1909c8b459ae3689e040218f499c7c 100644 (file)
@@ -115,11 +115,10 @@ Dictionary::Ptr EventQueue::WaitForEvent(void *client, double timeout)
                }
 
                if (!m_CV.timed_wait(lock, boost::posix_time::milliseconds(timeout * 1000)))
-                       return Dictionary::Ptr();
+                       return nullptr;
        }
 }
 
-
 std::vector<EventQueue::Ptr> EventQueue::GetQueuesForType(const String& type)
 {
        EventQueueRegistry::ItemMap queues = EventQueueRegistry::GetInstance()->GetItems();
index 24881284b60dcab76c5c70b92d5182b8bc4ab01e..fbe0e0f2918bd235f5d8404e969551ad886a6de7 100644 (file)
@@ -33,7 +33,7 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
        String uname = pluralName;
        boost::algorithm::to_lower(uname);
 
-       for (const Type::Ptr&type : Type::GetAllTypes()) {
+       for (const Type::Ptr& type : Type::GetAllTypes()) {
                String pname = type->GetPluralName();
                boost::algorithm::to_lower(pname);
 
@@ -41,7 +41,7 @@ Type::Ptr FilterUtility::TypeFromPluralName(const String& pluralName)
                        return type;
        }
 
-       return Type::Ptr();
+       return nullptr;
 }
 
 void ConfigObjectTargetProvider::FindTargets(const String& type, const std::function<void (const Value&)>& addTarget) const
index 53e6f7af71c7829248f7182814b10d515b568025..43c8d0f27bfe7a418bcbaaf425909a078f13f575 100644 (file)
@@ -82,7 +82,7 @@ void HttpServerConnection::Disconnect(void)
        listener->RemoveHttpClient(this);
 
        m_CurrentRequest.~HttpRequest();
-       new (&m_CurrentRequest) HttpRequest(Stream::Ptr());
+       new (&m_CurrentRequest) HttpRequest(nullptr);
 
        m_Stream->Close();
 }
index 6f5a5214dd5370f4b1fff4237e46ada5cffeff8e..0d108105e1bfd24dd3144fb3e462477043975100 100644 (file)
@@ -215,7 +215,7 @@ delayed_request:
 
        Utility::SaveJsonFile(requestPath, 0600, request);
 
-       JsonRpcConnection::SendCertificateRequest(JsonRpcConnection::Ptr(), origin, requestPath);
+       JsonRpcConnection::SendCertificateRequest(nullptr, origin, requestPath);
 
        result->Set("status_code", 2);
        result->Set("error", "Certificate request for CN '" + cn + "' is pending. Waiting for approval from the parent Icinga instance.");
index d4660fd75a153f60b24e6d2c0c57aef1147a81ec..bb48d1f0e44c26a28f38d9aa11577bdb2fbd4740 100644 (file)
@@ -139,7 +139,7 @@ Zone::Ptr Zone::GetLocalZone(void)
        Endpoint::Ptr local = Endpoint::GetLocalEndpoint();
 
        if (!local)
-               return Zone::Ptr();
+               return nullptr;
 
        return local->GetZone();
 }