1 /******************************************************************************
3 * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software Foundation *
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ******************************************************************************/
20 #include "base/debuginfo.hpp"
21 #include "base/configtype.hpp"
38 virtual ~NameComposer();
40 virtual String MakeName(const String& shortName, const Object::Ptr& context) const = 0;
41 virtual Dictionary::Ptr ParseName(const String& name) const = 0;
45 abstract class ConfigObjectBase
49 class ConfigObjectBase : public ObjectImpl<ConfigObjectBase>
52 inline DebugInfo GetDebugInfo() const
57 void SetDebugInfo(const DebugInfo& di)
62 inline virtual void Start(bool /* runtimeCreated */)
65 inline virtual void Stop(bool /* runtimeRemoved */)
69 DebugInfo m_DebugInfo;
74 abstract class ConfigObject : ConfigObjectBase < ConfigType
76 [config, no_user_modify] String __name (Name);
77 [config, no_user_modify] String "name" (ShortName) {
79 if (m_ShortName.IsEmpty())
85 [config, no_user_modify] name(Zone) zone (ZoneName);
86 [config, no_user_modify] String package;
87 [config, get_protected, no_user_modify] Array::Ptr templates;
88 [config, no_storage, no_user_modify] Dictionary::Ptr source_location {
91 [get_protected, no_user_modify] bool active;
92 [get_protected, no_user_modify] bool paused {
93 default {{{ return true; }}}
95 [get_protected, no_user_view, no_user_modify] bool start_called;
96 [get_protected, no_user_view, no_user_modify] bool stop_called;
97 [get_protected, no_user_view, no_user_modify] bool pause_called;
98 [get_protected, no_user_view, no_user_modify] bool resume_called;
99 [enum] HAMode ha_mode (HAMode);
100 [protected, no_user_view, no_user_modify] Dictionary::Ptr extensions;
102 [protected, no_user_view, no_user_modify] bool state_loaded;
103 [no_user_modify] Dictionary::Ptr original_attributes;
104 [state, no_user_modify] double version {
105 default {{{ return 0; }}}