ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
if (!ctype)
- return ConfigObject::Ptr();
+ return nullptr;
return ctype->GetObject(name);
}
auto nt = m_ObjectMap.find(name);
if (nt == m_ObjectMap.end())
- return ConfigObject::Ptr();
+ return nullptr;
return nt->second;
}
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);
Type::Ptr ObjectType::GetBaseType(void) const
{
- return Type::Ptr();
+ return nullptr;
}
int ObjectType::GetAttributes(void) const
Type::Ptr PrimitiveType::GetBaseType(void) const
{
if (m_Base == "None")
- return Type::Ptr();
+ return nullptr;
else
return Type::GetByName(m_Base);
}
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);
ConfigType *ctype = dynamic_cast<ConfigType *>(ptype.get());
if (!ctype)
- return ConfigObject::Ptr();
+ return nullptr;
return ctype->GetObject(name);
}
Type::Ptr type = input->GetReflectionType();
if (!type)
- return Object::Ptr();
+ return nullptr;
Dictionary::Ptr fields = new Dictionary();
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)
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;
}
case ValueObject:
return boost::get<Object::Ptr>(m_Value)->GetReflectionType();
default:
- return Type::Ptr();
+ return nullptr;
}
}
inline Value(void)
{ }
+ inline Value(std::nullptr_t)
+ { }
+
inline Value(int value)
: m_Value(double(value))
{ }
auto it = GetRegistry().find(name);
if (it == GetRegistry().end())
- return CLICommand::Ptr();
+ return nullptr;
return it->second;
}
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;
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>()));
m_IgnoredItems.push_back(m_DebugInfo.Path);
}
- return ConfigObject::Ptr();
+ return nullptr;
}
throw;
m_IgnoredItems.push_back(m_DebugInfo.Path);
}
- return ConfigObject::Ptr();
+ return nullptr;
}
ex.SetDebugHint(dhint);
m_IgnoredItems.push_back(m_DebugInfo.Path);
}
- return ConfigObject::Ptr();
+ return nullptr;
}
throw;
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;
}
struct DebugHint
{
public:
- DebugHint(const Dictionary::Ptr& hints = Dictionary::Ptr())
+ DebugHint(const Dictionary::Ptr& hints = nullptr)
: m_Hints(hints)
{ }
NameComposer *nc = dynamic_cast<NameComposer *>(type.get());
if (nc)
- checkName = nc->MakeName(name, Dictionary::Ptr());
+ checkName = nc->MakeName(name, nullptr);
}
if (!checkName.IsEmpty()) {
Dictionary::Ptr CommandDbObject::GetStatusFields(void) const
{
- return Dictionary::Ptr();
+ return nullptr;
}
DbType::Ptr dbtype = DbType::GetByName(object->GetReflectionType()->GetName());
if (!dbtype)
- return DbObject::Ptr();
+ return nullptr;
Service::Ptr service;
String name1, name2;
auto it = GetTypes().find(typeName);
if (it == GetTypes().end())
- return DbType::Ptr();
+ return nullptr;
return it->second;
}
return kv.second;
}
- return DbType::Ptr();
+ return nullptr;
}
DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String& name2)
Dictionary::Ptr HostGroupDbObject::GetStatusFields(void) const
{
- return Dictionary::Ptr();
+ return nullptr;
}
Dictionary::Ptr ServiceGroupDbObject::GetStatusFields(void) const
{
- return Dictionary::Ptr();
+ return nullptr;
}
Dictionary::Ptr UserGroupDbObject::GetStatusFields(void) const
{
- return Dictionary::Ptr();
+ return nullptr;
}
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();
AssertOnWorkQueue();
if (row >= PQntuples(result.get()))
- return Dictionary::Ptr();
+ return nullptr;
int columns = PQnfields(result.get());
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");
}
}
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() + "'.");
}
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);
};
}
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 "
} 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 "
if (send_notification && !is_flapping) {
if (!IsPaused())
- OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr());
+ OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", nullptr);
}
}
if (host && host->GetState() != HostUp && host->GetStateType() == StateTypeHard) {
if (failedDependency)
- *failedDependency = Dependency::Ptr();
+ *failedDependency = nullptr;
return false;
}
}
if (failedDependency)
- *failedDependency = Dependency::Ptr();
+ *failedDependency = nullptr;
return true;
}
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);
}
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)
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)
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;
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;
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;
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;
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);
};
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)
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)
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)
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();
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);
}}}
navigate {{{
if (GetServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
Dictionary::Ptr vars = object->GetVars();
if (!vars)
- return Dictionary::Ptr();
+ return nullptr;
return vars;
}
}}}
navigate {{{
if (GetChildServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetChildHostName());
return host->GetServiceByShortName(GetChildServiceName());
}}}
navigate {{{
if (GetParentServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetParentHostName());
return host->GetServiceByShortName(GetParentServiceName());
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();
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);
}}}
navigate {{{
if (GetServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
DECLARE_OBJECTNAME(EventCommand);
virtual void Execute(const Checkable::Ptr& checkable,
- const Dictionary::Ptr& resolvedMacros = Dictionary::Ptr(),
+ const Dictionary::Ptr& resolvedMacros = nullptr,
bool useResolvedMacros = false);
};
}
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)
}
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)
return it->second;
}
- return Service::Ptr();
+ return nullptr;
} else if (name.IsObjectType<Dictionary>()) {
Dictionary::Ptr dict = name;
String short_name;
} while (tsiter < tsend);
}
- return Dictionary::Ptr();
+ return nullptr;
}
Array::Ptr LegacyTimePeriod::ScriptFunc(const TimePeriod::Ptr& tp, double begin, double end)
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);
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);
}
}
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,
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)
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)
}}}
navigate {{{
if (GetServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
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);
};
hostObj = Host::GetByName(host);
if (!hostObj)
- return Service::Ptr();
+ return nullptr;
return hostObj->GetServiceByShortName(name);
}
hostObj = Host::GetByName(host);
if (!hostObj)
- return Array::Ptr();
+ return nullptr;
return Array::FromVector(hostObj->GetServices());
}
}}}
navigate {{{
if (GetServiceName().IsEmpty())
- return Service::Ptr();
+ return nullptr;
Host::Ptr host = Host::GetByName(GetHostName());
return host->GetServiceByShortName(GetServiceName());
Host::Ptr host = Host::GetByName(hostName);
if (!host)
- return Service::Ptr();
+ return nullptr;
return host->GetServiceByShortName(serviceName);
} else {
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);
}
if (groupByType == LivestatusGroupByHostGroup)
return groupByObject;
- return Object::Ptr();
+ return nullptr;
}
Value HostsTable::NameAccessor(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)
tokens.push_back("");
if (tokens.size() < 3)
- return Filter::Ptr();
+ return nullptr;
bool negate = false;
String attr = tokens[0];
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);
}
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);
}
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);
}
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) {
if (!event_command) {
NotificationCommand::Ptr notification_command = NotificationCommand::GetByName(command_name);
if (!notification_command)
- return Object::Ptr();
+ return nullptr;
else
return notification_command;
} else
Service::Ptr svc = static_cast<Service::Ptr>(service);
if (!svc)
- return Object::Ptr();
+ return nullptr;
return svc->GetHost();
}
if (groupByType == LivestatusGroupByServiceGroup)
return groupByObject;
- return Object::Ptr();
+ return nullptr;
}
Object::Ptr ServicesTable::HostGroupAccessor(const Value& row, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject)
if (groupByType == LivestatusGroupByHostGroup)
return groupByObject;
- return Object::Ptr();
+ return nullptr;
}
Value ServicesTable::ShortNameAccessor(const Value& row)
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);
}
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);
}
else if (name == "zones")
return new ZonesTable();
- return Table::Ptr();
+ return nullptr;
}
void Table::AddColumn(const String& name, const Column& column)
}
} else {
FilterUtility::CheckPermission(user, permission);
- objs.push_back(ConfigObject::Ptr());
+ objs.push_back(nullptr);
}
Array::Ptr results = new Array();
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);
}
}
callback(boost::exception_ptr(), suggestions);
} catch (const std::exception& ex) {
- callback(boost::current_exception(), Array::Ptr());
+ callback(boost::current_exception(), nullptr);
}
}
continue;
/* send the config object to the connected client */
- UpdateConfigObject(object, MessageOrigin::Ptr(), aclient);
+ UpdateConfigObject(object, nullptr, aclient);
}
}
Zone::Ptr zone = Zone::GetLocalZone();
if (!zone)
- return Endpoint::Ptr();
+ return nullptr;
std::vector<String> names;
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
/* 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);
return user;
}
- return ApiUser::Ptr();
+ return nullptr;
}
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);
ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener)
- return Endpoint::Ptr();
+ return nullptr;
return listener->GetLocalEndpoint();
}
}
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();
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);
return type;
}
- return Type::Ptr();
+ return nullptr;
}
void ConfigObjectTargetProvider::FindTargets(const String& type, const std::function<void (const Value&)>& addTarget) const
listener->RemoveHttpClient(this);
m_CurrentRequest.~HttpRequest();
- new (&m_CurrentRequest) HttpRequest(Stream::Ptr());
+ new (&m_CurrentRequest) HttpRequest(nullptr);
m_Stream->Close();
}
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.");
Endpoint::Ptr local = Endpoint::GetLocalEndpoint();
if (!local)
- return Zone::Ptr();
+ return nullptr;
return local->GetZone();
}