mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
Added dyn test class.
This commit is contained in:
parent
6c580aeb4a
commit
8144ca398b
@ -84,11 +84,11 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\mmatch;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\third-party\mmatch;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\mmatch;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\third-party\mmatch;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
@ -45,11 +45,11 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\cJSON;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\third-party\cJSON;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\cJSON;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\jsonrpc;$(SolutionDir)\icinga;$(SolutionDir)\third-party\cJSON;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
<ClInclude Include="dynamicdictionary.h" />
|
<ClInclude Include="dynamicdictionary.h" />
|
||||||
<ClInclude Include="dynamicobject.h" />
|
<ClInclude Include="dynamicobject.h" />
|
||||||
<ClInclude Include="i2-dyn.h" />
|
<ClInclude Include="i2-dyn.h" />
|
||||||
<ClInclude Include="objectspace.h" />
|
<ClInclude Include="objectmap.h" />
|
||||||
|
<ClInclude Include="objectset.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="dynamicdictionary.cpp" />
|
<ClCompile Include="dynamicdictionary.cpp" />
|
||||||
<ClCompile Include="dynamicobject.cpp" />
|
<ClCompile Include="dynamicobject.cpp" />
|
||||||
<ClCompile Include="objectspace.cpp" />
|
<ClCompile Include="objectmap.cpp" />
|
||||||
|
<ClCompile Include="objectset.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}</ProjectGuid>
|
<ProjectGuid>{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}</ProjectGuid>
|
||||||
@ -62,7 +64,7 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDLL;I2_DYN_BUILD;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -78,7 +80,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_WINDLL;I2_DYN_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -38,7 +38,7 @@ struct DynamicDictionaryValue
|
|||||||
DynamicDictionaryOperator Operator;
|
DynamicDictionaryOperator Operator;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DynamicDictionary : public Object
|
class I2_DYN_API DynamicDictionary : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef shared_ptr<DynamicDictionary> Ptr;
|
typedef shared_ptr<DynamicDictionary> Ptr;
|
||||||
|
@ -21,70 +21,29 @@
|
|||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
DynamicDictionary::Ptr DynamicObject::GetProperties(void) const
|
DynamicObject::DynamicObject(void)
|
||||||
|
: m_Config(make_shared<Dictionary>()), m_Tags(make_shared<Dictionary>())
|
||||||
{
|
{
|
||||||
return m_Properties;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicObject::SetProperties(DynamicDictionary::Ptr properties)
|
Dictionary::Ptr DynamicObject::GetConfig(void) const
|
||||||
{
|
{
|
||||||
m_Properties = properties;
|
return m_Config;
|
||||||
Dictionary::Ptr resolvedProperties = properties->ToFlatDictionary();
|
|
||||||
Reload(resolvedProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string DynamicObject::GetName(void) const
|
Dictionary::Ptr DynamicObject::GetTags(void) const
|
||||||
{
|
{
|
||||||
return m_Name;
|
return m_Tags;
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
void DynamicObject::Commit(void)
|
||||||
{
|
{
|
||||||
// TODO: link properties to parent objects
|
DynamicObject::Ptr self = static_pointer_cast<DynamicObject>(shared_from_this());
|
||||||
|
ObjectSet::GetAllObjects()->CheckObject(self);
|
||||||
Dictionary::Ptr resolvedProperties = m_Properties->ToFlatDictionary();
|
|
||||||
Reload(resolvedProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicObject::Reload(Dictionary::Ptr resolvedProperties)
|
void DynamicObject::Unregister(void)
|
||||||
{
|
{
|
||||||
resolvedProperties->GetProperty("__name", &m_Name);
|
DynamicObject::Ptr self = static_pointer_cast<DynamicObject>(shared_from_this());
|
||||||
resolvedProperties->GetProperty("__type", &m_Type);
|
ObjectSet::GetAllObjects()->RemoveObject(self);
|
||||||
resolvedProperties->GetProperty("__local", &m_Local);
|
|
||||||
resolvedProperties->GetProperty("__abstract", &m_Abstract);
|
|
||||||
}
|
}
|
||||||
|
@ -23,47 +23,23 @@
|
|||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
|
|
||||||
class DynamicObject : public Object
|
class I2_DYN_API DynamicObject : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef shared_ptr<DynamicObject> Ptr;
|
typedef shared_ptr<DynamicObject> Ptr;
|
||||||
typedef weak_ptr<DynamicObject> WeakPtr;
|
typedef weak_ptr<DynamicObject> WeakPtr;
|
||||||
|
|
||||||
void AddParentObject(DynamicObject::Ptr parent);
|
DynamicObject(void);
|
||||||
void RemoveParentObject(DynamicObject::Ptr parent);
|
|
||||||
|
|
||||||
void AddChildObject(DynamicObject::WeakPtr parent);
|
Dictionary::Ptr GetConfig(void) const;
|
||||||
void RemoveChildObject(DynamicObject::WeakPtr parent);
|
Dictionary::Ptr GetTags(void) const;
|
||||||
|
|
||||||
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);
|
void Commit(void);
|
||||||
|
void Unregister(void);
|
||||||
protected:
|
|
||||||
virtual void Reload(Dictionary::Ptr resolvedProperties);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
set<DynamicObject::Ptr> m_Parents;
|
Dictionary::Ptr m_Config;
|
||||||
set<DynamicObject::WeakPtr> m_Children;
|
Dictionary::Ptr m_Tags;
|
||||||
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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,15 @@
|
|||||||
|
|
||||||
#include <i2-base.h>
|
#include <i2-base.h>
|
||||||
|
|
||||||
|
#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 "dynamicdictionary.h"
|
||||||
#include "dynamicobject.h"
|
#include "dynamicobject.h"
|
||||||
#include "objectspace.h"
|
#include "objectset.h"
|
||||||
|
#include "objectmap.h"
|
||||||
|
|
||||||
#endif /* I2DYN_H */
|
#endif /* I2DYN_H */
|
||||||
|
93
dyn/objectmap.cpp
Normal file
93
dyn/objectmap.cpp
Normal file
@ -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<string, Object::Ptr>(key, object));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectMap::RemoveObject(const Object::Ptr& object)
|
||||||
|
{
|
||||||
|
string key;
|
||||||
|
if (!m_KeyGetter(object, &key))
|
||||||
|
return;
|
||||||
|
|
||||||
|
pair<Iterator, Iterator> 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;
|
||||||
|
}
|
@ -17,33 +17,43 @@
|
|||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#ifndef OBJECTSPACE_H
|
#ifndef OBJECTMAP_H
|
||||||
#define OBJECTSPACE_H
|
#define OBJECTMAP_H
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef function<DynamicObject::Ptr()> DynamicObjectFactory;
|
typedef function<bool (const Object::Ptr&, string *key)> ObjectKeyGetter;
|
||||||
|
|
||||||
class ObjectSpace : public Object
|
class I2_DYN_API ObjectMap : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void RegisterClass(string name, DynamicObjectFactory factory);
|
typedef shared_ptr<ObjectMap> Ptr;
|
||||||
void UnregisterClass(string name);
|
typedef weak_ptr<ObjectMap> WeakPtr;
|
||||||
|
|
||||||
Dictionary::Ptr SerializeObject(DynamicObject::Ptr object);
|
typedef multimap<string, Object::Ptr>::iterator Iterator;
|
||||||
DynamicObject::Ptr UnserializeObject(Dictionary::Ptr serializedObject);
|
typedef pair<Iterator, Iterator> Range;
|
||||||
|
|
||||||
vector<DynamicObject::Ptr> FindObjects(function<bool (DynamicObject::Ptr)> predicate);
|
ObjectMap(const ObjectSet::Ptr& parent, ObjectKeyGetter keygetter);
|
||||||
|
|
||||||
|
void Start(void);
|
||||||
|
|
||||||
|
Range GetRange(string key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
map<string, DynamicObjectFactory> m_Classes;
|
multimap<string, Object::Ptr> m_Objects;
|
||||||
set<DynamicObject::Ptr> m_Objects;
|
ObjectSet::Ptr m_Parent;
|
||||||
|
ObjectKeyGetter m_KeyGetter;
|
||||||
|
|
||||||
void RegisterObject(DynamicObject::Ptr object);
|
void AddObject(const Object::Ptr& object);
|
||||||
void UnregisterObject(DynamicObject::Ptr object);
|
void RemoveObject(const Object::Ptr& object);
|
||||||
|
void CheckObject(const Object::Ptr& object);
|
||||||
|
|
||||||
|
int ObjectAddedHandler(const ObjectSetEventArgs& ea);
|
||||||
|
int ObjectCommittedHandler(const ObjectSetEventArgs& ea);
|
||||||
|
int ObjectRemovedHandler(const ObjectSetEventArgs& ea);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* OBJECTSPACE_H */
|
#endif OBJECTMAP_H
|
124
dyn/objectset.cpp
Normal file
124
dyn/objectset.cpp
Normal file
@ -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<ObjectSet>();
|
||||||
|
allObjects->Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
return allObjects;
|
||||||
|
}
|
73
dyn/objectset.h
Normal file
73
dyn/objectset.h
Normal file
@ -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<bool (const Object::Ptr&)> ObjectPredicate;
|
||||||
|
|
||||||
|
class I2_DYN_API ObjectSet : public Object
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef shared_ptr<ObjectSet> Ptr;
|
||||||
|
typedef weak_ptr<ObjectSet> WeakPtr;
|
||||||
|
|
||||||
|
typedef set<Object::Ptr>::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<ObjectSetEventArgs> OnObjectAdded;
|
||||||
|
Observable<ObjectSetEventArgs> OnObjectCommitted;
|
||||||
|
Observable<ObjectSetEventArgs> OnObjectRemoved;
|
||||||
|
|
||||||
|
Iterator Begin(void);
|
||||||
|
Iterator End(void);
|
||||||
|
|
||||||
|
static ObjectSet::Ptr GetAllObjects(void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
set<Object::Ptr> m_Objects;
|
||||||
|
|
||||||
|
ObjectSet::Ptr m_Parent;
|
||||||
|
ObjectPredicate m_Filter;
|
||||||
|
|
||||||
|
int ObjectCommittedHandler(const ObjectSetEventArgs& ea);
|
||||||
|
int ObjectRemovedHandler(const ObjectSetEventArgs& ea);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* OBJECTSET_H */
|
@ -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<string, DynamicObjectFactory>::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<DynamicObject::Ptr>::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<Dictionary>();
|
|
||||||
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<DynamicDictionary>(serializedProperties);
|
|
||||||
|
|
||||||
map<string, DynamicObjectFactory>::iterator di = m_Classes.find(type);
|
|
||||||
DynamicObject::Ptr object;
|
|
||||||
if (di != m_Classes.end())
|
|
||||||
object = di->second();
|
|
||||||
else
|
|
||||||
object = make_shared<DynamicObject>();
|
|
||||||
|
|
||||||
object->SetProperties(properties);
|
|
||||||
object->Commit();
|
|
||||||
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
vector<DynamicObject::Ptr> FindObjects(function<bool (DynamicObject::Ptr)> predicate)
|
|
||||||
{
|
|
||||||
return vector<DynamicObject::Ptr>();
|
|
||||||
}
|
|
37
dyntest/dyntest.cpp
Normal file
37
dyntest/dyntest.cpp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#include <i2-dyn.h>
|
||||||
|
|
||||||
|
using namespace icinga;
|
||||||
|
|
||||||
|
bool foogetter(const Object::Ptr& object, string *key)
|
||||||
|
{
|
||||||
|
DynamicObject::Ptr dobj = dynamic_pointer_cast<DynamicObject>(object);
|
||||||
|
return dobj->GetConfig()->GetProperty("foo", key);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool foo(const Object::Ptr& object)
|
||||||
|
{
|
||||||
|
DynamicObject::Ptr dobj = dynamic_pointer_cast<DynamicObject>(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<DynamicObject>();
|
||||||
|
dobj->GetConfig()->SetProperty("foo", "bar");
|
||||||
|
dobj->Commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectSet::Ptr filtered = make_shared<ObjectSet>(ObjectSet::GetAllObjects(), &foo);
|
||||||
|
filtered->Start();
|
||||||
|
|
||||||
|
ObjectMap::Ptr m = make_shared<ObjectMap>(ObjectSet::GetAllObjects(), &foogetter);
|
||||||
|
m->Start();
|
||||||
|
|
||||||
|
ObjectMap::Range range = m->GetRange("bar");
|
||||||
|
cout << distance(range.first, range.second) << " elements" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
87
dyntest/dyntest.vcxproj
Normal file
87
dyntest/dyntest.vcxproj
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{E6FA740D-0939-4711-AFBC-3D9E913510A1}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>dyntest</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\dyn;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\dyn;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>base.lib;dyn.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalDependencies>base.lib;dyn.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="dyntest.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
35
icinga.sln
35
icinga.sln
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "base\base.vcxproj", "{9C92DA90-FD53-43A9-A244-90F2E8AF9677}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{19CBCE06-3F5C-479A-BD75-E2AB6215D345} = {19CBCE06-3F5C-479A-BD75-E2AB6215D345}
|
{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}
|
{9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icinga", "icinga\icinga.vcxproj", "{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677}
|
{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}
|
{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8} = {C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dyn", "dyn\dyn.vcxproj", "{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677}
|
{9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
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}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Release|Win32.ActiveCfg = Release|Win32
|
{8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{8DD52FAC-ECEE-48C2-B266-E7C47ED485F8}.Release|Win32.Build.0 = 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.ActiveCfg = Debug|Win32
|
||||||
{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Debug|Win32.Build.0 = Debug|Win32
|
{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{C1FC77E1-04A4-481B-A78B-2F7AF489C2F8}.Release|Win32.ActiveCfg = Release|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}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{EAD41628-BB96-4F99-9070-8A9676801295}.Release|Win32.ActiveCfg = Release|Win32
|
{EAD41628-BB96-4F99-9070-8A9676801295}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{EAD41628-BB96-4F99-9070-8A9676801295}.Release|Win32.Build.0 = 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.ActiveCfg = Debug|Win32
|
||||||
{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Debug|Win32.Build.0 = 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.ActiveCfg = Release|Win32
|
||||||
{B26AFFA6-2BDF-42E6-A224-2591FFD9BFB7}.Release|Win32.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -55,11 +55,11 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\cJSON;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\third-party\cJSON;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\cJSON;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\base;$(SolutionDir)\third-party\cJSON;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user