From 56ae875861ab260b80a030f50c4aff9f9dc8fff0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:32:39 +0200 Subject: Adding upstream version 2.14.2. Signed-off-by: Daniel Baumann --- lib/base/scriptframe.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lib/base/scriptframe.hpp (limited to 'lib/base/scriptframe.hpp') diff --git a/lib/base/scriptframe.hpp b/lib/base/scriptframe.hpp new file mode 100644 index 0000000..18e23ef --- /dev/null +++ b/lib/base/scriptframe.hpp @@ -0,0 +1,42 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +#ifndef SCRIPTFRAME_H +#define SCRIPTFRAME_H + +#include "base/i2-base.hpp" +#include "base/dictionary.hpp" +#include "base/array.hpp" +#include +#include + +namespace icinga +{ + +struct ScriptFrame +{ + Dictionary::Ptr Locals; + Value Self; + bool Sandboxed; + int Depth; + + ScriptFrame(bool allocLocals); + ScriptFrame(bool allocLocals, Value self); + ~ScriptFrame(); + + void IncreaseStackDepth(); + void DecreaseStackDepth(); + + static ScriptFrame *GetCurrentFrame(); + +private: + static boost::thread_specific_ptr > m_ScriptFrames; + + static void PushFrame(ScriptFrame *frame); + static ScriptFrame *PopFrame(); + + void InitializeFrame(); +}; + +} + +#endif /* SCRIPTFRAME_H */ -- cgit v1.2.3