Apply clang-tidy fix 'modernize-pass-by-value'

This commit is contained in:
Gunnar Beutner 2018-01-04 08:54:18 +01:00
parent 6da7d48d25
commit 621eed3f13
101 changed files with 220 additions and 244 deletions

View File

@ -86,23 +86,11 @@ void Array::Set(SizeType index, Value&& value)
* *
* @param value The value. * @param value The value.
*/ */
void Array::Add(const Value& value) void Array::Add(Value value)
{ {
ObjectLock olock(this); ObjectLock olock(this);
m_Data.push_back(value); m_Data.push_back(std::move(value));
}
/**
* Adds a value to the array.
*
* @param value The value.
*/
void Array::Add(Value&& value)
{
ObjectLock olock(this);
m_Data.emplace_back(std::move(value));
} }
/** /**
@ -164,13 +152,13 @@ bool Array::Contains(const Value& value) const
* @param index The index * @param index The index
* @param value The value to add * @param value The value to add
*/ */
void Array::Insert(SizeType index, const Value& value) void Array::Insert(SizeType index, Value value)
{ {
ObjectLock olock(this); ObjectLock olock(this);
ASSERT(index <= m_Data.size()); ASSERT(index <= m_Data.size());
m_Data.insert(m_Data.begin() + index, value); m_Data.insert(m_Data.begin() + index, std::move(value));
} }
/** /**
@ -314,12 +302,12 @@ void Array::SetFieldByName(const String& field, const Value& value, const DebugI
Set(index, value); Set(index, value);
} }
Array::Iterator icinga::begin(Array::Ptr x) Array::Iterator icinga::begin(const Array::Ptr& x)
{ {
return x->Begin(); return x->Begin();
} }
Array::Iterator icinga::end(Array::Ptr x) Array::Iterator icinga::end(const Array::Ptr& x)
{ {
return x->End(); return x->End();
} }

View File

@ -55,8 +55,7 @@ public:
Value Get(SizeType index) const; Value Get(SizeType index) const;
void Set(SizeType index, const Value& value); void Set(SizeType index, const Value& value);
void Set(SizeType index, Value&& value); void Set(SizeType index, Value&& value);
void Add(const Value& value); void Add(Value value);
void Add(Value&& value);
Iterator Begin(); Iterator Begin();
Iterator End(); Iterator End();
@ -64,7 +63,7 @@ public:
size_t GetLength() const; size_t GetLength() const;
bool Contains(const Value& value) const; bool Contains(const Value& value) const;
void Insert(SizeType index, const Value& value); void Insert(SizeType index, Value value);
void Remove(SizeType index); void Remove(SizeType index);
void Remove(Iterator it); void Remove(Iterator it);
@ -118,8 +117,8 @@ private:
std::vector<Value> m_Data; /**< The data for the array. */ std::vector<Value> m_Data; /**< The data for the array. */
}; };
Array::Iterator begin(Array::Ptr x); Array::Iterator begin(const Array::Ptr& x);
Array::Iterator end(Array::Ptr x); Array::Iterator end(const Array::Ptr& x);
} }

View File

@ -54,7 +54,8 @@ public:
{ {
std::vector<intrusive_ptr<ConfigObject> > objects = GetObjectsHelper(T::TypeInstance.get()); std::vector<intrusive_ptr<ConfigObject> > objects = GetObjectsHelper(T::TypeInstance.get());
std::vector<intrusive_ptr<T> > result; std::vector<intrusive_ptr<T> > result;
for (const auto& object : objects) { result.reserve(objects.size());
for (const auto& object : objects) {
result.push_back(static_pointer_cast<T>(object)); result.push_back(static_pointer_cast<T>(object));
} }
return result; return result;

View File

@ -269,8 +269,8 @@ const std::vector<String>& ConfigWriter::GetKeywords()
return keywords; return keywords;
} }
ConfigIdentifier::ConfigIdentifier(const String& identifier) ConfigIdentifier::ConfigIdentifier(String identifier)
: m_Name(identifier) : m_Name(std::move(identifier))
{ } { }
String ConfigIdentifier::GetName() const String ConfigIdentifier::GetName() const

View File

@ -38,7 +38,7 @@ class ConfigIdentifier final : public Object
public: public:
DECLARE_PTR_TYPEDEFS(ConfigIdentifier); DECLARE_PTR_TYPEDEFS(ConfigIdentifier);
ConfigIdentifier(const String& name); ConfigIdentifier(String name);
String GetName() const; String GetName() const;

View File

@ -79,20 +79,7 @@ bool Dictionary::Get(const String& key, Value *result) const
* @param key The key. * @param key The key.
* @param value The value. * @param value The value.
*/ */
void Dictionary::Set(const String& key, const Value& value) void Dictionary::Set(const String& key, Value value)
{
ObjectLock olock(this);
m_Data[key] = value;
}
/**
* Sets a value in the dictionary.
*
* @param key The key.
* @param value The value.
*/
void Dictionary::Set(const String& key, Value&& value)
{ {
ObjectLock olock(this); ObjectLock olock(this);
@ -282,12 +269,12 @@ bool Dictionary::GetOwnField(const String& field, Value *result) const
return Get(field, result); return Get(field, result);
} }
Dictionary::Iterator icinga::begin(Dictionary::Ptr x) Dictionary::Iterator icinga::begin(const Dictionary::Ptr& x)
{ {
return x->Begin(); return x->Begin();
} }
Dictionary::Iterator icinga::end(Dictionary::Ptr x) Dictionary::Iterator icinga::end(const Dictionary::Ptr& x)
{ {
return x->End(); return x->End();
} }

View File

@ -55,8 +55,7 @@ public:
Value Get(const String& key) const; Value Get(const String& key) const;
bool Get(const String& key, Value *result) const; bool Get(const String& key, Value *result) const;
void Set(const String& key, const Value& value); void Set(const String& key, Value value);
void Set(const String& key, Value&& value);
bool Contains(const String& key) const; bool Contains(const String& key) const;
Iterator Begin(); Iterator Begin();
@ -90,8 +89,8 @@ private:
std::map<String, Value> m_Data; /**< The data for the dictionary. */ std::map<String, Value> m_Data; /**< The data for the dictionary. */
}; };
Dictionary::Iterator begin(Dictionary::Ptr x); Dictionary::Iterator begin(const Dictionary::Ptr& x);
Dictionary::Iterator end(Dictionary::Ptr x); Dictionary::Iterator end(const Dictionary::Ptr& x);
} }

View File

@ -260,7 +260,7 @@ String icinga::DiagnosticInformation(const std::exception& ex, bool verbose, Sta
return result.str(); return result.str();
} }
String icinga::DiagnosticInformation(boost::exception_ptr eptr, bool verbose) String icinga::DiagnosticInformation(const boost::exception_ptr& eptr, bool verbose)
{ {
StackTrace *pt = GetLastExceptionStack(); StackTrace *pt = GetLastExceptionStack();
StackTrace stack; StackTrace stack;
@ -283,12 +283,12 @@ String icinga::DiagnosticInformation(boost::exception_ptr eptr, bool verbose)
return boost::diagnostic_information(eptr); return boost::diagnostic_information(eptr);
} }
ScriptError::ScriptError(const String& message) ScriptError::ScriptError(String message)
: m_Message(message), m_IncompleteExpr(false) : m_Message(std::move(message)), m_IncompleteExpr(false)
{ } { }
ScriptError::ScriptError(const String& message, const DebugInfo& di, bool incompleteExpr) ScriptError::ScriptError(String message, DebugInfo di, bool incompleteExpr)
: m_Message(message), m_DebugInfo(di), m_IncompleteExpr(incompleteExpr), m_HandledByDebugger(false) : m_Message(std::move(message)), m_DebugInfo(std::move(di)), m_IncompleteExpr(incompleteExpr), m_HandledByDebugger(false)
{ } { }
ScriptError::~ScriptError() throw() ScriptError::~ScriptError() throw()

View File

@ -51,8 +51,8 @@ class user_error : virtual public std::exception, virtual public boost::exceptio
class ScriptError : virtual public user_error class ScriptError : virtual public user_error
{ {
public: public:
ScriptError(const String& message); ScriptError(String message);
ScriptError(const String& message, const DebugInfo& di, bool incompleteExpr = false); ScriptError(String message, DebugInfo di, bool incompleteExpr = false);
~ScriptError() throw() override; ~ScriptError() throw() override;
const char *what(void) const throw() final; const char *what(void) const throw() final;
@ -121,7 +121,7 @@ inline std::string to_string(const ContextTraceErrorInfo& e)
} }
String DiagnosticInformation(const std::exception& ex, bool verbose = true, StackTrace *stack = nullptr, ContextTrace *context = nullptr); String DiagnosticInformation(const std::exception& ex, bool verbose = true, StackTrace *stack = nullptr, ContextTrace *context = nullptr);
String DiagnosticInformation(boost::exception_ptr eptr, bool verbose = true); String DiagnosticInformation(const boost::exception_ptr& eptr, bool verbose = true);
class posix_error : virtual public std::exception, virtual public boost::exception { class posix_error : virtual public std::exception, virtual public boost::exception {
public: public:

View File

@ -26,9 +26,9 @@ using namespace icinga;
REGISTER_TYPE_WITH_PROTOTYPE(Function, Function::GetPrototype()); REGISTER_TYPE_WITH_PROTOTYPE(Function, Function::GetPrototype());
Function::Function(const String& name, const Callback& function, const std::vector<String>& args, Function::Function(const String& name, Callback function, const std::vector<String>& args,
bool side_effect_free, bool deprecated) bool side_effect_free, bool deprecated)
: m_Callback(function) : m_Callback(std::move(function))
{ {
SetName(name, true); SetName(name, true);
SetSideEffectFree(side_effect_free, true); SetSideEffectFree(side_effect_free, true);

View File

@ -68,7 +68,7 @@ public:
private: private:
Callback m_Callback; Callback m_Callback;
Function(const String& name, const Callback& function, const std::vector<String>& args, Function(const String& name, Callback function, const std::vector<String>& args,
bool side_effect_free, bool deprecated); bool side_effect_free, bool deprecated);
}; };

View File

@ -31,8 +31,8 @@ namespace icinga
struct DeferredInitializer struct DeferredInitializer
{ {
public: public:
DeferredInitializer(const std::function<void ()>& callback, int priority) DeferredInitializer(std::function<void ()> callback, int priority)
: m_Callback(callback), m_Priority(priority) : m_Callback(std::move(callback)), m_Priority(priority)
{ } { }
bool operator<(const DeferredInitializer& other) const bool operator<(const DeferredInitializer& other) const

View File

@ -194,14 +194,14 @@ void Logger::ValidateSeverity(const String& value, const ValidationUtils& utils)
} }
} }
Log::Log(LogSeverity severity, const String& facility, const String& message) Log::Log(LogSeverity severity, String facility, const String& message)
: m_Severity(severity), m_Facility(facility) : m_Severity(severity), m_Facility(std::move(facility))
{ {
m_Buffer << message; m_Buffer << message;
} }
Log::Log(LogSeverity severity, const String& facility) Log::Log(LogSeverity severity, String facility)
: m_Severity(severity), m_Facility(facility) : m_Severity(severity), m_Facility(std::move(facility))
{ } { }
/** /**

View File

@ -111,8 +111,8 @@ public:
Log(const Log& other) = delete; Log(const Log& other) = delete;
Log& operator=(const Log& rhs) = delete; Log& operator=(const Log& rhs) = delete;
Log(LogSeverity severity, const String& facility, const String& message); Log(LogSeverity severity, String facility, const String& message);
Log(LogSeverity severity, const String& facility); Log(LogSeverity severity, String facility);
~Log(); ~Log();

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
NetworkStream::NetworkStream(const Socket::Ptr& socket) NetworkStream::NetworkStream(Socket::Ptr socket)
: m_Socket(socket), m_Eof(false) : m_Socket(std::move(socket)), m_Eof(false)
{ } { }
void NetworkStream::Close() void NetworkStream::Close()

View File

@ -37,7 +37,7 @@ class NetworkStream final : public Stream
public: public:
DECLARE_PTR_TYPEDEFS(NetworkStream); DECLARE_PTR_TYPEDEFS(NetworkStream);
NetworkStream(const Socket::Ptr& socket); NetworkStream(Socket::Ptr socket);
size_t Read(void *buffer, size_t count, bool allow_partial = false) override; size_t Read(void *buffer, size_t count, bool allow_partial = false) override;
void Write(const void *buffer, size_t count) override; void Write(const void *buffer, size_t count) override;

View File

@ -35,7 +35,7 @@ REGISTER_SCRIPTFUNCTION_NS(System, parse_performance_data, PerfdataValue::Parse,
PerfdataValue::PerfdataValue() PerfdataValue::PerfdataValue()
{ } { }
PerfdataValue::PerfdataValue(String label, double value, bool counter, PerfdataValue::PerfdataValue(const String& label, double value, bool counter,
const String& unit, const Value& warn, const Value& crit, const Value& min, const String& unit, const Value& warn, const Value& crit, const Value& min,
const Value& max) const Value& max)
{ {

View File

@ -38,7 +38,7 @@ public:
PerfdataValue(); PerfdataValue();
PerfdataValue(String label, double value, bool counter = false, const String& unit = "", PerfdataValue(const String& label, double value, bool counter = false, const String& unit = "",
const Value& warn = Empty, const Value& crit = Empty, const Value& warn = Empty, const Value& crit = Empty,
const Value& min = Empty, const Value& max = Empty); const Value& min = Empty, const Value& max = Empty);

View File

@ -22,8 +22,8 @@
using namespace icinga; using namespace icinga;
PrimitiveType::PrimitiveType(const String& name, const String& base, const ObjectFactory& factory) PrimitiveType::PrimitiveType(String name, String base, const ObjectFactory& factory)
: m_Name(name), m_Base(base), m_Factory(factory) : m_Name(std::move(name)), m_Base(std::move(base)), m_Factory(factory)
{ } { }
String PrimitiveType::GetName() const String PrimitiveType::GetName() const

View File

@ -30,7 +30,7 @@ namespace icinga
class PrimitiveType final : public Type class PrimitiveType final : public Type
{ {
public: public:
PrimitiveType(const String& name, const String& base, const ObjectFactory& factory = ObjectFactory()); PrimitiveType(String name, String base, const ObjectFactory& factory = ObjectFactory());
String GetName() const override; String GetName() const override;
Type::Ptr GetBaseType() const override; Type::Ptr GetBaseType() const override;

View File

@ -65,8 +65,8 @@ static pid_t l_ProcessControlPID;
static boost::once_flag l_ProcessOnceFlag = BOOST_ONCE_INIT; static boost::once_flag l_ProcessOnceFlag = BOOST_ONCE_INIT;
static boost::once_flag l_SpawnHelperOnceFlag = BOOST_ONCE_INIT; static boost::once_flag l_SpawnHelperOnceFlag = BOOST_ONCE_INIT;
Process::Process(const Process::Arguments& arguments, const Dictionary::Ptr& extraEnvironment) Process::Process(Process::Arguments arguments, Dictionary::Ptr extraEnvironment)
: m_Arguments(arguments), m_ExtraEnvironment(extraEnvironment), m_Timeout(600), m_AdjustPriority(false) : m_Arguments(std::move(arguments)), m_ExtraEnvironment(std::move(extraEnvironment)), m_Timeout(600), m_AdjustPriority(false)
#ifdef _WIN32 #ifdef _WIN32
, m_ReadPending(false), m_ReadFailed(false), m_Overlapped() , m_ReadPending(false), m_ReadFailed(false), m_Overlapped()
#endif /* _WIN32 */ #endif /* _WIN32 */

View File

@ -66,7 +66,7 @@ public:
static const std::deque<Process::Ptr>::size_type MaxTasksPerThread = 512; static const std::deque<Process::Ptr>::size_type MaxTasksPerThread = 512;
Process(const Arguments& arguments, const Dictionary::Ptr& extraEnvironment = nullptr); Process(Arguments arguments, Dictionary::Ptr extraEnvironment = nullptr);
~Process() override; ~Process() override;
void SetTimeout(double timeout); void SetTimeout(double timeout);

View File

@ -46,8 +46,8 @@ ScriptFrame::ScriptFrame(bool allocLocals)
InitializeFrame(); InitializeFrame();
} }
ScriptFrame::ScriptFrame(bool allocLocals, const Value& self) ScriptFrame::ScriptFrame(bool allocLocals, Value self)
: Locals(allocLocals ? new Dictionary() : nullptr), Self(self), Sandboxed(false), Depth(0) : Locals(allocLocals ? new Dictionary() : nullptr), Self(std::move(self)), Sandboxed(false), Depth(0)
{ {
InitializeFrame(); InitializeFrame();
} }

