Fix for C++
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/50f9f161 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/50f9f161 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/50f9f161 Branch: refs/heads/ignite-3477-debug Commit: 50f9f1612d6f2b3d2f9ee1a2bd4cac3402673753 Parents: 06cee57 Author: Igor Sapego <[email protected]> Authored: Tue Apr 11 21:51:30 2017 +0300 Committer: Igor Sapego <[email protected]> Committed: Tue Apr 11 21:51:30 2017 +0300 ---------------------------------------------------------------------- .../cpp/core-test/src/continuous_query_test.cpp | 11 ++++++--- .../core/include/ignite/impl/module_manager.h | 26 ++++++++++++++++++++ .../examples/include/ignite/examples/person.h | 1 - 3 files changed, 33 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core-test/src/continuous_query_test.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp index e09b403..2d1a2ee 100644 --- a/modules/platforms/cpp/core-test/src/continuous_query_test.cpp +++ b/modules/platforms/cpp/core-test/src/continuous_query_test.cpp @@ -373,6 +373,13 @@ void CheckEvents(Cache<int, TestEntry>& cache, Listener<int, TestEntry>& lsnr) lsnr.CheckNextEvent(1, TestEntry(20), boost::none); } +IGNITE_EXPORTED_CALL void IgniteModuleInit0(ignite::IgniteBindingContext& context) +{ + IgniteBinding binding = context.GetBingding(); + + binding.RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >(); +} + BOOST_FIXTURE_TEST_SUITE(ContinuousQueryTestSuite, ContinuousQueryTestSuiteFixture) BOOST_AUTO_TEST_CASE(TestBasic) @@ -679,8 +686,6 @@ BOOST_AUTO_TEST_CASE(TestPublicPrivateConstantsConsistence) BOOST_AUTO_TEST_CASE(TestFilterSingleNode) { - node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >(); - Listener<int, TestEntry> lsnr; RangeFilter<int, TestEntry> filter(100, 150); @@ -726,8 +731,6 @@ BOOST_AUTO_TEST_CASE(TestFilterMultipleNodes) Ignite node3 = ignite_test::StartNode("cache-query-continuous.xml", "node-03"); #endif - node.GetBinding().RegisterCacheEntryEventFilter< RangeFilter<int, TestEntry> >(); - Listener<int, TestEntry> lsnr; RangeFilter<int, TestEntry> filter(100, 150); http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/core/include/ignite/impl/module_manager.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h index 55e6943..1f9783e 100644 --- a/modules/platforms/cpp/core/include/ignite/impl/module_manager.h +++ b/modules/platforms/cpp/core/include/ignite/impl/module_manager.h @@ -19,6 +19,7 @@ #define _IGNITE_IMPL_MODULE_MANAGER #include <vector> +#include <sstream> #include <ignite/common/common.h> #include <ignite/common/dynamic_load_os.h> @@ -30,6 +31,11 @@ */ #define IGNITE_MODULE_INIT_CALLBACK_NAME "IgniteModuleInit" +/** + * Max number of additional init callbacks + */ +#define IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM 100 + #define IGNITE_EXPORTED_CALL \ extern "C" IGNITE_IMPORT_EXPORT @@ -102,6 +108,16 @@ namespace ignite if (callback) callback(bindingContext); + + for (int i = 0; i < IGNITE_MODULE_ADDITIONAL_INIT_CALLBACKS_MAX_NUM; ++i) + { + ModuleInitCallback* callback0 = GetAdditionalModuleInitCallback(module, i); + + if (!callback0) + break; + + callback0(bindingContext); + } } private: @@ -119,6 +135,16 @@ namespace ignite module.FindSymbol(IGNITE_MODULE_INIT_CALLBACK_NAME)); } + static ModuleInitCallback* GetAdditionalModuleInitCallback(Module& module, int num) + { + std::stringstream tmp; + + tmp << IGNITE_MODULE_INIT_CALLBACK_NAME << num; + + return reinterpret_cast<ModuleInitCallback*>( + module.FindSymbol(tmp.str())); + } + /** Collection of loaded modules. */ std::vector<Module> loadedModules; http://git-wip-us.apache.org/repos/asf/ignite/blob/50f9f161/modules/platforms/cpp/examples/include/ignite/examples/person.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/examples/include/ignite/examples/person.h b/modules/platforms/cpp/examples/include/ignite/examples/person.h index 86c51c8..64693a9 100644 --- a/modules/platforms/cpp/examples/include/ignite/examples/person.h +++ b/modules/platforms/cpp/examples/include/ignite/examples/person.h @@ -79,7 +79,6 @@ namespace ignite IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person) IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person) IGNITE_BINARY_GET_FIELD_ID_AS_HASH - IGNITE_BINARY_GET_HASH_CODE_ZERO(Person) IGNITE_BINARY_IS_NULL_FALSE(Person) IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)
