diff options
Diffstat (limited to 'project2/ice')
-rw-r--r-- | project2/ice/iceDaemon.cpp | 2 | ||||
-rw-r--r-- | project2/ice/iceDataSource.cpp | 4 | ||||
-rw-r--r-- | project2/ice/iceRows.h | 3 | ||||
-rw-r--r-- | project2/ice/iceTask.h | 5 | ||||
-rw-r--r-- | project2/ice/slice2Common.cpp | 6 | ||||
-rw-r--r-- | project2/ice/slice2Common.h | 2 | ||||
-rw-r--r-- | project2/ice/slice2Rows.cpp | 2 | ||||
-rw-r--r-- | project2/ice/slice2Task.cpp | 2 | ||||
-rw-r--r-- | project2/ice/unittests/testClient.cpp | 28 | ||||
-rw-r--r-- | project2/ice/unittests/testClientCompile.cpp | 20 | ||||
-rw-r--r-- | project2/ice/unittests/testDaemon.cpp | 6 |
11 files changed, 42 insertions, 38 deletions
diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp index 0f56a33..cf1c446 100644 --- a/project2/ice/iceDaemon.cpp +++ b/project2/ice/iceDaemon.cpp @@ -96,7 +96,7 @@ class IceDaemonViewHost : public virtual CommonObjects, public virtual CheckHost CommonObjects(s), CheckHost(s) { - s->script->loader.addLoadTarget(s, Storer::into<ElementLoader>(&view)); + s->script->loader.addLoadTarget(s, Storer::into<FlatViewFactory>(&view)); } void executeView(RowSetPresenterPtr presenter, ExecContext * ec) const { diff --git a/project2/ice/iceDataSource.cpp b/project2/ice/iceDataSource.cpp index aa033fc..734eedc 100644 --- a/project2/ice/iceDataSource.cpp +++ b/project2/ice/iceDataSource.cpp @@ -44,12 +44,12 @@ IceDataSource::ClearSlice() libs.clear(); } -class IceDataSourceLoader : public ElementLoader::For<IceDataSource> { +class IceDataSourceLoader : public DataSourceFactory::For<IceDataSource>, public ComponentLoader { public: void onConfigLoad() override { IceBase::FinaliseLoad(IceDataSource::libs); } }; -DECLARE_CUSTOM_LOADER("icedatasource", IceDataSourceLoader); +NAMEDPLUGIN("icedatasource", IceDataSourceLoader, DataSourceFactory); diff --git a/project2/ice/iceRows.h b/project2/ice/iceRows.h index dc729ff..7fcda85 100644 --- a/project2/ice/iceRows.h +++ b/project2/ice/iceRows.h @@ -30,7 +30,8 @@ class IceRows : public RowSet, public IceClient<Interface> { IceClient<Interface>(p) { } - void loadComplete(const CommonObjects * co) { + void loadComplete(const CommonObjects * co) override + { IceClient<Interface>::loadComplete(co); } }; diff --git a/project2/ice/iceTask.h b/project2/ice/iceTask.h index 2d71818..281429f 100644 --- a/project2/ice/iceTask.h +++ b/project2/ice/iceTask.h @@ -15,7 +15,10 @@ class IceTask : public Task, public IceClient<Interface> { { } - void loadComplete(const CommonObjects * co) { IceClient<Interface>::loadComplete(co); } + void loadComplete(const CommonObjects * co) override + { + IceClient<Interface>::loadComplete(co); + } }; #endif diff --git a/project2/ice/slice2Common.cpp b/project2/ice/slice2Common.cpp index 9dfcf9f..9bd79aa 100644 --- a/project2/ice/slice2Common.cpp +++ b/project2/ice/slice2Common.cpp @@ -59,10 +59,10 @@ Slice2Common::ParameterVariables(Slice::OperationPtr o) } void -Slice2Common::Declaration(Slice::OperationPtr o) +Slice2Common::Declaration(Slice::OperationPtr o, const std::string & base) { - fprintf(code, "\t\t\tDECLARE_LOADER(\"%s-%s-%s\", %s);\n\n", - module.c_str(), interface.c_str(), o->name().c_str(), o->name().c_str()); + fprintf(code, "\t\t\tNAMEDFACTORY(\"%s-%s-%s\", %s, %s);\n\n", + module.c_str(), interface.c_str(), o->name().c_str(), o->name().c_str(), base.c_str()); } void diff --git a/project2/ice/slice2Common.h b/project2/ice/slice2Common.h index 170f0e7..8ea21d0 100644 --- a/project2/ice/slice2Common.h +++ b/project2/ice/slice2Common.h @@ -9,7 +9,7 @@ class Slice2Common : public Slice::ParserVisitor { void FunctionBegin(Slice::OperationPtr o); void ParameterVariables(Slice::OperationPtr o); - void Declaration(Slice::OperationPtr o); + void Declaration(Slice::OperationPtr o, const std::string &); void CallOperation(Slice::OperationPtr o); unsigned int Components() const; diff --git a/project2/ice/slice2Rows.cpp b/project2/ice/slice2Rows.cpp index 8c67222..b91d158 100644 --- a/project2/ice/slice2Rows.cpp +++ b/project2/ice/slice2Rows.cpp @@ -63,7 +63,7 @@ Slice2Rows::visitOperation(const Slice::OperationPtr & o) fprintf(code, "\t\t\t\t\t}\n\n"); ParameterVariables(o); fprintf(code, "\t\t\t};\n"); - Declaration(o); + Declaration(o, "RowSetFactory"); } } diff --git a/project2/ice/slice2Task.cpp b/project2/ice/slice2Task.cpp index 84a4f29..f6dc58f 100644 --- a/project2/ice/slice2Task.cpp +++ b/project2/ice/slice2Task.cpp @@ -61,7 +61,7 @@ Slice2Task::visitOperation(const Slice::OperationPtr & o) fprintf(code, "\t\t\t\t\t}\n\n"); ParameterVariables(o); fprintf(code, "\t\t\t};\n"); - Declaration(o); + Declaration(o, "TaskFactory"); } } diff --git a/project2/ice/unittests/testClient.cpp b/project2/ice/unittests/testClient.cpp index e979f82..e151055 100644 --- a/project2/ice/unittests/testClient.cpp +++ b/project2/ice/unittests/testClient.cpp @@ -105,13 +105,13 @@ void commonTests(ExecContext * ec) { BOOST_TEST_CHECKPOINT("Verify loaded"); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTask")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTaskParams")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SingleRow")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRows")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRowsParams")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTestComplex-ComplexInterface-ComplexParam")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTestComplex-ComplexInterface-ComplexRow")); + BOOST_REQUIRE(TaskFactory::get("UnitTest-SimpleInterface-SomeTask")); + BOOST_REQUIRE(TaskFactory::get("UnitTest-SimpleInterface-SomeTaskParams")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SingleRow")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SomeRows")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SomeRowsParams")); + BOOST_REQUIRE(TaskFactory::get("UnitTestComplex-ComplexInterface-ComplexParam")); + BOOST_REQUIRE(RowSetFactory::get("UnitTestComplex-ComplexInterface-ComplexRow")); BOOST_TEST_CHECKPOINT("Load test script"); ScriptReaderPtr r = new XmlScriptParser(iceroot / "testClient.xml"); @@ -142,13 +142,13 @@ void unloadTests() { BOOST_TEST_CHECKPOINT("Verify unloaded"); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTask"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTaskParams"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SingleRow"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRows"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRowsParams"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTestComplex-ComplexInterface-ComplexParam"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTestComplex-ComplexInterface-ComplexRow"), NotSupported); + BOOST_REQUIRE_THROW(TaskFactory::get("UnitTest-SimpleInterface-SomeTask"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(TaskFactory::get("UnitTest-SimpleInterface-SomeTaskParams"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SingleRow"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SomeRows"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SomeRowsParams"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(TaskFactory::get("UnitTestComplex-ComplexInterface-ComplexParam"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTestComplex-ComplexInterface-ComplexRow"), AdHoc::NoSuchPluginException); } void test_client_run(ExecContext *, const boost::filesystem::path & tmpdir); diff --git a/project2/ice/unittests/testClientCompile.cpp b/project2/ice/unittests/testClientCompile.cpp index 0332da7..a299fff 100644 --- a/project2/ice/unittests/testClientCompile.cpp +++ b/project2/ice/unittests/testClientCompile.cpp @@ -21,11 +21,11 @@ void commonTests() { BOOST_TEST_CHECKPOINT("Verify loaded"); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTask")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTaskParams")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SingleRow")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRows")); - BOOST_REQUIRE(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRowsParams")); + BOOST_REQUIRE(TaskFactory::get("UnitTest-SimpleInterface-SomeTask")); + BOOST_REQUIRE(TaskFactory::get("UnitTest-SimpleInterface-SomeTaskParams")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SingleRow")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SomeRows")); + BOOST_REQUIRE(RowSetFactory::get("UnitTest-SimpleInterface-SomeRowsParams")); } static @@ -33,11 +33,11 @@ void unloadTests() { BOOST_TEST_CHECKPOINT("Verify unloaded"); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTask"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeTaskParams"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SingleRow"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRows"), NotSupported); - BOOST_REQUIRE_THROW(ElementLoader::getFor("UnitTest-SimpleInterface-SomeRowsParams"), NotSupported); + BOOST_REQUIRE_THROW(TaskFactory::get("UnitTest-SimpleInterface-SomeTask"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(TaskFactory::get("UnitTest-SimpleInterface-SomeTaskParams"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SingleRow"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SomeRows"), AdHoc::NoSuchPluginException); + BOOST_REQUIRE_THROW(RowSetFactory::get("UnitTest-SimpleInterface-SomeRowsParams"), AdHoc::NoSuchPluginException); } BOOST_FIXTURE_TEST_SUITE( Core, TestAppInstance ); diff --git a/project2/ice/unittests/testDaemon.cpp b/project2/ice/unittests/testDaemon.cpp index a1985a4..3a31ebd 100644 --- a/project2/ice/unittests/testDaemon.cpp +++ b/project2/ice/unittests/testDaemon.cpp @@ -27,7 +27,7 @@ class DummyTask : public Task { static unsigned int execCount; }; -DECLARE_LOADER("DummyTask", DummyTask); +NAMEDFACTORY("DummyTask", DummyTask, TaskFactory); unsigned int DummyTask::execCount = 0; class DummyParamTask : public Task { @@ -53,7 +53,7 @@ class DummyParamTask : public Task { static VariableType execA; static VariableType execB; }; -DECLARE_LOADER("DummyParamTask", DummyParamTask); +NAMEDFACTORY("DummyParamTask", DummyParamTask, TaskFactory); unsigned int DummyParamTask::execCount = 0; VariableType DummyParamTask::execA; VariableType DummyParamTask::execB; @@ -85,7 +85,7 @@ class DummyComplexParamTask : public Task { static VariableType execB; static VariableType execD; }; -DECLARE_LOADER("DummyComplexParamTask", DummyComplexParamTask); +NAMEDFACTORY("DummyComplexParamTask", DummyComplexParamTask, TaskFactory); unsigned int DummyComplexParamTask::execCount = 0; VariableType DummyComplexParamTask::execA; VariableType DummyComplexParamTask::execB; |