View File

@ -37,7 +37,7 @@ struct ScriptFrame
int Depth; int Depth;
ScriptFrame(bool allocLocals); ScriptFrame(bool allocLocals);
ScriptFrame(bool allocLocals, const Value& self); ScriptFrame(bool allocLocals, Value self);
~ScriptFrame(); ~ScriptFrame();
void IncreaseStackDepth(); void IncreaseStackDepth();

View File

@ -39,11 +39,7 @@ String::String(const char *data)
: m_Data(data) : m_Data(data)
{ } { }
String::String(const std::string& data) String::String(std::string data)
: m_Data(data)
{ }
String::String(std::string&& data)
: m_Data(std::move(data)) : m_Data(std::move(data))
{ } { }

View File

@ -60,8 +60,7 @@ public:
String(); String();
String(const char *data); String(const char *data);
String(const std::string& data); String(std::string data);
String(std::string&& data);
String(String::SizeType n, char c); String(String::SizeType n, char c);
String(const String& other); String(const String& other);
String(String&& other); String(String&& other);

View File

@ -502,7 +502,7 @@ incomplete:
} }
void ConsoleCommand::ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv, void ConsoleCommand::ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv,
bool& ready, boost::exception_ptr eptr, const Value& result, Value& resultOut, boost::exception_ptr& eptrOut) bool& ready, const boost::exception_ptr& eptr, const Value& result, Value& resultOut, boost::exception_ptr& eptrOut)
{ {
if (eptr) { if (eptr) {
try { try {
@ -526,7 +526,7 @@ void ConsoleCommand::ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::
} }
void ConsoleCommand::AutocompleteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv, void ConsoleCommand::AutocompleteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv,
bool& ready, boost::exception_ptr eptr, const Array::Ptr& result, Array::Ptr& resultOut) bool& ready, const boost::exception_ptr& eptr, const Array::Ptr& result, Array::Ptr& resultOut)
{ {
if (eptr) { if (eptr) {
try { try {

View File

@ -55,10 +55,10 @@ private:
mutable boost::condition_variable m_CV; mutable boost::condition_variable m_CV;
static void ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv, static void ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv,
bool& ready, boost::exception_ptr eptr, const Value& result, Value& resultOut, bool& ready, const boost::exception_ptr& eptr, const Value& result, Value& resultOut,
boost::exception_ptr& eptrOut); boost::exception_ptr& eptrOut);
static void AutocompleteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv, static void AutocompleteScriptCompletionHandler(boost::mutex& mutex, boost::condition_variable& cv,
bool& ready, boost::exception_ptr eptr, const Array::Ptr& result, Array::Ptr& resultOut); bool& ready, const boost::exception_ptr& eptr, const Array::Ptr& result, Array::Ptr& resultOut);
#ifdef HAVE_EDITLINE #ifdef HAVE_EDITLINE
static char *ConsoleCompleteHelper(const char *word, int state); static char *ConsoleCompleteHelper(const char *word, int state);

View File

@ -324,9 +324,9 @@ bool TroubleshootCommand::CheckFeatures(InfoLog& log)
return false; return false;
} }
for (const String feature : disabled_features) for (const String& feature : disabled_features)
features->Set(feature, false); features->Set(feature, false);
for (const String feature : enabled_features) for (const String& feature : enabled_features)
features->Set(feature, true); features->Set(feature, true);
InfoLogLine(log) InfoLogLine(log)

View File

@ -57,8 +57,8 @@ ActivationContext::Ptr ActivationContext::GetCurrentContext()
return astack.top(); return astack.top();
} }
ActivationScope::ActivationScope(const ActivationContext::Ptr& context) ActivationScope::ActivationScope(ActivationContext::Ptr context)
: m_Context(context) : m_Context(std::move(context))
{ {
if (!m_Context) if (!m_Context)
m_Context = new ActivationContext(); m_Context = new ActivationContext();

View File

@ -49,7 +49,7 @@ private:
class ActivationScope class ActivationScope
{ {
public: public:
ActivationScope(const ActivationContext::Ptr& context = nullptr); ActivationScope(ActivationContext::Ptr context = nullptr);
~ActivationScope(); ~ActivationScope();
ActivationContext::Ptr GetContext() const; ActivationContext::Ptr GetContext() const;

View File

@ -26,11 +26,11 @@ using namespace icinga;
ApplyRule::RuleMap ApplyRule::m_Rules; ApplyRule::RuleMap ApplyRule::m_Rules;
ApplyRule::TypeMap ApplyRule::m_Types; ApplyRule::TypeMap ApplyRule::m_Types;
ApplyRule::ApplyRule(const String& targetType, const String& name, const std::shared_ptr<Expression>& expression, ApplyRule::ApplyRule(String targetType, String name, std::shared_ptr<Expression> expression,
const std::shared_ptr<Expression>& filter, const String& package, const String& fkvar, const String& fvvar, const std::shared_ptr<Expression>& fterm, std::shared_ptr<Expression> filter, String package, String fkvar, String fvvar, std::shared_ptr<Expression> fterm,
bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope) bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope)
: m_TargetType(targetType), m_Name(name), m_Expression(expression), m_Filter(filter), m_Package(package), m_FKVar(fkvar), : m_TargetType(std::move(targetType)), m_Name(std::move(name)), m_Expression(std::move(expression)), m_Filter(std::move(filter)), m_Package(std::move(package)), m_FKVar(std::move(fkvar)),
m_FVVar(fvvar), m_FTerm(fterm), m_IgnoreOnError(ignoreOnError), m_DebugInfo(di), m_Scope(scope), m_HasMatches(false) m_FVVar(std::move(fvvar)), m_FTerm(std::move(fterm)), m_IgnoreOnError(ignoreOnError), m_DebugInfo(std::move(di)), m_Scope(std::move(scope)), m_HasMatches(false)
{ } { }
String ApplyRule::GetTargetType() const String ApplyRule::GetTargetType() const

View File

@ -81,9 +81,9 @@ private:
static TypeMap m_Types; static TypeMap m_Types;
static RuleMap m_Rules; static RuleMap m_Rules;
ApplyRule(const String& targetType, const String& name, const std::shared_ptr<Expression>& expression, ApplyRule(String targetType, String name, std::shared_ptr<Expression> expression,
const std::shared_ptr<Expression>& filter, const String& package, const String& fkvar, const String& fvvar, const std::shared_ptr<Expression>& fterm, std::shared_ptr<Expression> filter, String package, String fkvar, String fvvar, std::shared_ptr<Expression> fterm,
bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope); bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope);
}; };
} }

View File

@ -40,10 +40,10 @@ std::map<String, std::vector<ZoneFragment> > ConfigCompiler::m_ZoneDirs;
* @param input Input stream for the configuration file. * @param input Input stream for the configuration file.
* @param zone The zone. * @param zone The zone.
*/ */
ConfigCompiler::ConfigCompiler(const String& path, std::istream *input, ConfigCompiler::ConfigCompiler(String path, std::istream *input,
const String& zone, const String& package) String zone, String package)
: m_Path(path), m_Input(input), m_Zone(zone), m_Package(package), : m_Path(std::move(path)), m_Input(input), m_Zone(std::move(zone)),
m_Eof(false), m_OpenBraces(0) m_Package(std::move(package)), m_Eof(false), m_OpenBraces(0)
{ {
InitializeScanner(); InitializeScanner();
} }
@ -339,7 +339,8 @@ bool ConfigCompiler::HasZoneConfigAuthority(const String& zoneName)
if (!empty) { if (!empty) {
std::vector<String> paths; std::vector<String> paths;
for (const ZoneFragment& zf : zoneDirs) { paths.reserve(zoneDirs.size());
for (const ZoneFragment& zf : zoneDirs) {
paths.push_back(zf.Path); paths.push_back(zf.Path);
} }

View File

@ -86,8 +86,8 @@ struct ZoneFragment
class ConfigCompiler class ConfigCompiler
{ {
public: public:
explicit ConfigCompiler(const String& path, std::istream *input, explicit ConfigCompiler(String path, std::istream *input,
const String& zone = String(), const String& package = String()); String zone = String(), String package = String());
virtual ~ConfigCompiler(); virtual ~ConfigCompiler();
std::unique_ptr<Expression> Compile(); std::unique_ptr<Expression> Compile();

View File

@ -59,16 +59,16 @@ REGISTER_SCRIPTFUNCTION_NS(Internal, run_with_activation_context, &ConfigItem::R
* @param exprl Expression list for the item. * @param exprl Expression list for the item.
* @param debuginfo Debug information. * @param debuginfo Debug information.
*/ */
ConfigItem::ConfigItem(const Type::Ptr& type, const String& name, ConfigItem::ConfigItem(Type::Ptr type, String name,
bool abstract, const std::shared_ptr<Expression>& exprl, bool abstract, std::shared_ptr<Expression> exprl,
const std::shared_ptr<Expression>& filter, bool defaultTmpl, bool ignoreOnError, std::shared_ptr<Expression> filter, bool defaultTmpl, bool ignoreOnError,
const DebugInfo& debuginfo, const Dictionary::Ptr& scope, DebugInfo debuginfo, Dictionary::Ptr scope,
const String& zone, const String& package) String zone, String package)
: m_Type(type), m_Name(name), m_Abstract(abstract), : m_Type(std::move(type)), m_Name(std::move(name)), m_Abstract(abstract),
m_Expression(exprl), m_Filter(filter), m_Expression(std::move(exprl)), m_Filter(std::move(filter)),
m_DefaultTmpl(defaultTmpl), m_IgnoreOnError(ignoreOnError), m_DefaultTmpl(defaultTmpl), m_IgnoreOnError(ignoreOnError),
m_DebugInfo(debuginfo), m_Scope(scope), m_Zone(zone), m_DebugInfo(std::move(debuginfo)), m_Scope(std::move(scope)), m_Zone(std::move(zone)),
m_Package(package) m_Package(std::move(package))
{ {
} }

View File

@ -40,12 +40,12 @@ class ConfigItem final : public Object {
public: public:
DECLARE_PTR_TYPEDEFS(ConfigItem); DECLARE_PTR_TYPEDEFS(ConfigItem);
ConfigItem(const Type::Ptr& type, const String& name, bool abstract, ConfigItem(Type::Ptr type, String name, bool abstract,
const std::shared_ptr<Expression>& exprl, std::shared_ptr<Expression> exprl,
const std::shared_ptr<Expression>& filter, std::shared_ptr<Expression> filter,
bool defaultTmpl, bool ignoreOnError, const DebugInfo& debuginfo, bool defaultTmpl, bool ignoreOnError, DebugInfo debuginfo,
const Dictionary::Ptr& scope, const String& zone, Dictionary::Ptr scope, String zone,
const String& package); String package);
Type::Ptr GetType() const; Type::Ptr GetType() const;
String GetName() const; String GetName() const;

View File

@ -101,8 +101,8 @@ void DictExpression::MakeInline()
m_Inline = true; m_Inline = true;
} }
LiteralExpression::LiteralExpression(const Value& value) LiteralExpression::LiteralExpression(Value value)
: m_Value(value) : m_Value(std::move(value))
{ } { }
ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const

View File

@ -36,8 +36,8 @@ namespace icinga
struct DebugHint struct DebugHint
{ {
public: public:
DebugHint(const Dictionary::Ptr& hints = nullptr) DebugHint(Dictionary::Ptr hints = nullptr)
: m_Hints(hints) : m_Hints(std::move(hints))
{ } { }
DebugHint(Dictionary::Ptr&& hints) DebugHint(Dictionary::Ptr&& hints)
@ -154,8 +154,8 @@ struct ExpressionResult
{ {
public: public:
template<typename T> template<typename T>
ExpressionResult(const T& value, ExpressionResultCode code = ResultOK) ExpressionResult(T value, ExpressionResultCode code = ResultOK)
: m_Value(value), m_Code(code) : m_Value(std::move(value)), m_Code(code)
{ } { }
operator const Value&() const operator const Value&() const
@ -220,8 +220,8 @@ std::unique_ptr<Expression> MakeIndexer(ScopeSpecifier scopeSpec, const String&
class OwnedExpression final : public Expression class OwnedExpression final : public Expression
{ {
public: public:
OwnedExpression(const std::shared_ptr<Expression>& expression) OwnedExpression(std::shared_ptr<Expression> expression)
: m_Expression(expression) : m_Expression(std::move(expression))
{ } { }
protected: protected:
@ -242,7 +242,7 @@ private:
class LiteralExpression final : public Expression class LiteralExpression final : public Expression
{ {
public: public:
LiteralExpression(const Value& value = Value()); LiteralExpression(Value value = Value());
const Value& GetValue() const const Value& GetValue() const
{ {
@ -269,8 +269,8 @@ inline std::unique_ptr<LiteralExpression> MakeLiteral(const Value& literal = Val
class DebuggableExpression : public Expression class DebuggableExpression : public Expression
{ {
public: public:
DebuggableExpression(const DebugInfo& debugInfo = DebugInfo()) DebuggableExpression(DebugInfo debugInfo = DebugInfo())
: m_DebugInfo(debugInfo) : m_DebugInfo(std::move(debugInfo))
{ } { }
protected: protected:
@ -305,8 +305,8 @@ protected:
class VariableExpression final : public DebuggableExpression class VariableExpression final : public DebuggableExpression
{ {
public: public:
VariableExpression(const String& variable, const DebugInfo& debugInfo = DebugInfo()) VariableExpression(String variable, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_Variable(variable) : DebuggableExpression(debugInfo), m_Variable(std::move(variable))
{ } { }
String GetVariable() const String GetVariable() const
@ -768,9 +768,9 @@ protected:
class FunctionExpression final : public DebuggableExpression class FunctionExpression final : public DebuggableExpression
{ {
public: public:
FunctionExpression(const String& name, const std::vector<String>& args, FunctionExpression(String name, std::vector<String> args,
std::map<String, std::unique_ptr<Expression> >&& closedVars, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo()) std::map<String, std::unique_ptr<Expression> >&& closedVars, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_Name(name), m_Args(args), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression)) : DebuggableExpression(debugInfo), m_Name(std::move(name)), m_Args(std::move(args)), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression))
{ } { }
protected: protected:
@ -786,12 +786,12 @@ private:
class ApplyExpression final : public DebuggableExpression class ApplyExpression final : public DebuggableExpression
{ {
public: public:
ApplyExpression(const String& type, const String& target, std::unique_ptr<Expression> name, ApplyExpression(String type, String target, std::unique_ptr<Expression> name,
std::unique_ptr<Expression> filter, const String& package, const String& fkvar, const String& fvvar, std::unique_ptr<Expression> filter, String package, String fkvar, String fvvar,
std::unique_ptr<Expression> fterm, std::map<String, std::unique_ptr<Expression> >&& closedVars, bool ignoreOnError, std::unique_ptr<Expression> fterm, std::map<String, std::unique_ptr<Expression> >&& closedVars, bool ignoreOnError,
std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo()) std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_Type(type), m_Target(target), : DebuggableExpression(debugInfo), m_Type(std::move(type)), m_Target(std::move(target)),
m_Name(std::move(name)), m_Filter(std::move(filter)), m_Package(package), m_FKVar(fkvar), m_FVVar(fvvar), m_Name(std::move(name)), m_Filter(std::move(filter)), m_Package(std::move(package)), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)),
m_FTerm(std::move(fterm)), m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), m_FTerm(std::move(fterm)), m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)),
m_Expression(std::move(expression)) m_Expression(std::move(expression))
{ } { }
@ -817,10 +817,10 @@ class ObjectExpression final : public DebuggableExpression
{ {
public: public:
ObjectExpression(bool abstract, std::unique_ptr<Expression> type, std::unique_ptr<Expression> name, std::unique_ptr<Expression> filter, ObjectExpression(bool abstract, std::unique_ptr<Expression> type, std::unique_ptr<Expression> name, std::unique_ptr<Expression> filter,
const String& zone, const String& package, std::map<String, std::unique_ptr<Expression> >&& closedVars, String zone, String package, std::map<String, std::unique_ptr<Expression> >&& closedVars,
bool defaultTmpl, bool ignoreOnError, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo()) bool defaultTmpl, bool ignoreOnError, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_Abstract(abstract), m_Type(std::move(type)), : DebuggableExpression(debugInfo), m_Abstract(abstract), m_Type(std::move(type)),
m_Name(std::move(name)), m_Filter(std::move(filter)), m_Zone(zone), m_Package(package), m_DefaultTmpl(defaultTmpl), m_Name(std::move(name)), m_Filter(std::move(filter)), m_Zone(std::move(zone)), m_Package(std::move(package)), m_DefaultTmpl(defaultTmpl),
m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression)) m_IgnoreOnError(ignoreOnError), m_ClosedVars(std::move(closedVars)), m_Expression(std::move(expression))
{ } { }
@ -843,8 +843,8 @@ private:
class ForExpression final : public DebuggableExpression class ForExpression final : public DebuggableExpression
{ {
public: public:
ForExpression(const String& fkvar, const String& fvvar, std::unique_ptr<Expression> value, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo()) ForExpression(String fkvar, String fvvar, std::unique_ptr<Expression> value, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_FKVar(fkvar), m_FVVar(fvvar), m_Value(std::move(value)), m_Expression(std::move(expression)) : DebuggableExpression(debugInfo), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)), m_Value(std::move(value)), m_Expression(std::move(expression))
{ } { }
protected: protected:
@ -878,10 +878,10 @@ enum IncludeType
class IncludeExpression final : public DebuggableExpression class IncludeExpression final : public DebuggableExpression
{ {
public: public:
IncludeExpression(const String& relativeBase, std::unique_ptr<Expression> path, std::unique_ptr<Expression> pattern, std::unique_ptr<Expression> name, IncludeExpression(String relativeBase, std::unique_ptr<Expression> path, std::unique_ptr<Expression> pattern, std::unique_ptr<Expression> name,
IncludeType type, bool searchIncludes, const String& zone, const String& package, const DebugInfo& debugInfo = DebugInfo()) IncludeType type, bool searchIncludes, String zone, String package, const DebugInfo& debugInfo = DebugInfo())
: DebuggableExpression(debugInfo), m_RelativeBase(relativeBase), m_Path(std::move(path)), m_Pattern(std::move(pattern)), : DebuggableExpression(debugInfo), m_RelativeBase(std::move(relativeBase)), m_Path(std::move(path)), m_Pattern(std::move(pattern)),
m_Name(std::move(name)), m_Type(type), m_SearchIncludes(searchIncludes), m_Zone(zone), m_Package(package) m_Name(std::move(name)), m_Type(type), m_SearchIncludes(searchIncludes), m_Zone(std::move(zone)), m_Package(std::move(package))
{ } { }
protected: protected:

View File

@ -1247,7 +1247,7 @@ void DbEvents::AddEnableFlappingChangedLogHistory(const Checkable::Ptr& checkabl
AddLogHistory(checkable, msgbuf.str(), LogEntryTypeInfoMessage); AddLogHistory(checkable, msgbuf.str(), LogEntryTypeInfoMessage);
} }
void DbEvents::AddLogHistory(const Checkable::Ptr& checkable, String buffer, LogEntryType type) void DbEvents::AddLogHistory(const Checkable::Ptr& checkable, const String& buffer, LogEntryType type)
{ {
Log(LogDebug, "DbEvents") Log(LogDebug, "DbEvents")
<< "add log entry history for '" << checkable->GetName() << "'"; << "add log entry history for '" << checkable->GetName() << "'";

View File

@ -66,7 +66,7 @@ public:
static void AddDowntimes(const Checkable::Ptr& checkable); static void AddDowntimes(const Checkable::Ptr& checkable);
static void RemoveDowntimes(const Checkable::Ptr& checkable); static void RemoveDowntimes(const Checkable::Ptr& checkable);
static void AddLogHistory(const Checkable::Ptr& checkable, String buffer, LogEntryType type); static void AddLogHistory(const Checkable::Ptr& checkable, const String& buffer, LogEntryType type);
/* Status */ /* Status */
static void NextCheckUpdatedHandler(const Checkable::Ptr& checkable); static void NextCheckUpdatedHandler(const Checkable::Ptr& checkable);

View File

@ -45,8 +45,8 @@ boost::signals2::signal<void (const std::vector<DbQuery>&)> DbObject::OnMultiple
INITIALIZE_ONCE(&DbObject::StaticInitialize); INITIALIZE_ONCE(&DbObject::StaticInitialize);
DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2) DbObject::DbObject(intrusive_ptr<DbType> type, String name1, String name2)
: m_Name1(name1), m_Name2(name2), m_Type(type), m_LastConfigUpdate(0), m_LastStatusUpdate(0) : m_Name1(std::move(name1)), m_Name2(std::move(name2)), m_Type(std::move(type)), m_LastConfigUpdate(0), m_LastStatusUpdate(0)
{ } { }
void DbObject::StaticInitialize() void DbObject::StaticInitialize()

View File

@ -93,7 +93,7 @@ public:
virtual String CalculateConfigHash(const Dictionary::Ptr& configFields) const; virtual String CalculateConfigHash(const Dictionary::Ptr& configFields) const;
protected: protected:
DbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2); DbObject(intrusive_ptr<DbType> type, String name1, String name2);
virtual void OnConfigUpdateHeavy(); virtual void OnConfigUpdateHeavy();
virtual void OnConfigUpdateLight(); virtual void OnConfigUpdateLight();

View File

@ -25,8 +25,8 @@
using namespace icinga; using namespace icinga;
DbType::DbType(const String& name, const String& table, long tid, const String& idcolumn, const DbType::ObjectFactory& factory) DbType::DbType(String name, String table, long tid, String idcolumn, DbType::ObjectFactory factory)
: m_Name(name), m_Table(table), m_TypeID(tid), m_IDColumn(idcolumn), m_ObjectFactory(factory) : m_Name(std::move(name)), m_Table(std::move(table)), m_TypeID(tid), m_IDColumn(std::move(idcolumn)), m_ObjectFactory(std::move(factory))
{ } { }
String DbType::GetName() const String DbType::GetName() const

View File

@ -45,7 +45,7 @@ public:
typedef std::map<String, DbType::Ptr> TypeMap; typedef std::map<String, DbType::Ptr> TypeMap;
typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap; typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap;
DbType(const String& name, const String& table, long tid, const String& idcolumn, const ObjectFactory& factory); DbType(String name, String table, long tid, String idcolumn, ObjectFactory factory);
String GetName() const; String GetName() const;
String GetTable() const; String GetTable() const;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
DbValue::DbValue(DbValueType type, const Value& value) DbValue::DbValue(DbValueType type, Value value)
: m_Type(type), m_Value(value) : m_Type(type), m_Value(std::move(value))
{ } { }
Value DbValue::FromTimestamp(const Value& ts) Value DbValue::FromTimestamp(const Value& ts)

View File

@ -44,7 +44,7 @@ struct DbValue final : public Object
public: public:
DECLARE_PTR_TYPEDEFS(DbValue); DECLARE_PTR_TYPEDEFS(DbValue);
DbValue(DbValueType type, const Value& value); DbValue(DbValueType type, Value value);
static Value FromTimestamp(const Value& ts); static Value FromTimestamp(const Value& ts);
static Value FromTimestampNow(); static Value FromTimestampNow();

View File

@ -31,6 +31,7 @@
#include "base/exception.hpp" #include "base/exception.hpp"
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -132,7 +133,7 @@ void IdoMysqlConnection::ExceptionHandler(boost::exception_ptr exp)
Log(LogCritical, "IdoMysqlConnection", "Exception during database operation: Verify that your database is operational!"); Log(LogCritical, "IdoMysqlConnection", "Exception during database operation: Verify that your database is operational!");
Log(LogDebug, "IdoMysqlConnection") Log(LogDebug, "IdoMysqlConnection")
<< "Exception during database operation: " << DiagnosticInformation(exp); << "Exception during database operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) { if (GetConnected()) {
m_Mysql->close(&m_Connection); m_Mysql->close(&m_Connection);

View File

@ -32,6 +32,7 @@
#include "base/context.hpp" #include "base/context.hpp"
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -131,7 +132,7 @@ void IdoPgsqlConnection::ExceptionHandler(boost::exception_ptr exp)
Log(LogWarning, "IdoPgsqlConnection", "Exception during database operation: Verify that your database is operational!"); Log(LogWarning, "IdoPgsqlConnection", "Exception during database operation: Verify that your database is operational!");
Log(LogDebug, "IdoPgsqlConnection") Log(LogDebug, "IdoPgsqlConnection")
<< "Exception during database operation: " << DiagnosticInformation(exp); << "Exception during database operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) { if (GetConnected()) {
m_Pgsql->finish(m_Connection); m_Pgsql->finish(m_Connection);

View File

@ -55,7 +55,7 @@ String CompatUtility::GetCommandLine(const Command::Ptr& command)
return result; return result;
} }
String CompatUtility::GetCommandNamePrefix(const Command::Ptr command) String CompatUtility::GetCommandNamePrefix(const Command::Ptr& command)
{ {
if (!command) if (!command)
return Empty; return Empty;
@ -71,7 +71,7 @@ String CompatUtility::GetCommandNamePrefix(const Command::Ptr command)
return prefix; return prefix;
} }
String CompatUtility::GetCommandName(const Command::Ptr command) String CompatUtility::GetCommandName(const Command::Ptr& command)
{ {
if (!command) if (!command)
return Empty; return Empty;

View File

@ -41,7 +41,7 @@ class CompatUtility
public: public:
/* command */ /* command */
static String GetCommandLine(const Command::Ptr& command); static String GetCommandLine(const Command::Ptr& command);
static String GetCommandName(const Command::Ptr command); static String GetCommandName(const Command::Ptr& command);
/* host */ /* host */
static int GetHostCurrentState(const Host::Ptr& host); static int GetHostCurrentState(const Host::Ptr& host);
@ -122,7 +122,7 @@ public:
private: private:
CompatUtility(); CompatUtility();
static String GetCommandNamePrefix(const Command::Ptr command); static String GetCommandNamePrefix(const Command::Ptr& command);
}; };
} }

View File

@ -23,7 +23,6 @@
#include "icinga/i2-icinga.hpp" #include "icinga/i2-icinga.hpp"
#include "icinga/scheduleddowntime.thpp" #include "icinga/scheduleddowntime.thpp"
#include "icinga/checkable.hpp" #include "icinga/checkable.hpp"
#include <utility>
namespace icinga namespace icinga
{ {

View File

@ -24,7 +24,6 @@
#include "icinga/service.thpp" #include "icinga/service.thpp"
#include "icinga/macroresolver.hpp" #include "icinga/macroresolver.hpp"
#include "icinga/host.hpp" #include "icinga/host.hpp"
#include <utility>
#include <tuple> #include <tuple>
using std::tie; using std::tie;

View File

@ -27,8 +27,8 @@
using namespace icinga; using namespace icinga;
AttributeFilter::AttributeFilter(const String& column, const String& op, const String& operand) AttributeFilter::AttributeFilter(String column, String op, String operand)
: m_Column(column), m_Operator(op), m_Operand(operand) : m_Column(std::move(column)), m_Operator(std::move(op)), m_Operand(std::move(operand))
{ } { }
bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row) bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)

View File

@ -35,7 +35,7 @@ class AttributeFilter final : public Filter
public: public:
DECLARE_PTR_TYPEDEFS(AttributeFilter); DECLARE_PTR_TYPEDEFS(AttributeFilter);
AttributeFilter(const String& column, const String& op, const String& operand); AttributeFilter(String column, String op, String operand);
bool Apply(const Table::Ptr& table, const Value& row) override; bool Apply(const Table::Ptr& table, const Value& row) override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
AvgAggregator::AvgAggregator(const String& attr) AvgAggregator::AvgAggregator(String attr)
: m_AvgAttr(attr) : m_AvgAttr(std::move(attr))
{ } { }
AvgAggregatorState *AvgAggregator::EnsureState(AggregatorState **state) AvgAggregatorState *AvgAggregator::EnsureState(AggregatorState **state)

View File

@ -47,7 +47,7 @@ class AvgAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(AvgAggregator); DECLARE_PTR_TYPEDEFS(AvgAggregator);
AvgAggregator(const String& attr); AvgAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
Column::Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor) Column::Column(ValueAccessor valueAccessor, ObjectAccessor objectAccessor)
: m_ValueAccessor(valueAccessor), m_ObjectAccessor(objectAccessor) : m_ValueAccessor(std::move(valueAccessor)), m_ObjectAccessor(std::move(objectAccessor))
{ } { }
Value Column::ExtractValue(const Value& urow, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) const Value Column::ExtractValue(const Value& urow, LivestatusGroupByType groupByType, const Object::Ptr& groupByObject) const

View File

@ -40,7 +40,7 @@ public:
typedef std::function<Value (const Value&)> ValueAccessor; typedef std::function<Value (const Value&)> ValueAccessor;
typedef std::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor; typedef std::function<Value (const Value&, LivestatusGroupByType, const Object::Ptr&)> ObjectAccessor;
Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor); Column(ValueAccessor valueAccessor, ObjectAccessor objectAccessor);
Value ExtractValue(const Value& urow, LivestatusGroupByType groupByType = LivestatusGroupByNone, const Object::Ptr& groupByObject = Empty) const; Value ExtractValue(const Value& urow, LivestatusGroupByType groupByType = LivestatusGroupByNone, const Object::Ptr& groupByObject = Empty) const;

View File

@ -37,7 +37,7 @@ public:
virtual bool Apply(const Table::Ptr& table, const Value& row) = 0; virtual bool Apply(const Table::Ptr& table, const Value& row) = 0;
protected: protected:
Filter(); Filter() = default;
}; };
} }

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
InvAvgAggregator::InvAvgAggregator(const String& attr) InvAvgAggregator::InvAvgAggregator(String attr)
: m_InvAvgAttr(attr) : m_InvAvgAttr(std::move(attr))
{ } { }
InvAvgAggregatorState *InvAvgAggregator::EnsureState(AggregatorState **state) InvAvgAggregatorState *InvAvgAggregator::EnsureState(AggregatorState **state)

View File

@ -47,7 +47,7 @@ class InvAvgAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(InvAvgAggregator); DECLARE_PTR_TYPEDEFS(InvAvgAggregator);
InvAvgAggregator(const String& attr); InvAvgAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
InvSumAggregator::InvSumAggregator(const String& attr) InvSumAggregator::InvSumAggregator(String attr)
: m_InvSumAttr(attr) : m_InvSumAttr(std::move(attr))
{ } { }
InvSumAggregatorState *InvSumAggregator::EnsureState(AggregatorState **state) InvSumAggregatorState *InvSumAggregator::EnsureState(AggregatorState **state)

View File

@ -46,7 +46,7 @@ class InvSumAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(InvSumAggregator); DECLARE_PTR_TYPEDEFS(InvSumAggregator);
InvSumAggregator(const String& attr); InvSumAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -534,7 +534,7 @@ void LivestatusQuery::ExecuteGetHelper(const Stream::Ptr& stream)
int index = 0; int index = 0;
for (const Aggregator::Ptr aggregator : m_Aggregators) { for (const Aggregator::Ptr& aggregator : m_Aggregators) {
aggregator->Apply(table, object.Row, &stats[index]); aggregator->Apply(table, object.Row, &stats[index]);
index++; index++;
} }

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
MaxAggregator::MaxAggregator(const String& attr) MaxAggregator::MaxAggregator(String attr)
: m_MaxAttr(attr) : m_MaxAttr(std::move(attr))
{ } { }
MaxAggregatorState *MaxAggregator::EnsureState(AggregatorState **state) MaxAggregatorState *MaxAggregator::EnsureState(AggregatorState **state)

View File

@ -46,7 +46,7 @@ class MaxAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(MaxAggregator); DECLARE_PTR_TYPEDEFS(MaxAggregator);
MaxAggregator(const String& attr); MaxAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
MinAggregator::MinAggregator(const String& attr) MinAggregator::MinAggregator(String attr)
: m_MinAttr(attr) : m_MinAttr(std::move(attr))
{ } { }
MinAggregatorState *MinAggregator::EnsureState(AggregatorState **state) MinAggregatorState *MinAggregator::EnsureState(AggregatorState **state)

View File

@ -47,7 +47,7 @@ class MinAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(MinAggregator); DECLARE_PTR_TYPEDEFS(MinAggregator);
MinAggregator(const String& attr); MinAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
NegateFilter::NegateFilter(const Filter::Ptr& inner) NegateFilter::NegateFilter(Filter::Ptr inner)
: m_Inner(inner) : m_Inner(std::move(inner))
{ } { }
bool NegateFilter::Apply(const Table::Ptr& table, const Value& row) bool NegateFilter::Apply(const Table::Ptr& table, const Value& row)

View File

@ -35,7 +35,7 @@ class NegateFilter final : public Filter
public: public:
DECLARE_PTR_TYPEDEFS(NegateFilter); DECLARE_PTR_TYPEDEFS(NegateFilter);
NegateFilter(const Filter::Ptr& inner); NegateFilter(Filter::Ptr inner);
bool Apply(const Table::Ptr& table, const Value& row) override; bool Apply(const Table::Ptr& table, const Value& row) override;

View File

@ -22,8 +22,8 @@
using namespace icinga; using namespace icinga;
StdAggregator::StdAggregator(const String& attr) StdAggregator::StdAggregator(String attr)
: m_StdAttr(attr) : m_StdAttr(std::move(attr))
{ } { }
StdAggregatorState *StdAggregator::EnsureState(AggregatorState **state) StdAggregatorState *StdAggregator::EnsureState(AggregatorState **state)

View File

@ -48,7 +48,7 @@ class StdAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(StdAggregator); DECLARE_PTR_TYPEDEFS(StdAggregator);
StdAggregator(const String& attr); StdAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -21,8 +21,8 @@
using namespace icinga; using namespace icinga;
SumAggregator::SumAggregator(const String& attr) SumAggregator::SumAggregator(String attr)
: m_SumAttr(attr) : m_SumAttr(std::move(attr))
{ } { }
SumAggregatorState *SumAggregator::EnsureState(AggregatorState **state) SumAggregatorState *SumAggregator::EnsureState(AggregatorState **state)

View File

@ -46,7 +46,7 @@ class SumAggregator final : public Aggregator
public: public:
DECLARE_PTR_TYPEDEFS(SumAggregator); DECLARE_PTR_TYPEDEFS(SumAggregator);
SumAggregator(const String& attr); SumAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override; void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override; double GetResultAndFreeState(AggregatorState *state) const override;

View File

@ -91,7 +91,7 @@ Value ZonesTable::EndpointsAccessor(const Value& row)
Array::Ptr endpoint_names = new Array(); Array::Ptr endpoint_names = new Array();
for (const Endpoint::Ptr endpoint : endpoints) { for (const Endpoint::Ptr& endpoint : endpoints) {
endpoint_names->Add(endpoint->GetName()); endpoint_names->Add(endpoint->GetName());
} }

View File

@ -109,7 +109,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
double bytesSentPerSecond = 0; double bytesSentPerSecond = 0;
double bytesReceivedPerSecond = 0; double bytesReceivedPerSecond = 0;
for (Endpoint::Ptr endpoint : endpoints) for (const Endpoint::Ptr& endpoint : endpoints)
{ {
if (endpoint->GetLastMessageSent() > lastMessageSent) if (endpoint->GetLastMessageSent() > lastMessageSent)
lastMessageSent = endpoint->GetLastMessageSent(); lastMessageSent = endpoint->GetLastMessageSent();

View File

@ -36,6 +36,7 @@
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -341,7 +342,7 @@ void ElasticsearchWriter::NotificationSentToAllUsersHandlerInternal(const Notifi
Enqueue("notification", fields, ts); Enqueue("notification", fields, ts);
} }
void ElasticsearchWriter::Enqueue(String type, const Dictionary::Ptr& fields, double ts) void ElasticsearchWriter::Enqueue(const String& type, const Dictionary::Ptr& fields, double ts)
{ {
/* Atomically buffer the data point. */ /* Atomically buffer the data point. */
boost::mutex::scoped_lock lock(m_DataBufferMutex); boost::mutex::scoped_lock lock(m_DataBufferMutex);
@ -575,7 +576,7 @@ void ElasticsearchWriter::ExceptionHandler(boost::exception_ptr exp)
Log(LogCritical, "ElasticsearchWriter", "Exception during Elastic operation: Verify that your backend is operational!"); Log(LogCritical, "ElasticsearchWriter", "Exception during Elastic operation: Verify that your backend is operational!");
Log(LogDebug, "ElasticsearchWriter") Log(LogDebug, "ElasticsearchWriter")
<< "Exception during Elasticsearch operation: " << DiagnosticInformation(exp); << "Exception during Elasticsearch operation: " << DiagnosticInformation(std::move(exp));
} }
String ElasticsearchWriter::FormatTimestamp(double ts) String ElasticsearchWriter::FormatTimestamp(double ts)

View File

@ -66,7 +66,7 @@ private:
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type, const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
const CheckResult::Ptr& cr, const String& author, const String& text); const CheckResult::Ptr& cr, const String& author, const String& text);
void Enqueue(String type, const Dictionary::Ptr& fields, double ts); void Enqueue(const String& type, const Dictionary::Ptr& fields, double ts);
Stream::Ptr Connect(); Stream::Ptr Connect();
void AssertOnWorkQueue(); void AssertOnWorkQueue();

View File

@ -38,6 +38,7 @@
#include "base/json.hpp" #include "base/json.hpp"
#include "base/statsfunction.hpp" #include "base/statsfunction.hpp"
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -122,7 +123,7 @@ void GelfWriter::ExceptionHandler(boost::exception_ptr exp)
Log(LogCritical, "GelfWriter", "Exception during Graylog Gelf operation: Verify that your backend is operational!"); Log(LogCritical, "GelfWriter", "Exception during Graylog Gelf operation: Verify that your backend is operational!");
Log(LogDebug, "GelfWriter") Log(LogDebug, "GelfWriter")
<< "Exception during Graylog Gelf operation: " << DiagnosticInformation(exp); << "Exception during Graylog Gelf operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) { if (GetConnected()) {
m_Stream->Close(); m_Stream->Close();

View File

@ -38,6 +38,7 @@
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -119,7 +120,7 @@ void GraphiteWriter::ExceptionHandler(boost::exception_ptr exp)
Log(LogCritical, "GraphiteWriter", "Exception during Graphite operation: Verify that your backend is operational!"); Log(LogCritical, "GraphiteWriter", "Exception during Graphite operation: Verify that your backend is operational!");
Log(LogDebug, "GraphiteWriter") Log(LogDebug, "GraphiteWriter")
<< "Exception during Graphite operation: " << DiagnosticInformation(exp); << "Exception during Graphite operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) { if (GetConnected()) {
m_Stream->Close(); m_Stream->Close();

View File

@ -46,6 +46,7 @@
#include <boost/math/special_functions/fpclassify.hpp> #include <boost/math/special_functions/fpclassify.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <utility>
using namespace icinga; using namespace icinga;
@ -147,7 +148,7 @@ void InfluxdbWriter::ExceptionHandler(boost::exception_ptr exp)
Log(LogCritical, "InfluxdbWriter", "Exception during InfluxDB operation: Verify that your backend is operational!"); Log(LogCritical, "InfluxdbWriter", "Exception during InfluxDB operation: Verify that your backend is operational!");
Log(LogDebug, "InfluxdbWriter") Log(LogDebug, "InfluxdbWriter")
<< "Exception during InfluxDB operation: " << DiagnosticInformation(exp); << "Exception during InfluxDB operation: " << DiagnosticInformation(std::move(exp));
//TODO: Close the connection, if we keep it open. //TODO: Close the connection, if we keep it open.
} }

View File

@ -22,8 +22,8 @@
using namespace icinga; using namespace icinga;
ApiAction::ApiAction(const std::vector<String>& types, const Callback& action) ApiAction::ApiAction(std::vector<String> types, Callback action)
: m_Types(types), m_Callback(action) : m_Types(std::move(types)), m_Callback(std::move(action))
{ } { }
Value ApiAction::Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params) Value ApiAction::Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)

View File

@ -45,7 +45,7 @@ public:
typedef std::function<Value(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)> Callback; typedef std::function<Value(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)> Callback;
ApiAction(const std::vector<String>& registerTypes, const Callback& function); ApiAction(std::vector<String> registerTypes, Callback function);
Value Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params); Value Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params);

View File

@ -27,8 +27,8 @@
using namespace icinga; using namespace icinga;
ApiClient::ApiClient(const String& host, const String& port, ApiClient::ApiClient(const String& host, const String& port,
const String& user, const String& password) String user, String password)
: m_Connection(new HttpClientConnection(host, port, true)), m_User(user), m_Password(password) : m_Connection(new HttpClientConnection(host, port, true)), m_User(std::move(user)), m_Password(std::move(password))
{ {
m_Connection->Start(); m_Connection->Start();
} }

View File

@ -90,7 +90,7 @@ public:
DECLARE_PTR_TYPEDEFS(ApiClient); DECLARE_PTR_TYPEDEFS(ApiClient);
ApiClient(const String& host, const String& port, ApiClient(const String& host, const String& port,
const String& user, const String& password); String user, String password);
typedef std::function<void(boost::exception_ptr, const std::vector<ApiType::Ptr>&)> TypesCompletionCallback; typedef std::function<void(boost::exception_ptr, const std::vector<ApiType::Ptr>&)> TypesCompletionCallback;
void GetTypes(const TypesCompletionCallback& callback) const; void GetTypes(const TypesCompletionCallback& callback) const;

View File

@ -22,8 +22,8 @@
using namespace icinga; using namespace icinga;
ApiFunction::ApiFunction(const Callback& function) ApiFunction::ApiFunction(Callback function)
: m_Callback(function) : m_Callback(std::move(function))
{ } { }
Value ApiFunction::Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments) Value ApiFunction::Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments)

View File

@ -42,7 +42,7 @@ public:
typedef std::function<Value(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&)> Callback; typedef std::function<Value(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&)> Callback;
ApiFunction(const Callback& function); ApiFunction(Callback function);
Value Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments); Value Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments);

View File

@ -24,8 +24,8 @@
using namespace icinga; using namespace icinga;
EventQueue::EventQueue(const String& name) EventQueue::EventQueue(String name)
: m_Name(name) : m_Name(std::move(name))
{ } { }
bool EventQueue::CanProcessEvent(const String& type) const bool EventQueue::CanProcessEvent(const String& type) const

View File

@ -37,7 +37,7 @@ class EventQueue final : public Object
public: public:
DECLARE_PTR_TYPEDEFS(EventQueue); DECLARE_PTR_TYPEDEFS(EventQueue);
EventQueue(const String& name); EventQueue(String name);
bool CanProcessEvent(const String& type) const; bool CanProcessEvent(const String& type) const;
void ProcessEvent(const Dictionary::Ptr& event); void ProcessEvent(const Dictionary::Ptr& event);

View File

@ -31,8 +31,8 @@
using namespace icinga; using namespace icinga;
HttpClientConnection::HttpClientConnection(const String& host, const String& port, bool tls) HttpClientConnection::HttpClientConnection(String host, String port, bool tls)
: m_Host(host), m_Port(port), m_Tls(tls) : m_Host(std::move(host)), m_Port(std::move(port)), m_Tls(tls)
{ } { }
void HttpClientConnection::Start() void HttpClientConnection::Start()

View File

@ -39,7 +39,7 @@ class HttpClientConnection final : public Object
public: public:
DECLARE_PTR_TYPEDEFS(HttpClientConnection); DECLARE_PTR_TYPEDEFS(HttpClientConnection);
HttpClientConnection(const String& host, const String& port, bool tls = true); HttpClientConnection(String host, String port, bool tls = true);
void Start(); void Start();

View File

@ -27,11 +27,11 @@
using namespace icinga; using namespace icinga;
HttpRequest::HttpRequest(const Stream::Ptr& stream) HttpRequest::HttpRequest(Stream::Ptr stream)
: Complete(false), : Complete(false),
ProtocolVersion(HttpVersion11), ProtocolVersion(HttpVersion11),
Headers(new Dictionary()), Headers(new Dictionary()),
m_Stream(stream), m_Stream(std::move(stream)),
m_State(HttpRequestStart) m_State(HttpRequestStart)
{ } { }

View File

@ -60,7 +60,7 @@ public:
Dictionary::Ptr Headers; Dictionary::Ptr Headers;
HttpRequest(const Stream::Ptr& stream); HttpRequest(Stream::Ptr stream);
bool Parse(StreamReadContext& src, bool may_wait); bool Parse(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count); size_t ReadBody(char *data, size_t count);

View File

@ -27,8 +27,8 @@
using namespace icinga; using namespace icinga;
HttpResponse::HttpResponse(const Stream::Ptr& stream, const HttpRequest& request) HttpResponse::HttpResponse(Stream::Ptr stream, const HttpRequest& request)
: Complete(false), m_State(HttpResponseStart), m_Request(request), m_Stream(stream) : Complete(false), m_State(HttpResponseStart), m_Request(request), m_Stream(std::move(stream))
{ } { }
void HttpResponse::SetStatus(int code, const String& message) void HttpResponse::SetStatus(int code, const String& message)

View File

@ -52,7 +52,7 @@ public:
Dictionary::Ptr Headers; Dictionary::Ptr Headers;
HttpResponse(const Stream::Ptr& stream, const HttpRequest& request); HttpResponse(Stream::Ptr stream, const HttpRequest& request);
bool Parse(StreamReadContext& src, bool may_wait); bool Parse(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count); size_t ReadBody(char *data, size_t count);

View File

@ -42,8 +42,8 @@ static int l_JsonRpcConnectionNextID;
static Timer::Ptr l_HeartbeatTimer; static Timer::Ptr l_HeartbeatTimer;
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated, JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
const TlsStream::Ptr& stream, ConnectionRole role) TlsStream::Ptr stream, ConnectionRole role)
: m_ID(l_JsonRpcConnectionNextID++), m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream), : m_ID(l_JsonRpcConnectionNextID++), m_Identity(identity), m_Authenticated(authenticated), m_Stream(std::move(stream)),
m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_HeartbeatTimeout(0) m_Role(role), m_Timestamp(Utility::GetTime()), m_Seen(Utility::GetTime()), m_NextHeartbeat(0), m_HeartbeatTimeout(0)
{ {
boost::call_once(l_JsonRpcConnectionOnceFlag, &JsonRpcConnection::StaticInitialize); boost::call_once(l_JsonRpcConnectionOnceFlag, &JsonRpcConnection::StaticInitialize);

View File

@ -53,7 +53,7 @@ class JsonRpcConnection final : public Object
public: public:
DECLARE_PTR_TYPEDEFS(JsonRpcConnection); DECLARE_PTR_TYPEDEFS(JsonRpcConnection);
JsonRpcConnection(const String& identity, bool authenticated, const TlsStream::Ptr& stream, ConnectionRole role); JsonRpcConnection(const String& identity, bool authenticated, TlsStream::Ptr stream, ConnectionRole role);
void Start(); void Start();

View File

@ -270,7 +270,7 @@ String Url::Format(bool onlyPathAndQuery, bool printCredentials) const
// Array // Array
String temp; String temp;
for (const String s : kv.second) { for (const String& s : kv.second) {
if (!temp.IsEmpty()) if (!temp.IsEmpty())
temp += "&"; temp += "&";
@ -351,7 +351,7 @@ bool Url::ParsePort(const String& port)
bool Url::ParsePath(const String& path) bool Url::ParsePath(const String& path)
{ {
std::string pathStr = path; const std::string& pathStr = path;
boost::char_separator<char> sep("/"); boost::char_separator<char> sep("/");
boost::tokenizer<boost::char_separator<char> > tokens(pathStr, sep); boost::tokenizer<boost::char_separator<char> > tokens(pathStr, sep);
@ -371,7 +371,7 @@ bool Url::ParsePath(const String& path)
bool Url::ParseQuery(const String& query) bool Url::ParseQuery(const String& query)
{ {
/* Tokenizer does not like String AT ALL */ /* Tokenizer does not like String AT ALL */
std::string queryStr = query; const std::string& queryStr = query;
boost::char_separator<char> sep("&"); boost::char_separator<char> sep("&");
boost::tokenizer<boost::char_separator<char> > tokens(queryStr, sep); boost::tokenizer<boost::char_separator<char> > tokens(queryStr, sep);

View File

@ -24,6 +24,7 @@
#include <stdexcept> #include <stdexcept>
#include <map> #include <map>
#include <set> #include <set>
#include <utility>
#include <vector> #include <vector>
#include <cstring> #include <cstring>
#include <locale> #include <locale>
@ -35,9 +36,9 @@
using namespace icinga; using namespace icinga;
ClassCompiler::ClassCompiler(const std::string& path, std::istream& input, ClassCompiler::ClassCompiler(std::string path, std::istream& input,
std::ostream& oimpl, std::ostream& oheader) std::ostream& oimpl, std::ostream& oheader)
: m_Path(path), m_Input(input), m_Impl(oimpl), m_Header(oheader) : m_Path(std::move(path)), m_Input(input), m_Impl(oimpl), m_Header(oheader)
{ {
InitializeScanner(); InitializeScanner();
} }

Some files were not shown because too many files have changed in this diff Show More