From 8144ca398bff710e61e4e8f8845a554b754d124d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 30 May 2012 10:43:58 +0200 Subject: [PATCH] Added dyn test class. --- base/base.vcxproj | 4 +- components/configfile/configfile.vcxproj | 4 +- dyn/dyn.vcxproj | 10 +- dyn/dynamicdictionary.h | 2 +- dyn/dynamicobject.cpp | 63 ++---------- dyn/dynamicobject.h | 38 ++----- dyn/i2-dyn.h | 9 +- dyn/objectmap.cpp | 93 +++++++++++++++++ dyn/{objectspace.h => objectmap.h} | 38 ++++--- dyn/objectset.cpp | 124 +++++++++++++++++++++++ dyn/objectset.h | 73 +++++++++++++ dyn/objectspace.cpp | 91 ----------------- dyntest/dyntest.cpp | 37 +++++++ dyntest/dyntest.vcxproj | 87 ++++++++++++++++ icinga.sln | 35 ++++--- jsonrpc/jsonrpc.vcxproj | 4 +- 16 files changed, 499 insertions(+), 213 deletions(-) create mode 100644 dyn/objectmap.cpp rename dyn/{objectspace.h => objectmap.h} (63%) create mode 100644 dyn/objectset.cpp create mode 100644 dyn/objectset.h delete mode 100644 dyn/objectspace.cpp create mode 100644 dyntest/dyntest.cpp create mode 100644 dyntest/dyntest.vcxproj diff --git a/base/base.vcxproj b/base/base.vcxproj index 32a4b87e4..51871ee7b 100644 --- a/base/base.vcxproj +++ b/base/base.vcxproj @@ -84,11 +84,11 @@ - $(SolutionDir)\mmatch;$(IncludePath) + $(SolutionDir)\third-party\mmatch;$(IncludePath) $(OutDir);$(LibraryPath) - $(SolutionDir)\mmatch;$(IncludePath) + $(SolutionDir)\third-party\mmatch;$(IncludePath) $(OutDir);$(LibraryPath) diff --git a/components/configfile/configfile.vcxproj b/components/configfile/configfile.vcxproj index 61612eb00..74e474d15 100644 --- a/components/configfile/configfile.vcxproj +++ b/components/configfile/configfile.vcxproj @@ -45,11 +45,11 @@ - $(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\cJSON;$(IncludePath) + $(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\third-party\cJSON;$(IncludePath) $(OutDir);$(LibraryPath) - $(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\cJSON;$(IncludePath) + $(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\third-party\cJSON;$(IncludePath) $(OutDir);$(LibraryPath) diff --git a/dyn/dyn.vcxproj b/dyn/dyn.vcxproj index 50d64aa19..9ac948ab4 100644 --- a/dyn/dyn.vcxproj +++ b/dyn/dyn.vcxproj @@ -14,12 +14,14 @@ - + + - + + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7} @@ -62,7 +64,7 @@ Level3 Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + _WINDLL;I2_DYN_BUILD;_DEBUG;%(PreprocessorDefinitions) Windows @@ -78,7 +80,7 @@ MaxSpeed true true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + _WINDLL;I2_DYN_BUILD;%(PreprocessorDefinitions) Windows diff --git a/dyn/dynamicdictionary.h b/dyn/dynamicdictionary.h index 30aafe76a..465a7ebed 100644 --- a/dyn/dynamicdictionary.h +++ b/dyn/dynamicdictionary.h @@ -38,7 +38,7 @@ struct DynamicDictionaryValue DynamicDictionaryOperator Operator; }; -class DynamicDictionary : public Object +class I2_DYN_API DynamicDictionary : public Object { public: typedef shared_ptr Ptr; diff --git a/dyn/dynamicobject.cpp b/dyn/dynamicobject.cpp index e61d3dd4f..a136341a6 100644 --- a/dyn/dynamicobject.cpp +++ b/dyn/dynamicobject.cpp @@ -21,70 +21,29 @@ using namespace icinga; -DynamicDictionary::Ptr DynamicObject::GetProperties(void) const +DynamicObject::DynamicObject(void) + : m_Config(make_shared()), m_Tags(make_shared()) { - 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) +Dictionary::Ptr DynamicObject::GetConfig(void) const { - m_Type = type; + return m_Config; } -bool DynamicObject::IsLocal(void) const +Dictionary::Ptr DynamicObject::GetTags(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; + return m_Tags; } void DynamicObject::Commit(void) { - // TODO: link properties to parent objects - - Dictionary::Ptr resolvedProperties = m_Properties->ToFlatDictionary(); - Reload(resolvedProperties); + DynamicObject::Ptr self = static_pointer_cast(shared_from_this()); + ObjectSet::GetAllObjects()->CheckObject(self); } -void DynamicObject::Reload(Dictionary::Ptr resolvedProperties) +void DynamicObject::Unregister(void) { - resolvedProperties->GetProperty("__name", &m_Name); - resolvedProperties->GetProperty("__type", &m_Type); - resolvedProperties->GetProperty("__local", &m_Local); - resolvedProperties->GetProperty("__abstract", &m_Abstract); + DynamicObject::Ptr self = static_pointer_cast(shared_from_this()); + ObjectSet::GetAllObjects()->RemoveObject(self); } diff --git a/dyn/dynamicobject.h b/dyn/dynamicobject.h index 86088961a..d665dda2e 100644 --- a/dyn/dynamicobject.h +++ b/dyn/dynamicobject.h @@ -23,47 +23,23 @@ namespace icinga { -class DynamicObject : public Object +class I2_DYN_API DynamicObject : public Object { public: typedef shared_ptr Ptr; typedef weak_ptr WeakPtr; - void AddParentObject(DynamicObject::Ptr parent); - void RemoveParentObject(DynamicObject::Ptr parent); + DynamicObject(void); - 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; + Dictionary::Ptr GetConfig(void) const; + Dictionary::Ptr GetTags(void) const; void Commit(void); - -protected: - virtual void Reload(Dictionary::Ptr resolvedProperties); + void Unregister(void); 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); + Dictionary::Ptr m_Config; + Dictionary::Ptr m_Tags; }; } diff --git a/dyn/i2-dyn.h b/dyn/i2-dyn.h index 806d4bc23..13ede7c25 100644 --- a/dyn/i2-dyn.h +++ b/dyn/i2-dyn.h @@ -29,8 +29,15 @@ #include +#ifdef I2_DYN_BUILD +# define I2_DYN_API I2_EXPORT +#else /* I2_DYN_BUILD */ +# define I2_DYN_API I2_IMPORT +#endif /* I2_DYN_BUILD */ + #include "dynamicdictionary.h" #include "dynamicobject.h" -#include "objectspace.h" +#include "objectset.h" +#include "objectmap.h" #endif /* I2DYN_H */ diff --git a/dyn/objectmap.cpp b/dyn/objectmap.cpp new file mode 100644 index 000000000..6c7b76bdb --- /dev/null +++ b/dyn/objectmap.cpp @@ -0,0 +1,93 @@ +/****************************************************************************** + * 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; + +ObjectMap::ObjectMap(const ObjectSet::Ptr& parent, ObjectKeyGetter keygetter) + : m_Parent(parent), m_KeyGetter(keygetter) +{ + assert(m_Parent); + assert(m_KeyGetter); +} + +void ObjectMap::Start(void) +{ + m_Parent->OnObjectAdded += bind_weak(&ObjectMap::ObjectAddedHandler, shared_from_this()); + m_Parent->OnObjectCommitted += bind_weak(&ObjectMap::ObjectCommittedHandler, shared_from_this()); + m_Parent->OnObjectRemoved += bind_weak(&ObjectMap::ObjectRemovedHandler, shared_from_this()); + + for (ObjectSet::Iterator it = m_Parent->Begin(); it != m_Parent->End(); it++) + AddObject(*it); +} + +void ObjectMap::AddObject(const Object::Ptr& object) +{ + string key; + if (!m_KeyGetter(object, &key)) + return; + + m_Objects.insert(pair(key, object)); +} + +void ObjectMap::RemoveObject(const Object::Ptr& object) +{ + string key; + if (!m_KeyGetter(object, &key)) + return; + + pair range = GetRange(key); + + for (Iterator i = range.first; i != range.second; i++) { + if (i->second == object) { + m_Objects.erase(i); + break; + } + } +} + +void ObjectMap::CheckObject(const Object::Ptr& object) +{ + RemoveObject(object); + AddObject(object); +} + +ObjectMap::Range ObjectMap::GetRange(string key) +{ + return m_Objects.equal_range(key); +} + +int ObjectMap::ObjectAddedHandler(const ObjectSetEventArgs& ea) +{ + AddObject(ea.Object); + return 0; +} + +int ObjectMap::ObjectCommittedHandler(const ObjectSetEventArgs& ea) +{ + CheckObject(ea.Object); + return 0; +} + +int ObjectMap::ObjectRemovedHandler(const ObjectSetEventArgs& ea) +{ + RemoveObject(ea.Object); + return 0; +} diff --git a/dyn/objectspace.h b/dyn/objectmap.h similarity index 63% rename from dyn/objectspace.h rename to dyn/objectmap.h index de3f24aca..dc60262f3 100644 --- a/dyn/objectspace.h +++ b/dyn/objectmap.h @@ -17,33 +17,43 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ -#ifndef OBJECTSPACE_H -#define OBJECTSPACE_H +#ifndef OBJECTMAP_H +#define OBJECTMAP_H namespace icinga { -typedef function DynamicObjectFactory; +typedef function ObjectKeyGetter; -class ObjectSpace : public Object +class I2_DYN_API ObjectMap : public Object { public: - void RegisterClass(string name, DynamicObjectFactory factory); - void UnregisterClass(string name); + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; - Dictionary::Ptr SerializeObject(DynamicObject::Ptr object); - DynamicObject::Ptr UnserializeObject(Dictionary::Ptr serializedObject); + typedef multimap::iterator Iterator; + typedef pair Range; - vector FindObjects(function predicate); + ObjectMap(const ObjectSet::Ptr& parent, ObjectKeyGetter keygetter); + + void Start(void); + + Range GetRange(string key); private: - map m_Classes; - set m_Objects; + multimap m_Objects; + ObjectSet::Ptr m_Parent; + ObjectKeyGetter m_KeyGetter; + + void AddObject(const Object::Ptr& object); + void RemoveObject(const Object::Ptr& object); + void CheckObject(const Object::Ptr& object); - void RegisterObject(DynamicObject::Ptr object); - void UnregisterObject(DynamicObject::Ptr object); + int ObjectAddedHandler(const ObjectSetEventArgs& ea); + int ObjectCommittedHandler(const ObjectSetEventArgs& ea); + int ObjectRemovedHandler(const ObjectSetEventArgs& ea); }; } -#endif /* OBJECTSPACE_H */ +#endif OBJECTMAP_H diff --git a/dyn/objectset.cpp b/dyn/objectset.cpp new file mode 100644 index 000000000..9f0889808 --- /dev/null +++ b/dyn/objectset.cpp @@ -0,0 +1,124 @@ +/****************************************************************************** + * 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; + +ObjectSet::ObjectSet(void) + : m_Parent(), m_Filter() +{ +} + +ObjectSet::ObjectSet(const ObjectSet::Ptr& parent, ObjectPredicate filter) + : m_Parent(parent), m_Filter(filter) +{ +} + +void ObjectSet::Start(void) +{ + if (m_Parent) { + m_Parent->OnObjectCommitted += bind_weak(&ObjectSet::ObjectCommittedHandler, shared_from_this()); + m_Parent->OnObjectRemoved += bind_weak(&ObjectSet::ObjectRemovedHandler, shared_from_this()); + + for (ObjectSet::Iterator it = m_Parent->Begin(); it != m_Parent->End(); it++) + CheckObject(*it); + } +} + +void ObjectSet::AddObject(const Object::Ptr& object) +{ + m_Objects.insert(object); + + ObjectSetEventArgs ea; + ea.Source = shared_from_this(); + ea.Object = object; + OnObjectAdded(ea); +} + +void ObjectSet::RemoveObject(const Object::Ptr& object) +{ + ObjectSet::Iterator it = m_Objects.find(object); + + if (it != m_Objects.end()) { + m_Objects.erase(it); + + ObjectSetEventArgs ea; + ea.Source = shared_from_this(); + ea.Object = object; + OnObjectRemoved(ea); + } +} + +bool ObjectSet::Contains(const Object::Ptr& object) const +{ + ObjectSet::Iterator it = m_Objects.find(object); + + return !(it == m_Objects.end()); +} + +void ObjectSet::CheckObject(const Object::Ptr& object) +{ + if (m_Filter && !m_Filter(object)) + RemoveObject(object); + else { + if (!Contains(object)) + AddObject(object); + else { + ObjectSetEventArgs ea; + ea.Source = shared_from_this(); + ea.Object = object; + OnObjectCommitted(ea); + } + } +} + +int ObjectSet::ObjectCommittedHandler(const ObjectSetEventArgs& ea) +{ + CheckObject(ea.Object); + return 0; +} + +int ObjectSet::ObjectRemovedHandler(const ObjectSetEventArgs& ea) +{ + RemoveObject(ea.Object); + return 0; +} + +ObjectSet::Iterator ObjectSet::Begin(void) +{ + return m_Objects.begin(); +} + +ObjectSet::Iterator ObjectSet::End(void) +{ + return m_Objects.end(); +} + +ObjectSet::Ptr ObjectSet::GetAllObjects(void) +{ + static ObjectSet::Ptr allObjects; + + if (!allObjects) { + allObjects = make_shared(); + allObjects->Start(); + } + + return allObjects; +} \ No newline at end of file diff --git a/dyn/objectset.h b/dyn/objectset.h new file mode 100644 index 000000000..e277f4bbc --- /dev/null +++ b/dyn/objectset.h @@ -0,0 +1,73 @@ +/****************************************************************************** + * 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 OBJECTSET_H +#define OBJECTSET_H + +namespace icinga +{ + +struct ObjectSetEventArgs : public EventArgs +{ + Object::Ptr Object; +}; + +typedef function ObjectPredicate; + +class I2_DYN_API ObjectSet : public Object +{ +public: + typedef shared_ptr Ptr; + typedef weak_ptr WeakPtr; + + typedef set::iterator Iterator; + + ObjectSet(void); + ObjectSet(const ObjectSet::Ptr& parent, ObjectPredicate filter); + + void Start(void); + + void AddObject(const Object::Ptr& object); + void RemoveObject(const Object::Ptr& object); + bool Contains(const Object::Ptr& object) const; + + void CheckObject(const Object::Ptr& object); + + Observable OnObjectAdded; + Observable OnObjectCommitted; + Observable OnObjectRemoved; + + Iterator Begin(void); + Iterator End(void); + + static ObjectSet::Ptr GetAllObjects(void); + +private: + set m_Objects; + + ObjectSet::Ptr m_Parent; + ObjectPredicate m_Filter; + + int ObjectCommittedHandler(const ObjectSetEventArgs& ea); + int ObjectRemovedHandler(const ObjectSetEventArgs& ea); +}; + +} + +#endif /* OBJECTSET_H */ \ No newline at end of file diff --git a/dyn/objectspace.cpp b/dyn/objectspace.cpp deleted file mode 100644 index 6dd41d361..000000000 --- a/dyn/objectspace.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * 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/dyntest/dyntest.cpp b/dyntest/dyntest.cpp new file mode 100644 index 000000000..4870d07e8 --- /dev/null +++ b/dyntest/dyntest.cpp @@ -0,0 +1,37 @@ +#include + +using namespace icinga; + +bool foogetter(const Object::Ptr& object, string *key) +{ + DynamicObject::Ptr dobj = dynamic_pointer_cast(object); + return dobj->GetConfig()->GetProperty("foo", key); +} + +bool foo(const Object::Ptr& object) +{ + DynamicObject::Ptr dobj = dynamic_pointer_cast(object); + + string value; + return dobj->GetConfig()->GetProperty("foo", &value); +} + +int main(int argc, char **argv) +{ + for (int i = 0; i < 1000000; i++) { + DynamicObject::Ptr dobj = make_shared(); + dobj->GetConfig()->SetProperty("foo", "bar"); + dobj->Commit(); + } + + ObjectSet::Ptr filtered = make_shared(ObjectSet::GetAllObjects(), &foo); + filtered->Start(); + + ObjectMap::Ptr m = make_shared(ObjectSet::GetAllObjects(), &foogetter); + m->Start(); + + ObjectMap::Range range = m->GetRange("bar"); + cout << distance(range.first, range.second) << " elements" << endl; + + return 0; +} diff --git a/dyntest/dyntest.vcxproj b/dyntest/dyntest.vcxproj new file mode 100644 index 000000000..4a7d9f799 --- /dev/null +++ b/dyntest/dyntest.vcxproj @@ -0,0 +1,87 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {E6FA740D-0939-4711-AFBC-3D9E913510A1} + Win32Proj + dyntest + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + $(SolutionDir)\base;$(SolutionDir)\dyn;$(IncludePath) + $(OutDir);$(LibraryPath) + + + false + $(SolutionDir)\base;$(SolutionDir)\dyn;$(IncludePath) + $(OutDir);$(LibraryPath) + + + + + + Level3 + Disabled + + + Console + true + base.lib;dyn.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + base.lib;dyn.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/icinga.sln b/icinga.sln index 594522256..f9766e2d6 100644 --- a/icinga.sln +++ b/icinga.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 +# Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "base\base.vcxproj", "{9C92DA90-FD53-43A9-A244-90F2E8AF9677}" ProjectSection(ProjectDependencies) = postProject {19CBCE06-3F5C-479A-BD75-E2AB6215D345} = {19CBCE06-3F5C-479A-BD75-E2AB6215D345} @@ -12,8 +12,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsonrpc", "jsonrpc\jsonrpc. {9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cJSON", "cJSON\cJSON.vcxproj", "{66BED474-C33F-48F9-90BA-BBCFEDC006B8}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icinga", "icinga\icinga.vcxproj", "{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}" ProjectSection(ProjectDependencies) = postProject {9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677} @@ -49,13 +47,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "discovery", "components\dis {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} EndProjectSection 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 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cJSON", "third-party\cJSON\cJSON.vcxproj", "{66BED474-C33F-48F9-90BA-BBCFEDC006B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmatch", "third-party\mmatch\mmatch.vcxproj", "{19CBCE06-3F5C-479A-BD75-E2AB6215D345}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dyntest", "dyntest\dyntest.vcxproj", "{E6FA740D-0939-4711-AFBC-3D9E913510A1}" + ProjectSection(ProjectDependencies) = postProject + {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7} = {B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -70,10 +75,6 @@ Global {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Debug|Win32.Build.0 = Debug|Win32 {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Release|Win32.ActiveCfg = Release|Win32 {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Release|Win32.Build.0 = Release|Win32 - {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Debug|Win32.ActiveCfg = Debug|Win32 - {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Debug|Win32.Build.0 = Debug|Win32 - {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Release|Win32.ActiveCfg = Release|Win32 - {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Release|Win32.Build.0 = Release|Win32 {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Debug|Win32.ActiveCfg = Debug|Win32 {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Debug|Win32.Build.0 = Debug|Win32 {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Release|Win32.ActiveCfg = Release|Win32 @@ -98,14 +99,22 @@ Global {EAD41628-BB96-4F99-9070-8A9676801295}.Debug|Win32.Build.0 = Debug|Win32 {EAD41628-BB96-4F99-9070-8A9676801295}.Release|Win32.ActiveCfg = Release|Win32 {EAD41628-BB96-4F99-9070-8A9676801295}.Release|Win32.Build.0 = Release|Win32 - {19CBCE06-3F5C-479A-BD75-E2AB6215D345}.Debug|Win32.ActiveCfg = Debug|Win32 - {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 + {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Debug|Win32.Build.0 = Debug|Win32 + {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Release|Win32.ActiveCfg = Release|Win32 + {66BED474-C33F-48F9-90BA-BBCFEDC006B8}.Release|Win32.Build.0 = Release|Win32 + {19CBCE06-3F5C-479A-BD75-E2AB6215D345}.Debug|Win32.ActiveCfg = Debug|Win32 + {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 + {E6FA740D-0939-4711-AFBC-3D9E913510A1}.Debug|Win32.ActiveCfg = Debug|Win32 + {E6FA740D-0939-4711-AFBC-3D9E913510A1}.Debug|Win32.Build.0 = Debug|Win32 + {E6FA740D-0939-4711-AFBC-3D9E913510A1}.Release|Win32.ActiveCfg = Release|Win32 + {E6FA740D-0939-4711-AFBC-3D9E913510A1}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/jsonrpc/jsonrpc.vcxproj b/jsonrpc/jsonrpc.vcxproj index 9cd579651..de1f80346 100644 --- a/jsonrpc/jsonrpc.vcxproj +++ b/jsonrpc/jsonrpc.vcxproj @@ -55,11 +55,11 @@ - $(SolutionDir)\base;$(SolutionDir)\cJSON;$(IncludePath) + $(SolutionDir)\base;$(SolutionDir)\third-party\cJSON;$(IncludePath) $(OutDir);$(LibraryPath) - $(SolutionDir)\base;$(SolutionDir)\cJSON;$(IncludePath) + $(SolutionDir)\base;$(SolutionDir)\third-party\cJSON;$(IncludePath) $(OutDir);$(LibraryPath) -- 2.40.0