From 4b093d98727f21dc58bb2bda05d1259611c6be11 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 1 Apr 2012 09:31:03 +0200 Subject: [PATCH] Updated project files. --- Makefile.am | 3 +++ configfilecomponent/Makefile.am | 9 +++++++++ configrpccomponent/Makefile.am | 9 +++++++++ icinga/Makefile.am | 15 +++++++++++++++ icinga2.sln | 8 ++++++++ jsonrpc/Makefile.am | 2 -- miniapp/miniapp.cpp | 29 ++++++++++++++++++++++++++--- miniapp/miniapp.vcxproj | 14 +++++++------- 8 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 configfilecomponent/Makefile.am create mode 100644 configrpccomponent/Makefile.am create mode 100644 icinga/Makefile.am diff --git a/Makefile.am b/Makefile.am index 3d1ced083..b9c1b3f55 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,9 @@ ## Created by Anjuta SUBDIRS = base \ + configfilecomponent \ + configrpccomponent \ + icinga \ jsonrpc \ miniapp diff --git a/configfilecomponent/Makefile.am b/configfilecomponent/Makefile.am new file mode 100644 index 000000000..332c0b115 --- /dev/null +++ b/configfilecomponent/Makefile.am @@ -0,0 +1,9 @@ +## Process this file with automake to produce Makefile.in + + +libconfigfilecomponent_la_SOURCES = \ + configfilecomponent.cpp \ + configfilecomponent.h \ + i2-configfilecomponent.h + +libconfigfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base diff --git a/configrpccomponent/Makefile.am b/configrpccomponent/Makefile.am new file mode 100644 index 000000000..35340f2ac --- /dev/null +++ b/configrpccomponent/Makefile.am @@ -0,0 +1,9 @@ +## Process this file with automake to produce Makefile.in + + +libconfigrpccomponent_la_SOURCES = \ + configrpccomponent.cpp \ + configrpccomponent.h \ + i2-configrpccomponent.h + +libconfigrpccomponent_la_CXXFLAGS = -I${top_srcdir}/base diff --git a/icinga/Makefile.am b/icinga/Makefile.am new file mode 100644 index 000000000..e4c115720 --- /dev/null +++ b/icinga/Makefile.am @@ -0,0 +1,15 @@ +## Process this file with automake to produce Makefile.in + + +bin_PROGRAMS = \ + icinga + +miniapp_SOURCES = \ + icingaapplication.cpp \ + icingaapplication.h + +miniapp_CXXFLAGS = -I${top_srcdir}/base \ + -I${top_srcdir}/jsonrpc + +miniapp_LDFLAGS = $(top_builddir)/base/libbase.a \ + $(top_builddir)/jsonrpc/libjsonrpc.a diff --git a/icinga2.sln b/icinga2.sln index b44359255..d21756d1e 100644 --- a/icinga2.sln +++ b/icinga2.sln @@ -28,8 +28,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icinga", "icinga\icinga.vcx EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "configfilecomponent", "configfilecomponent\configfilecomponent.vcxproj", "{E58F1DA7-B723-412B-B2B7-7FF58E2A944E}" + ProjectSection(ProjectDependencies) = postProject + {9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677} + {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8} = {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "configrpccomponent", "configrpccomponent\configrpccomponent.vcxproj", "{697C6D7E-3109-484C-A7AF-384D28711610}" + ProjectSection(ProjectDependencies) = postProject + {9C92DA90-FD53-43A9-A244-90F2E8AF9677} = {9C92DA90-FD53-43A9-A244-90F2E8AF9677} + {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8} = {8DD52FAC-ECEE-48C2-B266-E7C47ED485F8} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/jsonrpc/Makefile.am b/jsonrpc/Makefile.am index 64432a12a..54a417845 100644 --- a/jsonrpc/Makefile.am +++ b/jsonrpc/Makefile.am @@ -20,5 +20,3 @@ libjsonrpc_a_SOURCES = \ netstring.h libjsonrpc_a_CXXFLAGS = -I${top_srcdir}/base - -libjsonrpc_a_LIBADD = $(top_builddir)/base/libbase.a diff --git a/miniapp/miniapp.cpp b/miniapp/miniapp.cpp index 43451c445..ebf364d53 100644 --- a/miniapp/miniapp.cpp +++ b/miniapp/miniapp.cpp @@ -13,20 +13,38 @@ namespace icinga class MyApplication : public Application { +private: + ConfigHive::RefType m_Hive; + public: typedef shared_ptr RefType; typedef weak_ptr WeakRefType; int Main(const vector& args) { + LoadComponent("configcomponent"); + + m_Hive = new_object(); + + /*ConfigFileSerializer::RefType cfs = new_object(); + cfs->SetFilename("test.conf"); + cfs->Deserialize(m_Hive); + + ConfigObject::RefType netconfig = m_Hive->GetObject("netconfig"); + JsonRpcServer::RefType ts = new_object(); ts->MakeSocket(); - ts->Bind(7777); + ts->Bind(netconfig->GetPropertyInteger("port", 7777)); ts->Listen(); ConnectionManager::RefType cm = new_object(); cm->RegisterMethod("HelloWorld", bind_weak(&MyApplication::HelloWorld, shared_from_this())); - cm->BindServer(ts); + cm->RegisterServer(ts); + + ConfigRpcServiceModule::RefType rsm = new_object(); + rsm->SetHive(m_Hive); + rsm->SetConfigSource(true); + cm->RegisterServiceModule(rsm);*/ RunEventLoop(); @@ -44,7 +62,12 @@ public: cJSON *result = response->GetResult(); cJSON_AddStringToObject(result, "greeting", "Hello World!"); client->SendMessage(response); - + + ConfigObject::RefType co = new_object(); + co->SetName("foo"); + co->SetType("moo"); + m_Hive->AddObject(co); + return 0; } }; diff --git a/miniapp/miniapp.vcxproj b/miniapp/miniapp.vcxproj index 798c45e60..ea4d97fe0 100644 --- a/miniapp/miniapp.vcxproj +++ b/miniapp/miniapp.vcxproj @@ -13,19 +13,19 @@ {7CEA8AB1-3327-4644-9D38-B639A8F3341E} Win32Proj - i2miniapp + icinga Application true - Unicode + MultiByte Application false true - Unicode + MultiByte @@ -39,13 +39,13 @@ true - ..\Debug;$(LibraryPath) - $(MSBuildProjectDirectory)\..\base;$(MSBuildProjectDirectory)\..\jsonrpc;$(IncludePath) + $(OutDir);$(LibraryPath) + $(ProjectDir)\..\base;$(ProjectDir)\..\jsonrpc;$(ProjectDir)\..\config;$(IncludePath) false - ..\Release;$(LibraryPath) - $(MSBuildProjectDirectory)\..\base;$(MSBuildProjectDirectory)\..\jsonrpc;$(IncludePath) + $(OutDir);$(LibraryPath) + $(ProjectDir)\..\base;$(ProjectDir)\..\jsonrpc;$(ProjectDir)\..\config;$(IncludePath) -- 2.40.0