From: Gunnar Beutner Date: Fri, 25 May 2012 09:10:11 +0000 (+0200) Subject: Added preliminary version of the dynamic object framework. X-Git-Tag: v0.0.1~494 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04aaf2f3543c526ea6152ece69d26c1432cfd0d4;p=icinga2 Added preliminary version of the dynamic object framework. --- diff --git a/base/configobject.cpp b/base/configobject.cpp index 9e015da49..65ac03941 100644 --- a/base/configobject.cpp +++ b/base/configobject.cpp @@ -112,7 +112,7 @@ void ConfigObject::SetReplicated(bool replicated) * * @returns Whether this object was replicated. */ -bool ConfigObject::GetReplicated(void) const +bool ConfigObject::IsReplicated(void) const { return m_Replicated; } diff --git a/base/configobject.h b/base/configobject.h index 5ecb6d028..8871d8c50 100644 --- a/base/configobject.h +++ b/base/configobject.h @@ -50,7 +50,7 @@ public: string GetType(void) const; void SetReplicated(bool replicated); - bool GetReplicated(void) const; + bool IsReplicated(void) const; void Commit(void); diff --git a/base/dictionary.h b/base/dictionary.h index eef9587f3..5cf00ac9f 100644 --- a/base/dictionary.h +++ b/base/dictionary.h @@ -57,6 +57,27 @@ public: return true; } + /** + * Retrieves a value from the dictionary. + * + * @param key The key. + * @param[out] value Pointer to the value. + * @returns true if the value was retrieved, false otherwise. + */ + bool GetProperty(string key, Dictionary::Ptr *value) + { + Object::Ptr object; + + if (!GetProperty(key, &object)) + return false; + + *value = dynamic_pointer_cast(object); + if (!*value) + throw InvalidCastException(); + + return true; + } + /** * Sets a value in the dictionary. * diff --git a/base/tcpsocket.cpp b/base/tcpsocket.cpp index 3e3c00877..97733e977 100644 --- a/base/tcpsocket.cpp +++ b/base/tcpsocket.cpp @@ -55,6 +55,7 @@ void TcpSocket::Bind(string service, int family) /** * Creates a socket and binds it to the specified node and service. * + * @param node The node. * @param service The service. * @param family The address family for the socket. */ diff --git a/base/variant.cpp b/base/variant.cpp index dcf148e5d..b41f0b0c9 100644 --- a/base/variant.cpp +++ b/base/variant.cpp @@ -64,6 +64,18 @@ long Variant::GetInteger(void) const return m_IntegerValue; } +/** + * Retrieves the variant's value as a bool. + * + * @returns The variant's value as a bool. + */ +long Variant::GetBool(void) const +{ + Convert(VariantInteger); + + return (m_IntegerValue != 0); +} + /** * Retrieves the variant's value as a string. * @@ -108,6 +120,16 @@ Variant::operator long(void) const return GetInteger(); } +/** + * Retrieves the variant's value as a bool. + * + * @returns The variant's value as a bool. + */ +Variant::operator bool(void) const +{ + return GetBool(); +} + /** * Retrieves the variant's value as a string. * diff --git a/base/variant.h b/base/variant.h index 4545e1dae..b2e24382e 100644 --- a/base/variant.h +++ b/base/variant.h @@ -50,6 +50,9 @@ public: inline Variant(int value) : m_Type(VariantInteger), m_IntegerValue(value) { } + inline Variant(bool value) + : m_Type(VariantInteger), m_IntegerValue(value ? 1 : 0) { } + inline Variant(long value) : m_Type(VariantInteger), m_IntegerValue(value) { } @@ -66,12 +69,14 @@ public: VariantType GetType(void) const; long GetInteger(void) const; + long GetBool(void) const; string GetString(void) const; Object::Ptr GetObject(void) const; bool IsEmpty(void) const; operator long(void) const; + operator bool(void) const; operator string(void) const; operator Object::Ptr(void) const; diff --git a/components/configrpc/configrpccomponent.cpp b/components/configrpc/configrpccomponent.cpp index 91c7767d3..37c2c3697 100644 --- a/components/configrpc/configrpccomponent.cpp +++ b/components/configrpc/configrpccomponent.cpp @@ -219,7 +219,7 @@ int ConfigRpcComponent::RemoteObjectRemovedHandler(const NewRequestEventArgs& ea if (!object) return 0; - if (object->GetReplicated()) + if (object->IsReplicated()) configHive->RemoveObject(object); return 0; diff --git a/components/demo/demo.vcxproj.filters b/components/demo/demo.vcxproj.filters index 51b6a0536..e02ed2da9 100644 --- a/components/demo/demo.vcxproj.filters +++ b/components/demo/demo.vcxproj.filters @@ -1,10 +1,24 @@  - - + + Headerdateien + + + Headerdateien + - + + {11a495bf-a705-4766-b3d3-9b5db266a6ef} + + + {1fb6337f-a17f-46ea-9316-2d800a94b53d} + + + + + Quelldateien + \ No newline at end of file diff --git a/components/discovery/discovery.vcxproj.filters b/components/discovery/discovery.vcxproj.filters index 36941f157..a356d8a92 100644 --- a/components/discovery/discovery.vcxproj.filters +++ b/components/discovery/discovery.vcxproj.filters @@ -1,12 +1,30 @@  - - + + Quelldateien + + + Quelldateien + - - - + + Headerdateien + + + Headerdateien + + + Headerdateien + + + + + {53341f7e-6bad-4cf1-92cf-be906efe1704} + + + {c7b2deba-743b-4449-ae46-0b7ba1b1350a} + \ No newline at end of file diff --git a/components/discovery/discoverycomponent.cpp b/components/discovery/discoverycomponent.cpp index 3ceb62211..815f35557 100644 --- a/components/discovery/discoverycomponent.cpp +++ b/components/discovery/discoverycomponent.cpp @@ -254,12 +254,12 @@ int DiscoveryComponent::WelcomeMessageHandler(const NewRequestEventArgs& nrea) { Endpoint::Ptr endpoint = nrea.Sender; - if (endpoint->GetReceivedWelcome()) + if (endpoint->HasReceivedWelcome()) return 0; endpoint->SetReceivedWelcome(true); - if (endpoint->GetSentWelcome()) { + if (endpoint->HasSentWelcome()) { EventArgs ea; ea.Source = endpoint; endpoint->OnSessionEstablished(ea); @@ -277,7 +277,7 @@ int DiscoveryComponent::WelcomeMessageHandler(const NewRequestEventArgs& nrea) */ void DiscoveryComponent::FinishDiscoverySetup(Endpoint::Ptr endpoint) { - if (endpoint->GetSentWelcome()) + if (endpoint->HasSentWelcome()) return; // we assume the other component _always_ wants @@ -289,7 +289,7 @@ void DiscoveryComponent::FinishDiscoverySetup(Endpoint::Ptr endpoint) endpoint->SetSentWelcome(true); - if (endpoint->GetReceivedWelcome()) { + if (endpoint->HasReceivedWelcome()) { EventArgs ea; ea.Source = endpoint; endpoint->OnSessionEstablished(ea); diff --git a/dyn/dyn.vcxproj b/dyn/dyn.vcxproj new file mode 100644 index 000000000..50d64aa19 --- /dev/null +++ b/dyn/dyn.vcxproj @@ -0,0 +1,94 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7} + Win32Proj + dyn + + + + DynamicLibrary + true + MultiByte + + + DynamicLibrary + false + true + MultiByte + + + + + + + + + + + + + $(SolutionDir)\base;$(IncludePath) + $(OutDir);$(LibraryPath) + + + $(SolutionDir)\base;$(IncludePath) + $(OutDir);$(LibraryPath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + base.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + base.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff --git a/dyn/dynamicdictionary.cpp b/dyn/dynamicdictionary.cpp new file mode 100644 index 000000000..5a7b05f49 --- /dev/null +++ b/dyn/dynamicdictionary.cpp @@ -0,0 +1,22 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-dyn.h" + +using namespace icinga; diff --git a/dyn/dynamicdictionary.h b/dyn/dynamicdictionary.h new file mode 100644 index 000000000..30aafe76a --- /dev/null +++ b/dyn/dynamicdictionary.h @@ -0,0 +1,79 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef DYNAMICDICTIONARY_H +#define DYNAMICDICTIONARY_H + +namespace icinga +{ + +enum DynamicDictionaryOperator +{ + OperatorSet, + OperatorPlus, + OperatorMinus, + OperatorMultiply, + OperatorDivide +}; + +struct DynamicDictionaryValue +{ + Variant Value; + DynamicDictionaryOperator Operator; +}; + +class DynamicDictionary : public Object +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + DynamicDictionary(void); + DynamicDictionary(Dictionary::Ptr serializedDictionary); + + void AddParent(DynamicDictionary::Ptr parent); + void ClearParents(void); + + template + bool GetProperty(string name, T *value, DynamicDictionaryOperator *op) const + { + map::const_iterator di; + + di = m_Values.find(name); + if (di == m_Values.end()) + return false; + + return di->second.op; + } + + template + void SetProperty(string name, const T& value, DynamicDictionaryOperator op); + + Dictionary::Ptr ToFlatDictionary(void) const; + + Dictionary::Ptr Serialize(void); + +private: + set m_Parents; + map m_Values; +}; + +} + +#endif /* DYNAMICDICTIONARY_H */ diff --git a/dyn/dynamicobject.cpp b/dyn/dynamicobject.cpp new file mode 100644 index 000000000..e61d3dd4f --- /dev/null +++ b/dyn/dynamicobject.cpp @@ -0,0 +1,90 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-dyn.h" + +using namespace icinga; + +DynamicDictionary::Ptr DynamicObject::GetProperties(void) const +{ + return m_Properties; +} + +void DynamicObject::SetProperties(DynamicDictionary::Ptr properties) +{ + m_Properties = properties; + Dictionary::Ptr resolvedProperties = properties->ToFlatDictionary(); + Reload(resolvedProperties); +} + +string DynamicObject::GetName(void) const +{ + return m_Name; +} + +void DynamicObject::SetName(string name) +{ + m_Name = name; +} + +string DynamicObject::GetType(void) const +{ + return m_Type; +} + +void DynamicObject::SetType(string type) +{ + m_Type = type; +} + +bool DynamicObject::IsLocal(void) const +{ + return m_Local; +} + +void DynamicObject::SetLocal(bool value) +{ + m_Local = value; +} + +bool DynamicObject::IsAbstract(void) const +{ + return m_Abstract; +} + +void DynamicObject::SetAbstract(bool value) +{ + m_Abstract = value; +} + +void DynamicObject::Commit(void) +{ + // TODO: link properties to parent objects + + Dictionary::Ptr resolvedProperties = m_Properties->ToFlatDictionary(); + Reload(resolvedProperties); +} + +void DynamicObject::Reload(Dictionary::Ptr resolvedProperties) +{ + resolvedProperties->GetProperty("__name", &m_Name); + resolvedProperties->GetProperty("__type", &m_Type); + resolvedProperties->GetProperty("__local", &m_Local); + resolvedProperties->GetProperty("__abstract", &m_Abstract); +} diff --git a/dyn/dynamicobject.h b/dyn/dynamicobject.h new file mode 100644 index 000000000..86088961a --- /dev/null +++ b/dyn/dynamicobject.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef DYNAMICOBJECT_H +#define DYNAMICOBJECT_H + +namespace icinga +{ + +class DynamicObject : public Object +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + void AddParentObject(DynamicObject::Ptr parent); + void RemoveParentObject(DynamicObject::Ptr parent); + + void AddChildObject(DynamicObject::WeakPtr parent); + void RemoveChildObject(DynamicObject::WeakPtr parent); + + DynamicDictionary::Ptr GetProperties(void) const; + void SetProperties(DynamicDictionary::Ptr properties); + + Dictionary::Ptr GetResolvedProperties(void) const; + + string GetName(void) const; + string GetType(void) const; + bool IsLocal(void) const; + bool IsAbstract(void) const; + + void Commit(void); + +protected: + virtual void Reload(Dictionary::Ptr resolvedProperties); + +private: + set m_Parents; + set m_Children; + DynamicDictionary::Ptr m_Properties; + + string m_Type; + string m_Name; + bool m_Local; + bool m_Abstract; + + void SetName(string name); + void SetType(string type); + void SetLocal(bool local); + void SetAbstract(bool abstract); +}; + +} + +#endif /* DYNAMICOBJECT_H */ diff --git a/dyn/i2-dyn.h b/dyn/i2-dyn.h new file mode 100644 index 000000000..806d4bc23 --- /dev/null +++ b/dyn/i2-dyn.h @@ -0,0 +1,36 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef I2DYN_H +#define I2DYN_H + +/** + * @defgroup dyn Dynamic object library + * + * The dynamic object library implements serializable objects which support + * inheritance. + */ + +#include + +#include "dynamicdictionary.h" +#include "dynamicobject.h" +#include "objectspace.h" + +#endif /* I2DYN_H */ diff --git a/dyn/objectspace.cpp b/dyn/objectspace.cpp new file mode 100644 index 000000000..6dd41d361 --- /dev/null +++ b/dyn/objectspace.cpp @@ -0,0 +1,91 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#include "i2-dyn.h" + +using namespace icinga; + +void ObjectSpace::RegisterClass(string name, DynamicObjectFactory factory) +{ + m_Classes[name] = factory; +} + +void ObjectSpace::UnregisterClass(string name) +{ + map::iterator ci = m_Classes.find(name); + + if (ci != m_Classes.end()) + m_Classes.erase(ci); +} + +void ObjectSpace::RegisterObject(DynamicObject::Ptr object) +{ + m_Objects.insert(object); +} + +void ObjectSpace::UnregisterObject(DynamicObject::Ptr object) +{ + set::iterator di = m_Objects.find(object); + + if (di != m_Objects.end()) + m_Objects.erase(di); +} + +Dictionary::Ptr ObjectSpace::SerializeObject(DynamicObject::Ptr object) +{ + DynamicDictionary::Ptr properties = object->GetProperties(); + if (!properties) + throw InvalidArgumentException(); + + Dictionary::Ptr data = make_shared(); + data->SetProperty("type", object->GetType()); + + Dictionary::Ptr serializedProperties = properties->Serialize(); + data->SetProperty("properties", serializedProperties); + return data; +} + +DynamicObject::Ptr ObjectSpace::UnserializeObject(Dictionary::Ptr data) +{ + string type; + if (!data->GetProperty("type", &type)) + throw InvalidArgumentException(); + + Dictionary::Ptr serializedProperties; + if (!data->GetProperty("properties", &serializedProperties)) + throw InvalidArgumentException(); + DynamicDictionary::Ptr properties = make_shared(serializedProperties); + + map::iterator di = m_Classes.find(type); + DynamicObject::Ptr object; + if (di != m_Classes.end()) + object = di->second(); + else + object = make_shared(); + + object->SetProperties(properties); + object->Commit(); + + return object; +} + +vector FindObjects(function predicate) +{ + return vector(); +} diff --git a/dyn/objectspace.h b/dyn/objectspace.h new file mode 100644 index 000000000..de3f24aca --- /dev/null +++ b/dyn/objectspace.h @@ -0,0 +1,49 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +#ifndef OBJECTSPACE_H +#define OBJECTSPACE_H + +namespace icinga +{ + +typedef function DynamicObjectFactory; + +class ObjectSpace : public Object +{ +public: + void RegisterClass(string name, DynamicObjectFactory factory); + void UnregisterClass(string name); + + Dictionary::Ptr SerializeObject(DynamicObject::Ptr object); + DynamicObject::Ptr UnserializeObject(Dictionary::Ptr serializedObject); + + vector FindObjects(function predicate); + +private: + map m_Classes; + set m_Objects; + + void RegisterObject(DynamicObject::Ptr object); + void UnregisterObject(DynamicObject::Ptr object); +}; + +} + +#endif /* OBJECTSPACE_H */ diff --git a/icinga.sln b/icinga.sln index 21ee272ee..594522256 100644 --- a/icinga.sln +++ b/icinga.sln @@ -51,6 +51,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "discovery", "components\dis EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmatch", "mmatch\mmatch.vcxproj", "{19CBCE06-3F5C-479A-BD75-E2AB6215D345}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dyn", "dyn\dyn.vcxproj", "{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}" + ProjectSection(ProjectDependencies) = postProject + {9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -97,6 +102,10 @@ Global {19CBCE06-3F5C-479A-BD75-E2AB6215D345}.Debug|Win32.Build.0 = Debug|Win32 {19CBCE06-3F5C-479A-BD75-E2AB6215D345}.Release|Win32.ActiveCfg = Release|Win32 {19CBCE06-3F5C-479A-BD75-E2AB6215D345}.Release|Win32.Build.0 = Release|Win32 + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Debug|Win32.ActiveCfg = Debug|Win32 + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Debug|Win32.Build.0 = Debug|Win32 + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Release|Win32.ActiveCfg = Release|Win32 + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/icinga/endpoint.cpp b/icinga/endpoint.cpp index e00ffff94..94c015e7a 100644 --- a/icinga/endpoint.cpp +++ b/icinga/endpoint.cpp @@ -207,7 +207,7 @@ void Endpoint::SetReceivedWelcome(bool value) * * @returns Whether we've received a welcome message. */ -bool Endpoint::GetReceivedWelcome(void) const +bool Endpoint::HasReceivedWelcome(void) const { return m_ReceivedWelcome; } @@ -227,7 +227,7 @@ void Endpoint::SetSentWelcome(bool value) * * @returns Whether we've sent a welcome message. */ -bool Endpoint::GetSentWelcome(void) const +bool Endpoint::HasSentWelcome(void) const { return m_SentWelcome; } diff --git a/icinga/endpoint.h b/icinga/endpoint.h index a6b245330..b1cd5982c 100644 --- a/icinga/endpoint.h +++ b/icinga/endpoint.h @@ -46,10 +46,10 @@ public: void SetIdentity(string identity); void SetReceivedWelcome(bool value); - bool GetReceivedWelcome(void) const; + bool HasReceivedWelcome(void) const; void SetSentWelcome(bool value); - bool GetSentWelcome(void) const; + bool HasSentWelcome(void) const; shared_ptr GetEndpointManager(void) const; void SetEndpointManager(weak_ptr manager); diff --git a/icinga/icingaapplication.cpp b/icinga/icingaapplication.cpp index a1ed1e4ee..6cb33299c 100644 --- a/icinga/icingaapplication.cpp +++ b/icinga/icingaapplication.cpp @@ -108,7 +108,7 @@ int IcingaApplication::NewComponentHandler(const EventArgs& ea) ConfigObject::Ptr object = static_pointer_cast(ea.Source); /* don't allow replicated config objects */ - if (object->GetReplicated()) + if (object->IsReplicated()) return 0; string path; @@ -140,7 +140,7 @@ int IcingaApplication::NewIcingaConfigHandler(const EventArgs& ea) ConfigObject::Ptr object = static_pointer_cast(ea.Source); /* don't allow replicated config objects */ - if (object->GetReplicated()) + if (object->IsReplicated()) return 0; string privkey; diff --git a/jsonrpc/jsonrpc.vcxproj.filters b/jsonrpc/jsonrpc.vcxproj.filters index 055198b6c..6878f2c8a 100644 --- a/jsonrpc/jsonrpc.vcxproj.filters +++ b/jsonrpc/jsonrpc.vcxproj.filters @@ -1,20 +1,54 @@  - - - - - - + + Quelldateien + + + Quelldateien + + + Quelldateien + + + Quelldateien + + + Quelldateien + + + Quelldateien + - - - - - - - + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + + + {796f79ec-5628-4c91-9e2b-3d603ab2acfc} + + + {0457f937-d12b-4328-818b-77359de2425f} + \ No newline at end of file