icinga2/lib/base/configobject.ti
Yonas Habteab 29a5268961 Replace all existing copyright headers with SPDX headers
I've used the following command to replace the original copyright header
lines in a C-style comment block:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

And for SQL files:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
2026-02-03 17:54:50 +01:00

95 lines
2.2 KiB
Text

// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "base/debuginfo.hpp"
#include "base/configtype.hpp"
library base;
namespace icinga
{
code {{{
enum HAMode
{
HARunOnce,
HARunEverywhere
};
class NameComposer
{
public:
virtual ~NameComposer();
virtual String MakeName(const String& shortName, const Object::Ptr& context) const = 0;
virtual Dictionary::Ptr ParseName(const String& name) const = 0;
};
}}}
abstract class ConfigObjectBase
{ };
code {{{
class ConfigObjectBase : public ObjectImpl<ConfigObjectBase>
{
public:
inline DebugInfo GetDebugInfo() const
{
return m_DebugInfo;
}
void SetDebugInfo(const DebugInfo& di)
{
m_DebugInfo = di;
}
inline virtual void Start(bool /* runtimeCreated */)
{ }
inline virtual void Stop(bool /* runtimeRemoved */)
{ }
private:
DebugInfo m_DebugInfo;
};
}}}
abstract class ConfigObject : ConfigObjectBase < ConfigType
{
[config, no_user_modify] String __name (Name);
[config, no_user_modify, required] String "name" (ShortName) {
get {{{
String shortName = m_ShortName.load();
if (shortName.IsEmpty())
return GetName();
else
return shortName;
}}}
};
[config, no_user_modify] name(Zone) zone (ZoneName);
[config, no_user_modify] String package;
[config, get_protected, no_user_modify] Array::Ptr templates;
[config, no_storage, no_user_modify] Dictionary::Ptr source_location {
get;
};
[get_protected, no_user_modify] bool active;
[get_protected, no_user_modify] bool paused {
default {{{ return true; }}}
};
[get_protected, no_user_view, no_user_modify] bool start_called;
[get_protected, no_user_view, no_user_modify] bool stop_called;
[get_protected, no_user_view, no_user_modify] bool pause_called;
[get_protected, no_user_view, no_user_modify] bool resume_called;
[enum] HAMode ha_mode (HAMode);
[protected, no_user_view, no_user_modify] Dictionary::Ptr extensions;
[protected, no_user_view, no_user_modify] bool state_loaded;
[no_user_modify] Dictionary::Ptr original_attributes;
[state, no_user_modify] double version {
default {{{ return 0; }}}
};
[no_user_view, no_user_modify] String icingadb_identifier;
};
}