*
* @param value The value.
*/
-void Array::Add(const Value& value)
+void Array::Add(Value value)
{
ObjectLock olock(this);
- m_Data.push_back(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));
+ m_Data.push_back(std::move(value));
}
/**
* @param index The index
* @param value The value to add
*/
-void Array::Insert(SizeType index, const Value& value)
+void Array::Insert(SizeType index, Value value)
{
ObjectLock olock(this);
ASSERT(index <= m_Data.size());
- m_Data.insert(m_Data.begin() + index, value);
+ m_Data.insert(m_Data.begin() + index, std::move(value));
}
/**
Set(index, value);
}
-Array::Iterator icinga::begin(Array::Ptr x)
+Array::Iterator icinga::begin(const Array::Ptr& x)
{
return x->Begin();
}
-Array::Iterator icinga::end(Array::Ptr x)
+Array::Iterator icinga::end(const Array::Ptr& x)
{
return x->End();
}
Value Get(SizeType index) const;
void Set(SizeType index, const Value& value);
void Set(SizeType index, Value&& value);
- void Add(const Value& value);
- void Add(Value&& value);
+ void Add(Value value);
Iterator Begin();
Iterator End();
size_t GetLength() 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(Iterator it);
std::vector<Value> m_Data; /**< The data for the array. */
};
-Array::Iterator begin(Array::Ptr x);
-Array::Iterator end(Array::Ptr x);
+Array::Iterator begin(const Array::Ptr& x);
+Array::Iterator end(const Array::Ptr& x);
}
{
std::vector<intrusive_ptr<ConfigObject> > objects = GetObjectsHelper(T::TypeInstance.get());
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));
}
return result;
return keywords;
}
-ConfigIdentifier::ConfigIdentifier(const String& identifier)
- : m_Name(identifier)
+ConfigIdentifier::ConfigIdentifier(String identifier)
+ : m_Name(std::move(identifier))
{ }
String ConfigIdentifier::GetName() const
public:
DECLARE_PTR_TYPEDEFS(ConfigIdentifier);
- ConfigIdentifier(const String& name);
+ ConfigIdentifier(String name);
String GetName() const;
* @param key The key.
* @param value The value.
*/
-void Dictionary::Set(const String& key, const 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)
+void Dictionary::Set(const String& key, Value value)
{
ObjectLock olock(this);
return Get(field, result);
}
-Dictionary::Iterator icinga::begin(Dictionary::Ptr x)
+Dictionary::Iterator icinga::begin(const Dictionary::Ptr& x)
{
return x->Begin();
}
-Dictionary::Iterator icinga::end(Dictionary::Ptr x)
+Dictionary::Iterator icinga::end(const Dictionary::Ptr& x)
{
return x->End();
}
Value Get(const String& key) 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;
Iterator Begin();
std::map<String, Value> m_Data; /**< The data for the dictionary. */
};
-Dictionary::Iterator begin(Dictionary::Ptr x);
-Dictionary::Iterator end(Dictionary::Ptr x);
+Dictionary::Iterator begin(const Dictionary::Ptr& x);
+Dictionary::Iterator end(const Dictionary::Ptr& x);
}
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 stack;
return boost::diagnostic_information(eptr);
}
-ScriptError::ScriptError(const String& message)
- : m_Message(message), m_IncompleteExpr(false)
+ScriptError::ScriptError(String message)
+ : m_Message(std::move(message)), m_IncompleteExpr(false)
{ }
-ScriptError::ScriptError(const String& message, const DebugInfo& di, bool incompleteExpr)
- : m_Message(message), m_DebugInfo(di), m_IncompleteExpr(incompleteExpr), m_HandledByDebugger(false)
+ScriptError::ScriptError(String message, DebugInfo di, bool incompleteExpr)
+ : m_Message(std::move(message)), m_DebugInfo(std::move(di)), m_IncompleteExpr(incompleteExpr), m_HandledByDebugger(false)
{ }
ScriptError::~ScriptError() throw()
class ScriptError : virtual public user_error
{
public:
- ScriptError(const String& message);
- ScriptError(const String& message, const DebugInfo& di, bool incompleteExpr = false);
+ ScriptError(String message);
+ ScriptError(String message, DebugInfo di, bool incompleteExpr = false);
~ScriptError() throw() override;
const char *what(void) const throw() final;
}
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 {
public:
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)
- : m_Callback(function)
+ : m_Callback(std::move(function))
{
SetName(name, true);
SetSideEffectFree(side_effect_free, true);
private:
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);
};
struct DeferredInitializer
{
public:
- DeferredInitializer(const std::function<void ()>& callback, int priority)
- : m_Callback(callback), m_Priority(priority)
+ DeferredInitializer(std::function<void ()> callback, int priority)
+ : m_Callback(std::move(callback)), m_Priority(priority)
{ }
bool operator<(const DeferredInitializer& other) const
}
}
-Log::Log(LogSeverity severity, const String& facility, const String& message)
- : m_Severity(severity), m_Facility(facility)
+Log::Log(LogSeverity severity, String facility, const String& message)
+ : m_Severity(severity), m_Facility(std::move(facility))
{
m_Buffer << message;
}
-Log::Log(LogSeverity severity, const String& facility)
- : m_Severity(severity), m_Facility(facility)
+Log::Log(LogSeverity severity, String facility)
+ : m_Severity(severity), m_Facility(std::move(facility))
{ }
/**
Log(const Log& other) = delete;
Log& operator=(const Log& rhs) = delete;
- Log(LogSeverity severity, const String& facility, const String& message);
- Log(LogSeverity severity, const String& facility);
+ Log(LogSeverity severity, String facility, const String& message);
+ Log(LogSeverity severity, String facility);
~Log();
using namespace icinga;
-NetworkStream::NetworkStream(const Socket::Ptr& socket)
- : m_Socket(socket), m_Eof(false)
+NetworkStream::NetworkStream(Socket::Ptr socket)
+ : m_Socket(std::move(socket)), m_Eof(false)
{ }
void NetworkStream::Close()
public:
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;
void Write(const void *buffer, size_t count) override;
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 Value& max)
{
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& min = Empty, const Value& max = Empty);
using namespace icinga;
-PrimitiveType::PrimitiveType(const String& name, const String& base, const ObjectFactory& factory)
- : m_Name(name), m_Base(base), m_Factory(factory)
+PrimitiveType::PrimitiveType(String name, String base, const ObjectFactory& factory)
+ : m_Name(std::move(name)), m_Base(std::move(base)), m_Factory(factory)
{ }
String PrimitiveType::GetName() const
class PrimitiveType final : public Type
{
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;
Type::Ptr GetBaseType() const override;
static boost::once_flag l_ProcessOnceFlag = BOOST_ONCE_INIT;
static boost::once_flag l_SpawnHelperOnceFlag = BOOST_ONCE_INIT;
-Process::Process(const Process::Arguments& arguments, const Dictionary::Ptr& extraEnvironment)
- : m_Arguments(arguments), m_ExtraEnvironment(extraEnvironment), m_Timeout(600), m_AdjustPriority(false)
+Process::Process(Process::Arguments arguments, Dictionary::Ptr extraEnvironment)
+ : m_Arguments(std::move(arguments)), m_ExtraEnvironment(std::move(extraEnvironment)), m_Timeout(600), m_AdjustPriority(false)
#ifdef _WIN32
, m_ReadPending(false), m_ReadFailed(false), m_Overlapped()
#endif /* _WIN32 */
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;
void SetTimeout(double timeout);
InitializeFrame();
}
-ScriptFrame::ScriptFrame(bool allocLocals, const Value& self)
- : Locals(allocLocals ? new Dictionary() : nullptr), Self(self), Sandboxed(false), Depth(0)
+ScriptFrame::ScriptFrame(bool allocLocals, Value self)
+ : Locals(allocLocals ? new Dictionary() : nullptr), Self(std::move(self)), Sandboxed(false), Depth(0)
{
InitializeFrame();
}
int Depth;
ScriptFrame(bool allocLocals);
- ScriptFrame(bool allocLocals, const Value& self);
+ ScriptFrame(bool allocLocals, Value self);
~ScriptFrame();
void IncreaseStackDepth();
: m_Data(data)
{ }
-String::String(const std::string& data)
- : m_Data(data)
-{ }
-
-String::String(std::string&& data)
+String::String(std::string data)
: m_Data(std::move(data))
{ }
String();
String(const char *data);
- String(const std::string& data);
- String(std::string&& data);
+ String(std::string data);
String(String::SizeType n, char c);
String(const String& other);
String(String&& other);
}
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) {
try {
}
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) {
try {
mutable boost::condition_variable m_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);
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
static char *ConsoleCompleteHelper(const char *word, int state);
return false;
}
- for (const String feature : disabled_features)
+ for (const String& feature : disabled_features)
features->Set(feature, false);
- for (const String feature : enabled_features)
+ for (const String& feature : enabled_features)
features->Set(feature, true);
InfoLogLine(log)
return astack.top();
}
-ActivationScope::ActivationScope(const ActivationContext::Ptr& context)
- : m_Context(context)
+ActivationScope::ActivationScope(ActivationContext::Ptr context)
+ : m_Context(std::move(context))
{
if (!m_Context)
m_Context = new ActivationContext();
class ActivationScope
{
public:
- ActivationScope(const ActivationContext::Ptr& context = nullptr);
+ ActivationScope(ActivationContext::Ptr context = nullptr);
~ActivationScope();
ActivationContext::Ptr GetContext() const;
ApplyRule::RuleMap ApplyRule::m_Rules;
ApplyRule::TypeMap ApplyRule::m_Types;
-ApplyRule::ApplyRule(const String& targetType, const String& name, const 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,
- bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope)
- : m_TargetType(targetType), m_Name(name), m_Expression(expression), m_Filter(filter), m_Package(package), m_FKVar(fkvar),
- m_FVVar(fvvar), m_FTerm(fterm), m_IgnoreOnError(ignoreOnError), m_DebugInfo(di), m_Scope(scope), m_HasMatches(false)
+ApplyRule::ApplyRule(String targetType, String name, std::shared_ptr<Expression> expression,
+ std::shared_ptr<Expression> filter, String package, String fkvar, String fvvar, std::shared_ptr<Expression> fterm,
+ bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope)
+ : 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(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
static TypeMap m_Types;
static RuleMap m_Rules;
- ApplyRule(const String& targetType, const String& name, const 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,
- bool ignoreOnError, const DebugInfo& di, const Dictionary::Ptr& scope);
+ ApplyRule(String targetType, String name, std::shared_ptr<Expression> expression,
+ std::shared_ptr<Expression> filter, String package, String fkvar, String fvvar, std::shared_ptr<Expression> fterm,
+ bool ignoreOnError, DebugInfo di, Dictionary::Ptr scope);
};
}
* @param input Input stream for the configuration file.
* @param zone The zone.
*/
-ConfigCompiler::ConfigCompiler(const String& path, std::istream *input,
- const String& zone, const String& package)
- : m_Path(path), m_Input(input), m_Zone(zone), m_Package(package),
- m_Eof(false), m_OpenBraces(0)
+ConfigCompiler::ConfigCompiler(String path, std::istream *input,
+ String zone, String package)
+ : m_Path(std::move(path)), m_Input(input), m_Zone(std::move(zone)),
+ m_Package(std::move(package)), m_Eof(false), m_OpenBraces(0)
{
InitializeScanner();
}
if (!empty) {
std::vector<String> paths;
- for (const ZoneFragment& zf : zoneDirs) {
+ paths.reserve(zoneDirs.size());
+for (const ZoneFragment& zf : zoneDirs) {
paths.push_back(zf.Path);
}
class ConfigCompiler
{
public:
- explicit ConfigCompiler(const String& path, std::istream *input,
- const String& zone = String(), const String& package = String());
+ explicit ConfigCompiler(String path, std::istream *input,
+ String zone = String(), String package = String());
virtual ~ConfigCompiler();
std::unique_ptr<Expression> Compile();
* @param exprl Expression list for the item.
* @param debuginfo Debug information.
*/
-ConfigItem::ConfigItem(const Type::Ptr& type, const String& name,
- bool abstract, const std::shared_ptr<Expression>& exprl,
- const std::shared_ptr<Expression>& filter, bool defaultTmpl, bool ignoreOnError,
- const DebugInfo& debuginfo, const Dictionary::Ptr& scope,
- const String& zone, const String& package)
- : m_Type(type), m_Name(name), m_Abstract(abstract),
- m_Expression(exprl), m_Filter(filter),
+ConfigItem::ConfigItem(Type::Ptr type, String name,
+ bool abstract, std::shared_ptr<Expression> exprl,
+ std::shared_ptr<Expression> filter, bool defaultTmpl, bool ignoreOnError,
+ DebugInfo debuginfo, Dictionary::Ptr scope,
+ String zone, String package)
+ : m_Type(std::move(type)), m_Name(std::move(name)), m_Abstract(abstract),
+ m_Expression(std::move(exprl)), m_Filter(std::move(filter)),
m_DefaultTmpl(defaultTmpl), m_IgnoreOnError(ignoreOnError),
- m_DebugInfo(debuginfo), m_Scope(scope), m_Zone(zone),
- m_Package(package)
+ m_DebugInfo(std::move(debuginfo)), m_Scope(std::move(scope)), m_Zone(std::move(zone)),
+ m_Package(std::move(package))
{
}
public:
DECLARE_PTR_TYPEDEFS(ConfigItem);
- ConfigItem(const Type::Ptr& type, const String& name, bool abstract,
- const std::shared_ptr<Expression>& exprl,
- const std::shared_ptr<Expression>& filter,
- bool defaultTmpl, bool ignoreOnError, const DebugInfo& debuginfo,
- const Dictionary::Ptr& scope, const String& zone,
- const String& package);
+ ConfigItem(Type::Ptr type, String name, bool abstract,
+ std::shared_ptr<Expression> exprl,
+ std::shared_ptr<Expression> filter,
+ bool defaultTmpl, bool ignoreOnError, DebugInfo debuginfo,
+ Dictionary::Ptr scope, String zone,
+ String package);
Type::Ptr GetType() const;
String GetName() const;
m_Inline = true;
}
-LiteralExpression::LiteralExpression(const Value& value)
- : m_Value(value)
+LiteralExpression::LiteralExpression(Value value)
+ : m_Value(std::move(value))
{ }
ExpressionResult LiteralExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
struct DebugHint
{
public:
- DebugHint(const Dictionary::Ptr& hints = nullptr)
- : m_Hints(hints)
+ DebugHint(Dictionary::Ptr hints = nullptr)
+ : m_Hints(std::move(hints))
{ }
DebugHint(Dictionary::Ptr&& hints)
{
public:
template<typename T>
- ExpressionResult(const T& value, ExpressionResultCode code = ResultOK)
- : m_Value(value), m_Code(code)
+ ExpressionResult(T value, ExpressionResultCode code = ResultOK)
+ : m_Value(std::move(value)), m_Code(code)
{ }
operator const Value&() const
class OwnedExpression final : public Expression
{
public:
- OwnedExpression(const std::shared_ptr<Expression>& expression)
- : m_Expression(expression)
+ OwnedExpression(std::shared_ptr<Expression> expression)
+ : m_Expression(std::move(expression))
{ }
protected:
class LiteralExpression final : public Expression
{
public:
- LiteralExpression(const Value& value = Value());
+ LiteralExpression(Value value = Value());
const Value& GetValue() const
{
class DebuggableExpression : public Expression
{
public:
- DebuggableExpression(const DebugInfo& debugInfo = DebugInfo())
- : m_DebugInfo(debugInfo)
+ DebuggableExpression(DebugInfo debugInfo = DebugInfo())
+ : m_DebugInfo(std::move(debugInfo))
{ }
protected:
class VariableExpression final : public DebuggableExpression
{
public:
- VariableExpression(const String& variable, const DebugInfo& debugInfo = DebugInfo())
- : DebuggableExpression(debugInfo), m_Variable(variable)
+ VariableExpression(String variable, const DebugInfo& debugInfo = DebugInfo())
+ : DebuggableExpression(debugInfo), m_Variable(std::move(variable))
{ }
String GetVariable() const
class FunctionExpression final : public DebuggableExpression
{
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())
- : 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:
class ApplyExpression final : public DebuggableExpression
{
public:
- ApplyExpression(const String& type, const String& target, std::unique_ptr<Expression> name,
- std::unique_ptr<Expression> filter, const String& package, const String& fkvar, const String& fvvar,
+ ApplyExpression(String type, String target, std::unique_ptr<Expression> name,
+ 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> expression, const DebugInfo& debugInfo = DebugInfo())
- : DebuggableExpression(debugInfo), m_Type(type), m_Target(target),
- m_Name(std::move(name)), m_Filter(std::move(filter)), m_Package(package), m_FKVar(fkvar), m_FVVar(fvvar),
+ : DebuggableExpression(debugInfo), m_Type(std::move(type)), m_Target(std::move(target)),
+ 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_Expression(std::move(expression))
{ }
{
public:
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())
: 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))
{ }
class ForExpression final : public DebuggableExpression
{
public:
- ForExpression(const String& fkvar, const 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))
+ ForExpression(String fkvar, String fvvar, std::unique_ptr<Expression> value, std::unique_ptr<Expression> expression, const DebugInfo& debugInfo = DebugInfo())
+ : DebuggableExpression(debugInfo), m_FKVar(std::move(fkvar)), m_FVVar(std::move(fvvar)), m_Value(std::move(value)), m_Expression(std::move(expression))
{ }
protected:
class IncludeExpression final : public DebuggableExpression
{
public:
- IncludeExpression(const 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())
- : DebuggableExpression(debugInfo), m_RelativeBase(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)
+ IncludeExpression(String relativeBase, std::unique_ptr<Expression> path, std::unique_ptr<Expression> pattern, std::unique_ptr<Expression> name,
+ IncludeType type, bool searchIncludes, String zone, String package, const DebugInfo& debugInfo = DebugInfo())
+ : 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(std::move(zone)), m_Package(std::move(package))
{ }
protected:
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")
<< "add log entry history for '" << checkable->GetName() << "'";
static void AddDowntimes(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 */
static void NextCheckUpdatedHandler(const Checkable::Ptr& checkable);
INITIALIZE_ONCE(&DbObject::StaticInitialize);
-DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2)
- : m_Name1(name1), m_Name2(name2), m_Type(type), m_LastConfigUpdate(0), m_LastStatusUpdate(0)
+DbObject::DbObject(intrusive_ptr<DbType> type, String name1, String name2)
+ : m_Name1(std::move(name1)), m_Name2(std::move(name2)), m_Type(std::move(type)), m_LastConfigUpdate(0), m_LastStatusUpdate(0)
{ }
void DbObject::StaticInitialize()
virtual String CalculateConfigHash(const Dictionary::Ptr& configFields) const;
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 OnConfigUpdateLight();
using namespace icinga;
-DbType::DbType(const String& name, const String& table, long tid, const String& idcolumn, const DbType::ObjectFactory& factory)
- : m_Name(name), m_Table(table), m_TypeID(tid), m_IDColumn(idcolumn), m_ObjectFactory(factory)
+DbType::DbType(String name, String table, long tid, String idcolumn, DbType::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
typedef std::map<String, DbType::Ptr> TypeMap;
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 GetTable() const;
using namespace icinga;
-DbValue::DbValue(DbValueType type, const Value& value)
- : m_Type(type), m_Value(value)
+DbValue::DbValue(DbValueType type, Value value)
+ : m_Type(type), m_Value(std::move(value))
{ }
Value DbValue::FromTimestamp(const Value& ts)
public:
DECLARE_PTR_TYPEDEFS(DbValue);
- DbValue(DbValueType type, const Value& value);
+ DbValue(DbValueType type, Value value);
static Value FromTimestamp(const Value& ts);
static Value FromTimestampNow();
#include "base/exception.hpp"
#include "base/statsfunction.hpp"
#include <boost/tuple/tuple.hpp>
+#include <utility>
using namespace icinga;
Log(LogCritical, "IdoMysqlConnection", "Exception during database operation: Verify that your database is operational!");
Log(LogDebug, "IdoMysqlConnection")
- << "Exception during database operation: " << DiagnosticInformation(exp);
+ << "Exception during database operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) {
m_Mysql->close(&m_Connection);
#include "base/context.hpp"
#include "base/statsfunction.hpp"
#include <boost/tuple/tuple.hpp>
+#include <utility>
using namespace icinga;
Log(LogWarning, "IdoPgsqlConnection", "Exception during database operation: Verify that your database is operational!");
Log(LogDebug, "IdoPgsqlConnection")
- << "Exception during database operation: " << DiagnosticInformation(exp);
+ << "Exception during database operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) {
m_Pgsql->finish(m_Connection);
return result;
}
-String CompatUtility::GetCommandNamePrefix(const Command::Ptr command)
+String CompatUtility::GetCommandNamePrefix(const Command::Ptr& command)
{
if (!command)
return Empty;
return prefix;
}
-String CompatUtility::GetCommandName(const Command::Ptr command)
+String CompatUtility::GetCommandName(const Command::Ptr& command)
{
if (!command)
return Empty;
public:
/* command */
static String GetCommandLine(const Command::Ptr& command);
- static String GetCommandName(const Command::Ptr command);
+ static String GetCommandName(const Command::Ptr& command);
/* host */
static int GetHostCurrentState(const Host::Ptr& host);
private:
CompatUtility();
- static String GetCommandNamePrefix(const Command::Ptr command);
+ static String GetCommandNamePrefix(const Command::Ptr& command);
};
}
#include "icinga/i2-icinga.hpp"
#include "icinga/scheduleddowntime.thpp"
#include "icinga/checkable.hpp"
-#include <utility>
namespace icinga
{
#include "icinga/service.thpp"
#include "icinga/macroresolver.hpp"
#include "icinga/host.hpp"
-#include <utility>
#include <tuple>
using std::tie;
using namespace icinga;
-AttributeFilter::AttributeFilter(const String& column, const String& op, const String& operand)
- : m_Column(column), m_Operator(op), m_Operand(operand)
+AttributeFilter::AttributeFilter(String column, String op, String 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)
public:
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;
using namespace icinga;
-AvgAggregator::AvgAggregator(const String& attr)
- : m_AvgAttr(attr)
+AvgAggregator::AvgAggregator(String attr)
+ : m_AvgAttr(std::move(attr))
{ }
AvgAggregatorState *AvgAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(AvgAggregator);
- AvgAggregator(const String& attr);
+ AvgAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
using namespace icinga;
-Column::Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor)
- : m_ValueAccessor(valueAccessor), m_ObjectAccessor(objectAccessor)
+Column::Column(ValueAccessor valueAccessor, 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
typedef std::function<Value (const Value&)> ValueAccessor;
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;
virtual bool Apply(const Table::Ptr& table, const Value& row) = 0;
protected:
- Filter();
+ Filter() = default;
};
}
using namespace icinga;
-InvAvgAggregator::InvAvgAggregator(const String& attr)
- : m_InvAvgAttr(attr)
+InvAvgAggregator::InvAvgAggregator(String attr)
+ : m_InvAvgAttr(std::move(attr))
{ }
InvAvgAggregatorState *InvAvgAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(InvAvgAggregator);
- InvAvgAggregator(const String& attr);
+ InvAvgAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
using namespace icinga;
-InvSumAggregator::InvSumAggregator(const String& attr)
- : m_InvSumAttr(attr)
+InvSumAggregator::InvSumAggregator(String attr)
+ : m_InvSumAttr(std::move(attr))
{ }
InvSumAggregatorState *InvSumAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(InvSumAggregator);
- InvSumAggregator(const String& attr);
+ InvSumAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
int index = 0;
- for (const Aggregator::Ptr aggregator : m_Aggregators) {
+ for (const Aggregator::Ptr& aggregator : m_Aggregators) {
aggregator->Apply(table, object.Row, &stats[index]);
index++;
}
using namespace icinga;
-MaxAggregator::MaxAggregator(const String& attr)
- : m_MaxAttr(attr)
+MaxAggregator::MaxAggregator(String attr)
+ : m_MaxAttr(std::move(attr))
{ }
MaxAggregatorState *MaxAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(MaxAggregator);
- MaxAggregator(const String& attr);
+ MaxAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
using namespace icinga;
-MinAggregator::MinAggregator(const String& attr)
- : m_MinAttr(attr)
+MinAggregator::MinAggregator(String attr)
+ : m_MinAttr(std::move(attr))
{ }
MinAggregatorState *MinAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(MinAggregator);
- MinAggregator(const String& attr);
+ MinAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
using namespace icinga;
-NegateFilter::NegateFilter(const Filter::Ptr& inner)
- : m_Inner(inner)
+NegateFilter::NegateFilter(Filter::Ptr inner)
+ : m_Inner(std::move(inner))
{ }
bool NegateFilter::Apply(const Table::Ptr& table, const Value& row)
public:
DECLARE_PTR_TYPEDEFS(NegateFilter);
- NegateFilter(const Filter::Ptr& inner);
+ NegateFilter(Filter::Ptr inner);
bool Apply(const Table::Ptr& table, const Value& row) override;
using namespace icinga;
-StdAggregator::StdAggregator(const String& attr)
- : m_StdAttr(attr)
+StdAggregator::StdAggregator(String attr)
+ : m_StdAttr(std::move(attr))
{ }
StdAggregatorState *StdAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(StdAggregator);
- StdAggregator(const String& attr);
+ StdAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
using namespace icinga;
-SumAggregator::SumAggregator(const String& attr)
- : m_SumAttr(attr)
+SumAggregator::SumAggregator(String attr)
+ : m_SumAttr(std::move(attr))
{ }
SumAggregatorState *SumAggregator::EnsureState(AggregatorState **state)
public:
DECLARE_PTR_TYPEDEFS(SumAggregator);
- SumAggregator(const String& attr);
+ SumAggregator(String attr);
void Apply(const Table::Ptr& table, const Value& row, AggregatorState **state) override;
double GetResultAndFreeState(AggregatorState *state) const override;
Array::Ptr endpoint_names = new Array();
- for (const Endpoint::Ptr endpoint : endpoints) {
+ for (const Endpoint::Ptr& endpoint : endpoints) {
endpoint_names->Add(endpoint->GetName());
}
double bytesSentPerSecond = 0;
double bytesReceivedPerSecond = 0;
- for (Endpoint::Ptr endpoint : endpoints)
+ for (const Endpoint::Ptr& endpoint : endpoints)
{
if (endpoint->GetLastMessageSent() > lastMessageSent)
lastMessageSent = endpoint->GetLastMessageSent();
#include "base/statsfunction.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
+#include <utility>
using namespace icinga;
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. */
boost::mutex::scoped_lock lock(m_DataBufferMutex);
Log(LogCritical, "ElasticsearchWriter", "Exception during Elastic operation: Verify that your backend is operational!");
Log(LogDebug, "ElasticsearchWriter")
- << "Exception during Elasticsearch operation: " << DiagnosticInformation(exp);
+ << "Exception during Elasticsearch operation: " << DiagnosticInformation(std::move(exp));
}
String ElasticsearchWriter::FormatTimestamp(double ts)
const Checkable::Ptr& checkable, const std::set<User::Ptr>& users, NotificationType type,
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();
void AssertOnWorkQueue();
#include "base/json.hpp"
#include "base/statsfunction.hpp"
#include <boost/algorithm/string/replace.hpp>
+#include <utility>
using namespace icinga;
Log(LogCritical, "GelfWriter", "Exception during Graylog Gelf operation: Verify that your backend is operational!");
Log(LogDebug, "GelfWriter")
- << "Exception during Graylog Gelf operation: " << DiagnosticInformation(exp);
+ << "Exception during Graylog Gelf operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) {
m_Stream->Close();
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp>
+#include <utility>
using namespace icinga;
Log(LogCritical, "GraphiteWriter", "Exception during Graphite operation: Verify that your backend is operational!");
Log(LogDebug, "GraphiteWriter")
- << "Exception during Graphite operation: " << DiagnosticInformation(exp);
+ << "Exception during Graphite operation: " << DiagnosticInformation(std::move(exp));
if (GetConnected()) {
m_Stream->Close();
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/regex.hpp>
#include <boost/scoped_array.hpp>
+#include <utility>
using namespace icinga;
Log(LogCritical, "InfluxdbWriter", "Exception during InfluxDB operation: Verify that your backend is operational!");
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.
}
using namespace icinga;
-ApiAction::ApiAction(const std::vector<String>& types, const Callback& action)
- : m_Types(types), m_Callback(action)
+ApiAction::ApiAction(std::vector<String> types, Callback action)
+ : m_Types(std::move(types)), m_Callback(std::move(action))
{ }
Value ApiAction::Invoke(const ConfigObject::Ptr& target, const Dictionary::Ptr& params)
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);
using namespace icinga;
ApiClient::ApiClient(const String& host, const String& port,
- const String& user, const String& password)
- : m_Connection(new HttpClientConnection(host, port, true)), m_User(user), m_Password(password)
+ String user, String password)
+ : m_Connection(new HttpClientConnection(host, port, true)), m_User(std::move(user)), m_Password(std::move(password))
{
m_Connection->Start();
}
DECLARE_PTR_TYPEDEFS(ApiClient);
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;
void GetTypes(const TypesCompletionCallback& callback) const;
using namespace icinga;
-ApiFunction::ApiFunction(const Callback& function)
- : m_Callback(function)
+ApiFunction::ApiFunction(Callback function)
+ : m_Callback(std::move(function))
{ }
Value ApiFunction::Invoke(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& arguments)
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);
using namespace icinga;
-EventQueue::EventQueue(const String& name)
- : m_Name(name)
+EventQueue::EventQueue(String name)
+ : m_Name(std::move(name))
{ }
bool EventQueue::CanProcessEvent(const String& type) const
public:
DECLARE_PTR_TYPEDEFS(EventQueue);
- EventQueue(const String& name);
+ EventQueue(String name);
bool CanProcessEvent(const String& type) const;
void ProcessEvent(const Dictionary::Ptr& event);
using namespace icinga;
-HttpClientConnection::HttpClientConnection(const String& host, const String& port, bool tls)
- : m_Host(host), m_Port(port), m_Tls(tls)
+HttpClientConnection::HttpClientConnection(String host, String port, bool tls)
+ : m_Host(std::move(host)), m_Port(std::move(port)), m_Tls(tls)
{ }
void HttpClientConnection::Start()
public:
DECLARE_PTR_TYPEDEFS(HttpClientConnection);
- HttpClientConnection(const String& host, const String& port, bool tls = true);
+ HttpClientConnection(String host, String port, bool tls = true);
void Start();
using namespace icinga;
-HttpRequest::HttpRequest(const Stream::Ptr& stream)
+HttpRequest::HttpRequest(Stream::Ptr stream)
: Complete(false),
ProtocolVersion(HttpVersion11),
Headers(new Dictionary()),
- m_Stream(stream),
+ m_Stream(std::move(stream)),
m_State(HttpRequestStart)
{ }
Dictionary::Ptr Headers;
- HttpRequest(const Stream::Ptr& stream);
+ HttpRequest(Stream::Ptr stream);
bool Parse(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count);
using namespace icinga;
-HttpResponse::HttpResponse(const Stream::Ptr& stream, const HttpRequest& request)
- : Complete(false), m_State(HttpResponseStart), m_Request(request), m_Stream(stream)
+HttpResponse::HttpResponse(Stream::Ptr stream, const HttpRequest& request)
+ : Complete(false), m_State(HttpResponseStart), m_Request(request), m_Stream(std::move(stream))
{ }
void HttpResponse::SetStatus(int code, const String& message)
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);
size_t ReadBody(char *data, size_t count);
static Timer::Ptr l_HeartbeatTimer;
JsonRpcConnection::JsonRpcConnection(const String& identity, bool authenticated,
- const TlsStream::Ptr& stream, ConnectionRole role)
- : m_ID(l_JsonRpcConnectionNextID++), m_Identity(identity), m_Authenticated(authenticated), m_Stream(stream),
+ TlsStream::Ptr stream, ConnectionRole role)
+ : 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)
{
boost::call_once(l_JsonRpcConnectionOnceFlag, &JsonRpcConnection::StaticInitialize);
public:
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();
// Array
String temp;
- for (const String s : kv.second) {
+ for (const String& s : kv.second) {
if (!temp.IsEmpty())
temp += "&";
bool Url::ParsePath(const String& path)
{
- std::string pathStr = path;
+ const std::string& pathStr = path;
boost::char_separator<char> sep("/");
boost::tokenizer<boost::char_separator<char> > tokens(pathStr, sep);
bool Url::ParseQuery(const String& query)
{
/* Tokenizer does not like String AT ALL */
- std::string queryStr = query;
+ const std::string& queryStr = query;
boost::char_separator<char> sep("&");
boost::tokenizer<boost::char_separator<char> > tokens(queryStr, sep);
#include <stdexcept>
#include <map>
#include <set>
+#include <utility>
#include <vector>
#include <cstring>
#include <locale>
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)
- : 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();
}
#include <string>
#include <istream>
+#include <utility>
#include <vector>
#include <algorithm>
#include <map>
std::string Accessor;
bool Pure;
- FieldAccessor(FieldAccessorType type, const std::string& accessor, bool pure)
- : Type(type), Accessor(accessor), Pure(pure)
+ FieldAccessor(FieldAccessorType type, std::string accessor, bool pure)
+ : Type(type), Accessor(std::move(accessor)), Pure(pure)
{ }
};
class ClassCompiler
{
public:
- ClassCompiler(const std::string& path, std::istream& input, std::ostream& oimpl, std::ostream& oheader);
+ ClassCompiler(std::string path, std::istream& input, std::ostream& oimpl, std::ostream& oheader);
~ClassCompiler();
void Compile();