mirror of https://github.com/Icinga/icinga2.git
parent
1728095c53
commit
c818d94d93
|
@ -27,16 +27,22 @@ using namespace icinga;
|
|||
|
||||
void ConfigCompilerContext::AddMessage(bool error, const String& message)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
m_Messages.push_back(ConfigCompilerMessage(error, message));
|
||||
}
|
||||
|
||||
std::vector<ConfigCompilerMessage> ConfigCompilerContext::GetMessages(void) const
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
return m_Messages;
|
||||
}
|
||||
|
||||
bool ConfigCompilerContext::HasErrors(void) const
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
BOOST_FOREACH(const ConfigCompilerMessage& message, m_Messages) {
|
||||
if (message.Error)
|
||||
return true;
|
||||
|
@ -47,6 +53,8 @@ bool ConfigCompilerContext::HasErrors(void) const
|
|||
|
||||
void ConfigCompilerContext::Reset(void)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
m_Messages.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,8 @@ public:
|
|||
|
||||
private:
|
||||
std::vector<ConfigCompilerMessage> m_Messages;
|
||||
|
||||
mutable boost::mutex m_Mutex;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue