]> granicus.if.org Git - icinga2/blob - lib/config/configcompilercontext.hpp
Merge pull request #6999 from Icinga/bugfix/compiler-warnings
[icinga2] / lib / config / configcompilercontext.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef CONFIGCOMPILERCONTEXT_H
4 #define CONFIGCOMPILERCONTEXT_H
5
6 #include "config/i2-config.hpp"
7 #include "base/dictionary.hpp"
8 #include <boost/thread/mutex.hpp>
9 #include <fstream>
10
11 namespace icinga
12 {
13
14 /*
15  * @ingroup config
16  */
17 class ConfigCompilerContext
18 {
19 public:
20         void OpenObjectsFile(const String& filename);
21         void WriteObject(const Dictionary::Ptr& object);
22         void CancelObjectsFile();
23         void FinishObjectsFile();
24
25         static ConfigCompilerContext *GetInstance();
26
27 private:
28         String m_ObjectsPath;
29         String m_ObjectsTempFile;
30         std::fstream *m_ObjectsFP{nullptr};
31
32         mutable boost::mutex m_Mutex;
33 };
34
35 }
36
37 #endif /* CONFIGCOMPILERCONTEXT_H */