/******************************************************************************
* Icinga 2 *
- * Copyright (C) 2012-2015 Icinga Development Team (http://www.icinga.org) *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
#include "livestatus/contactgroupstable.hpp"
#include "icinga/usergroup.hpp"
-#include "base/dynamictype.hpp"
-#include <boost/foreach.hpp>
+#include "base/configtype.hpp"
using namespace icinga;
-ContactGroupsTable::ContactGroupsTable(void)
+ContactGroupsTable::ContactGroupsTable()
{
AddColumns(this);
}
void ContactGroupsTable::AddColumns(Table *table, const String& prefix,
- const Column::ObjectAccessor& objectAccessor)
+ const Column::ObjectAccessor& objectAccessor)
{
table->AddColumn(prefix + "name", Column(&ContactGroupsTable::NameAccessor, objectAccessor));
table->AddColumn(prefix + "alias", Column(&ContactGroupsTable::AliasAccessor, objectAccessor));
table->AddColumn(prefix + "members", Column(&ContactGroupsTable::MembersAccessor, objectAccessor));
}
-String ContactGroupsTable::GetName(void) const
+String ContactGroupsTable::GetName() const
{
return "contactgroups";
}
-String ContactGroupsTable::GetPrefix(void) const
+String ContactGroupsTable::GetPrefix() const
{
return "contactgroup";
}
void ContactGroupsTable::FetchRows(const AddRowFunction& addRowFn)
{
- BOOST_FOREACH(const UserGroup::Ptr& ug, DynamicType::GetObjectsByType<UserGroup>()) {
- addRowFn(ug, LivestatusGroupByNone, Empty);
+ for (const UserGroup::Ptr& ug : ConfigType::GetObjectsByType<UserGroup>()) {
+ if (!addRowFn(ug, LivestatusGroupByNone, Empty))
+ return;
}
}
Array::Ptr members = new Array();
- BOOST_FOREACH(const User::Ptr& user, user_group->GetMembers()) {
+ for (const User::Ptr& user : user_group->GetMembers()) {
members->Add(user->GetName());
}