icinga2/lib/base/scriptglobal.hpp

36 lines
665 B
C++
Raw Permalink Normal View History

/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef SCRIPTGLOBAL_H
#define SCRIPTGLOBAL_H
#include "base/i2-base.hpp"
2018-08-07 07:55:41 -04:00
#include "base/namespace.hpp"
namespace icinga
{
/**
* Global script variables.
*
* @ingroup base
*/
2017-12-31 01:22:16 -05:00
class ScriptGlobal
{
public:
2017-12-14 09:37:20 -05:00
static Value Get(const String& name, const Value *defaultValue = nullptr);
static void Set(const String& name, const Value& value);
2018-08-07 07:55:41 -04:00
static void SetConst(const String& name, const Value& value);
static bool Exists(const String& name);
static void WriteToFile(const String& filename);
2018-08-07 07:55:41 -04:00
static Namespace::Ptr GetGlobals();
private:
2018-08-07 07:55:41 -04:00
static Namespace::Ptr m_Globals;
};
}
#endif /* SCRIPTGLOBAL_H */