<< "***" << "\n";
}
+String Application::GetCrashReportFilename(void)
+{
+ return GetLocalStateDir() + "/log/icinga2/crash/report." + Convert::ToString(Utility::GetTime());
+}
+
#ifndef _WIN32
/**
* Signal handler for SIGINT and SIGTERM. Prepares the application for cleanly
RequestReopenLogs();
}
-String Application::GetCrashReportFilename(void)
-{
- return GetLocalStateDir() + "/log/icinga2/crash/report." + Convert::ToString(Utility::GetTime());
-}
-
/**
* Signal handler for SIGABRT. Helps with debugging ASSERT()s.
*
using namespace icinga;
boost::thread_specific_ptr<ScriptFrame *> ScriptFrame::m_CurrentFrame;
+
+ScriptFrame::ScriptFrame(void)
+ : Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals())
+{
+ NextFrame = GetCurrentFrame();
+ SetCurrentFrame(this);
+}
+
+ScriptFrame::ScriptFrame(const Value& self)
+ : Locals(new Dictionary()), Self(self)
+{
+ NextFrame = GetCurrentFrame();
+ SetCurrentFrame(this);
+}
+
+ScriptFrame::~ScriptFrame(void)
+{
+ ASSERT(GetCurrentFrame() == this);
+ SetCurrentFrame(NextFrame);
+}
+
+ScriptFrame *ScriptFrame::GetCurrentFrame(void)
+{
+ ScriptFrame **pframe = m_CurrentFrame.get();
+
+ if (pframe)
+ return *pframe;
+ else
+ return NULL;
+}
+
+void ScriptFrame::SetCurrentFrame(ScriptFrame *frame)
+{
+ m_CurrentFrame.reset(new ScriptFrame *(frame));
+}
\ No newline at end of file
Value Self;
ScriptFrame *NextFrame;
- ScriptFrame(void)
- : Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals())
- {
- NextFrame = GetCurrentFrame();
- SetCurrentFrame(this);
- }
+ ScriptFrame(void);
+ ScriptFrame(const Value& self);
+ ~ScriptFrame(void);
- ScriptFrame(const Value& self)
- : Locals(new Dictionary()), Self(self)
- {
- NextFrame = GetCurrentFrame();
- SetCurrentFrame(this);
- }
-
- ~ScriptFrame(void)
- {
- ASSERT(GetCurrentFrame() == this);
- SetCurrentFrame(NextFrame);
- }
-
- static inline ScriptFrame *GetCurrentFrame(void)
- {
- ScriptFrame **pframe = m_CurrentFrame.get();
-
- if (pframe)
- return *pframe;
- else
- return NULL;
- }
+ static ScriptFrame *GetCurrentFrame(void);
private:
static boost::thread_specific_ptr<ScriptFrame *> m_CurrentFrame;
- static inline void SetCurrentFrame(ScriptFrame *frame)
- {
- m_CurrentFrame.reset(new ScriptFrame *(frame));
- }
+ static void SetCurrentFrame(ScriptFrame *frame);
};
}