cppmicroservices / cppmicroservices Goto Github PK
View Code? Open in Web Editor NEWAn OSGi-like C++ dynamic module system and service registry
Home Page: http://cppmicroservices.org
License: Apache License 2.0
An OSGi-like C++ dynamic module system and service registry
Home Page: http://cppmicroservices.org
License: Apache License 2.0
To reproduce:
This was seen on Windows and Linux. The issue should affect Mac as well (but I did not confirm).
On Linux you should see the following in a terminal:
terminate called after throwing an instance of 'std::runtime_error'
what(): bundle.name is not defined in the bundle manifest.
Abort
When the framework starts, the bundle name for CppMicroServices can't be found, causing the exception.
Log levels should be configurable. Further, all output during static initialization should be removed because there is no way disable it from depending modules.
The logging facility uses a singleton for managing log levels. Initialization is not thread-safe on compilers not supporting magic statics and multiple framework instances cannot be handled.
When installing bundles, a robust check for compatible shared libraries can be implemented using the available object format parsers.
There is a requirement to be able to start bundles based on the result of LDAP queries against a bundle's embedded meta data (properties).
The OSGi spec seems to already support this capability (i.e. matching based on a map of key/value pairs) within its Filter
interface, which CppMicroServices has implemented as LDAPFilter
.
I am proposing that a general "property" class be created, of which ServiceProperties
would derive. LDAPFilter
The general property class will insulate CppMicroServices users from how the framework manages all forms of properties (i.e. service, framework, bundle).
@CppMicroServices/collaborators A google doc detailing the functional design and requirements will soon follow for review.
This isn't required to be in 3.0, but would need to be in a point release (e.g. 3.x.y) soon after 3.0.
The work related to issue #15 allows the retrieval of module properties without loading the module's shared library. This leads to new module life-cycle states, e.g. to be able to access a module's properties, it must first be installed into the system to be known to other modules.
Currently all logging methods trace on stdout even when in release mode.
It would be nice to make that conditional on whether DEBUG mode is set.
CppMicroServices 2.1.0 fails to build using GCC 4.9.3 with C++11 (-std=c++11).
The build error would also occur in the latest development branch as well.
It appears that the build error occurs due a combination of factors:
functional
are found by the cmake build script (i.e. both US_HAVE_FUNCTIONAL_H
and US_HAVE_TR1_FUNCTIONAL_H
are defined).US_HAVE_STD_FUNCTION
and as a result, #define US_FUNCTION_TYPE std::function
is used.I have not looked into this further and I can only assume that in prior GCC versions, std::function
and std::tr1::function
were equivalent (since we can build CppMicroServices with GCC 4.7.2 using C++11).
Modifying usListenerFunctor_p.h to order the defines as such fixes the build error:
#ifdef US_HAVE_FUNCTIONAL_H
#include <functional>
#elif defined(US_HAVE_TR1_FUNCTIONAL_H)
#include <tr1/functional>
#endif
#ifdef US_HAVE_STD_FUNCTION
#define US_FUNCTION_TYPE std::function
#elif defined(US_HAVE_TR1_FUNCTION)
#define US_FUNCTION_TYPE std::tr1::function
#endif
Another approach would be to combine the two sets of #ifdef
s in a nested fashion.
#if defined (US_HAVE_FUNCTIONAL_H)
#include <functional>
#ifdef US_HAVE_STD_FUNCTION
#define US_FUNCTION_TYPE std::function
#endif
#elif defined(US_HAVE_TR1_FUNCTIONAL_H)
#include <tr1/functional>
#ifdef US_HAVE_TR1_FUNCTION
#define US_FUNCTION_TYPE std::tr1::function
#endif
#else
#error Can't find a functional implementation
#endif
Snippet of build output
[ 14%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceHooks.cpp.o
cd /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src && /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/bin/g++ -DCppMicroServices_EXPORTS -DUS_FORCE_MODULE_INIT -O2 -pipe -pthread -fPIC -std=c++11 -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option -fstack-protector-all -fvisibility=hidden -fvisibility-inlines-hidden -O2 -pipe -pthread -fPIC -std=c++11 -D_FORTIFY_SOURCE=2 -fPIC -I/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include -I/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/util -I/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service -I/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/module -o CMakeFiles/CppMicroServices.dir/service/usServiceHooks.cpp.o -c /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:33: error: ‘function’ in namespace ‘std’ does not name a template type
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:49:3: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
US_MODULE_LISTENER_FUNCTOR ModuleListenerMemberFunctor(X* x, void (X::*memFn)(const US_PREPEND_NAMESPACE(ModuleEvent)))
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: error: ‘function’ is not a member of ‘std’
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: note: suggested alternative:
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:33:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/tr1/functional:1592:11: note: ‘std::tr1::function’
class function;
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: error: ‘function’ is not a member of ‘std’
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: note: suggested alternative:
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:33:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/tr1/functional:1592:11: note: ‘std::tr1::function’
class function;
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:99: error: wrong number of template arguments (1, should be 2)
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
In file included from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_algobase.h:64:0,
from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_tree.h:61,
from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/map:60,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:26,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_pair.h:96:12: error: provided for ‘template<class _T1, class _T2> struct std::pair’
struct pair
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:52:98: error: wrong number of template arguments (2, should be 3)
struct ModuleListenerCompare : std::binary_function<std::pair<US_MODULE_LISTENER_FUNCTOR, void*>,
^
In file included from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_tree.h:63:0,
from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/map:60,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:26,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_function.h:118:12: error: provided for ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’
struct binary_function
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: error: ‘function’ is not a member of ‘std’
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: note: suggested alternative:
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:33:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/tr1/functional:1592:11: note: ‘std::tr1::function’
class function;
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: error: ‘function’ is not a member of ‘std’
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:39:28: note: suggested alternative:
#define US_FUNCTION_TYPE std::function
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:36: note: in expansion of macro ‘US_FUNCTION_TYPE’
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:33:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/tr1/functional:1592:11: note: ‘std::tr1::function’
class function;
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:44:99: error: wrong number of template arguments (1, should be 2)
#define US_MODULE_LISTENER_FUNCTOR US_FUNCTION_TYPE<void(const US_PREPEND_NAMESPACE(ModuleEvent)&)>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:65: note: in expansion of macro ‘US_MODULE_LISTENER_FUNCTOR’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
In file included from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_algobase.h:64:0,
from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_tree.h:61,
from /mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/map:60,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:26,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/hub/3rdparty/internal/1304863/glnxa64/gcc-4.9.3/include/c++/4.9.3/bits/stl_pair.h:96:12: error: provided for ‘template<class _T1, class _T2> struct std::pair’
struct pair
^
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usModuleContext.h:27:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.tpp:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTrackerPrivate.h:170,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.tpp:23,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:598,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:93: error: expected class-name before ‘void’
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:93: error: expected ‘{’ before ‘void’
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:98: error: expected unqualified-id before ‘>’ token
std::pair<US_MODULE_LISTENER_FUNCTOR, void*>, bool>
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usListenerFunctors_p.h:53:98: error: expected initializer before ‘>’ token
In file included from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usServiceInterface.h:26:0,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceReference.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceTracker.h:28,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks_p.h:25,
from /mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:22:
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/include/usConfig.h:106:29: error: expected ‘}’ at end of input
# define US_END_NAMESPACE }
^
/mathworks/devel/sandbox/jdicleme/3p-tmw/3p/derived/glnxa64/CppMicroServices/src/service/usServiceHooks.cpp:283:1: note: in expansion of macro ‘US_END_NAMESPACE’
US_END_NAMESPACE
^
Would the symbol be hidden for gcc < 4 ?
See https://github.com/saschazelzer/CppMicroServices/blob/master/usConfig.h.in#L42
In the current implementation the only way to see some output in the terminal when the resource compiler is run, is by rebuilding the tool with preprocessor flag DEBUG_TRACE set. A command line option "-v" would be helpful.
Embedded resources represented as ModuleResource objects should support last modified time data. This would be the last modified time of the file on the file system which is embedded into the module.
The US_DECLARE_SERVICE_INTERFACE
was meant to work like the Q_DECLARE_INTERFACE
macro if Qt headers are available. However, this never fully worked because moc needs an explicit Q_DECLARE_INTERFACE
statement when parsing the Q_INTERFACES
macro in a QObject derived class.
Follow up of code on forum http://forum.cppmicroservices.org/viewtopic.php?id=6
I now try to unload libA and check that there are no service references available.
During the call to GetModuleContext()->GetServiceReference("foo"), the program crashes.
The output ends with:
crash?
get service ref foo for module MainModule = 0 refs
Segmentation error
This happens during the call to GetServiceReference(), and the debug trace shows there are now 0 refs (compared to 1 before unloading). The earlier code shows the module as unloaded.
libA.Unload();
cout << "After unload" << endl;
for (auto it = modules.begin(); it != modules.end(); ++it) {
cout << (*it)->GetName() << endl;
}
moduleA = ModuleRegistry::GetModule("DictionaryServiceModule");
if (moduleA) {
cout << moduleA->IsLoaded() << endl;
} else {
cout << "errrrrrrror" << endl;
}
refs = GetModuleContext()->GetServiceReferences("");
for (auto it = refs.begin(); it != refs.end(); ++it) {
cout << (*it).GetProperty(ServiceConstants::OBJECTCLASS()) << endl;
}
cout<< "crash?"<<endl;
//![GetDictionaryService]
dictionaryServiceRef =
GetModuleContext()->GetServiceReference("foo");
if (dictionaryServiceRef) {
DictionaryService* dictionaryService = (DictionaryService*) GetModuleContext()->GetService(dictionaryServiceRef);
if (dictionaryService) {
std::cout << "Dictionary contains 'Tutorial': "
<< dictionaryService->checkWord("Tutorial") << std::endl;
}
}
return 0;
In some cases where a try{} catch{}
block is used to call module code and output error text, there is a separate catch for std::exception
type to allow printing the exception what()
message. In other cases, only a catch-all ...
is used.
The specific one I ran into is in src/service/usServiceListeners.cpp
within ServiceListeners::ServiceChanged
.
All headers should include what it needs and not rely on includes from other headers.
One of the main benefits is that is makes refactoring easier.
This would be a nice feature but still needs to be investigated, especially in a cross-platform set-up.
If an error occurs when calling dlopen(), the error message is not accessible errno
and strerror
. Instead, dlerror()
should be used.
The requirements and design will be discussed over Google docs. stay tuned.
The event listener example module still uses the old std::list<std::string>
type for the OBJECTLASS
property, leading to bad cast execptions.
If the CppMicroServices code is included and configured within a larger project, the usResourceCompiler target is sometimes not handled correctly.
The ModuleInfo
class is a public class to support the GetModuleContext()
function. With recent changes, it should now be possible to not rely on this class in the GetModuleContext()
function and maybe remove / refactor it.
See also jeffdiclemente#4.
On the development branch I ran into a build error when building with US_BUILD_SHARED_LIBS:BOOL=OFF
using GCC 4.7.2 and cmake-3.4.0-rc1.
snippet of the build log:
[ 96%] Linking CXX executable ../../bin/usWebConsoleDriver
cd /sandbox/jdicleme/CppMicroServices/webconsole/examples && /usr/local/cmake/cmake-3.4.0-rc1-Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/usWebConsoleDriver.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option -Wno-mismatched-tags -fstack-protector-all -fvisibility=hidden -fvisibility-inlines-hidden -g CMakeFiles/usWebConsoleDriver.dir/us_init.cpp.o CMakeFiles/usWebConsoleDriver.dir/usWebConsoleDriver.cpp.o -o ../../bin/usWebConsoleDriver -rdynamic ../../lib/libusHttpService.a ../../lib/libCppMicroServices.a -ldl
../../lib/libusHttpService.a(civetweb.c.o): In function `mg_start_thread':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:1819: undefined reference to `pthread_create'
../../lib/libusHttpService.a(civetweb.c.o): In function `mg_start_thread_with_id':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:1842: undefined reference to `pthread_create'
../../lib/libusHttpService.a(civetweb.c.o): In function `mg_join_thread':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:1856: undefined reference to `pthread_join'
../../lib/libusHttpService.a(civetweb.c.o): In function `worker_thread_run':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6113: undefined reference to `pthread_setspecific'
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6157: undefined reference to `pthread_setspecific'
../../lib/libusHttpService.a(civetweb.c.o): In function `master_thread_run':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6287: undefined reference to `pthread_setspecific'
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6349: undefined reference to `pthread_setspecific'
../../lib/libusHttpService.a(civetweb.c.o): In function `free_context':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6417: undefined reference to `pthread_key_delete'
../../lib/libusHttpService.a(civetweb.c.o): In function `mg_start':
/sandbox/jdicleme/CppMicroServices/third_party/civetweb/civetweb.c:6499: undefined reference to `pthread_key_create'
The newest Mac OS X 10.9 SDK does not provide the tr1 namespace anymore, leading to compile errors when trying to
#include <tr1/unordered_map>
and similar includes.
Hi,
CppMicroServices builds for me under MinGW, but fails to compile under VS 2012 RC with the platform SDK v7. The build fails when it hits ::CreateMutex. It builds if I use xxxW version, ::CreateMutexW, instead. I'm guessing MinGW defines a CreateMutex macro and the Platform SDK doesn't, but my knowledge of the Windows APIs is minimal.
The OSGi spec says that the system bundle should have an ID of 0.
Currently, the CppMicroServices bundle sets its ID to 1.
Static modules have currently some issues:
In us::GetLastErrorStr(), the buffer 'lpMsgBuf' returned from FormatMessage(...) is used without checking the return code of FormatMessage(...).
A crash can occur if FormatMessage(...) fails (i.e. lpMsgBuf will be uninitialized).
This error was found using VS 2013 code analysis.
Hi,
When I build CppMicroServices on Mac, the usConfig.h file is missing from the resulting framework directory. I see the public header directive includes ${us_config_h_file} but apparently that is not working. This occurs on Lion with cmake 2.8.8.
Two unit tests fail (usBundleManifestTest and usLDAPFilterTest ) due to what appears to be how Apple clang handles comparing types.
It appears that Apple clang compares the object addresses and not the string representaiton of the type.
Following is the compile error if US_DECLARE_SERVICE_INTERFACE is used in code ...
libSL1/usFooService.h:40:1: error: no template named 'us_service_interface_iid'; did you mean 'us::us_service_interface_iid'?
US_DECLARE_SERVICE_INTERFACE(us::FooService, "us::FooService")
The auto-loading facility needs to be reviewed and should be moved into its own module.
In anticipation of new modules in the source code, the public header files should be re-organized.
include/us
include/<module>
All header files will be stripped of the "us" prefix and the us
namespace will not be optional / changeable any more.
Header files also must not depend on configured information.
We used Valgrind Helgrind (http://valgrind.org/docs/manual/hg-manual.html ) to check thread safety in our code written so far. Among the reports generated by Helgrind on the unit-test executables of multiple modules, we see many instances of possible deadlocks related to libCppMicroServices. These are situations in which two threads acquire the same two mutex locks, but in opposite orders, i.e., a scenario that can potentially lead to dead locks if the relative timing of the two threads is interleaved in an unfortunate way. There are many instances of this error (thousands), but the copied error message below, in blue, is a representative sample.
As you can see, one thread acquires the two locks in the order of 0xEB58B68 and 0xEB33860, but another thread acquires the locks in the opposite order.
Observed (incorrect) order is: acquisition of lock at 0xEB58B68
==21976== at 0x4C2BAF5: pthread_mutex_lock (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21976== by 0x860C804: us::ServiceReferenceBasePrivate::GetService(us::Module_) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bi
n/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861ADBF: us::ModuleContext::GetService(us::ServiceReferenceBase const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/mat
lab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x432469: TestActivator::serviceProviderRegistered() (usModuleContext.h:615)
==21976== by 0x6CD5281: CppUnit::TestCaseMethodFunctor::operator()() const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CCB07E: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CD23F9: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CDB254: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test_, std::string const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CD5001: CppUnit::TestCase::run(CppUnit::TestResult_) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CD55E2: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult_) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CD54F5: CppUnit::TestComposite::run(CppUnit::TestResult_) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== by 0x6CD55E2: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult_) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976==
==21976== followed by a later acquisition of lock at 0xEB33860
==21976== at 0x4C2BAF5: pthread_mutex_lock (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21976== by 0x8613AC4: us::ServiceRegistry::Get(us::ModulePrivate_, std::string const&) const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861AD36: us::ModuleContext::GetServiceReference(std::string const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x65AD2E4: us::ServiceReferenceconnector::configuration::Configuration us::ModuleContext::GetServiceReferenceconnector::configuration::Configuration() (usModuleContext.h:534)
==21976== by 0x65AD38C: connector::us_common::Dependencyconnector::configuration::Configuration::get(us::ModuleContext_) (Utils.hpp:138)
==21976== by 0x65AE056: connector::us_common::ServiceConstructor1<connector::configuration::ConfigurationServiceProviderImpl, connector::us_common::Dependencyconnector::configuration::Configuration, connector::common::ConnectorLifecycle>::make(us::ModuleContext_) (Utils.hpp:540)
==21976== by 0x65AE143: connector::us_common::ServiceFactoryHelper<connector::us_common::ServiceConstructor1<connector::configuration::ConfigurationServiceProviderImpl, connector::us_common::Dependencyconnector::configuration::Configuration, connector::common::ConnectorLifecycle>, connector::us_common::MakeInterfaceMap1<connector::configuration::ConfigurationServiceProviderImpl, connector::ServiceProvider> >::GetService(us::Module_, us::ServiceRegistrationBase const&) (Utils.hpp:442)
==21976== by 0x860B326: us::ServiceReferenceBasePrivate::GetServiceFromFactory(us::Module_, us::ServiceFactory_, bool) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x860C896: us::ServiceReferenceBasePrivate::GetService(us::Module*) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861ADBF: us::ModuleContext::GetService(us::ServiceReferenceBase const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x432469: TestActivator::serviceProviderRegistered() (usModuleContext.h:615)
==21976== by 0x6CD5281: CppUnit::TestCaseMethodFunctor::operator()() const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libcppunit-1.12.so.1.0.0)
==21976== Required order was established by acquisition of lock at 0xEB33860
==21976== at 0x4C2BAF5: pthread_mutex_lock (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21976== by 0x8614297: us::ServiceRegistry::RegisterService(us::ModulePrivate_, std::map<std::string, void_, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_to<std::
string>, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861ACB9: us::ModuleContext::RegisterService(std::map<std::string, void*, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so
.2.1.0)
==21976== by 0x65A865D: connector::us_common::Registration<connector::us_common::ServiceFactoryConstructor<connector::us_common::ServiceConstructor1<connector::configuration::ConfigurationServiceProviderImpl, connector::us_common::Dependencyconnector::configuration::Configuration, connector::common::ConnectorLifecycle>, connector::us_common::MakeInterfaceMap1connector::configuration::ConfigurationServiceProviderImpl,connector::ServiceProvider >, connector::us_common::MakeInterfaceMap1<us::ServiceFactory, connector::ServiceProvider> >::start(us::ModuleContext_) (Utils.hpp:412)
==21976== by 0x65A8D78: std::mem_fun1_t<void, connector::us_common::WatchableDependencyconnector::Connector, us::ServiceEvent>::operator()(connector::us_common::WatchableDependencyconnector::Connector_, us::ServiceEvent) const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libmwconnectorconfigurationactivator.so)
==21976== by 0x65A8DD4: std::Function_handler<void ()(us::ServiceEvent const&), std::binder1st<std::mem_fun1_t<void, connector::us_common::WatchableDependencyconnector::Connector, us::ServiceEvent> > >::M_invoke(std::Any_data const&, us::ServiceEvent const&) (binders.h:120)
==21976== by 0x8601FBA: us::ServiceListeners::ServiceChanged(std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&, us::ServiceEvent const&, std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x86021D7: us::ServiceListeners::ServiceChanged(std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&, us::ServiceEvent const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x86146AB: us::ServiceRegistry::RegisterService(us::ModulePrivate, std::map<std::string, void, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861ACB9: us::ModuleContext::RegisterService(std::map<std::string, void*, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x430B98: us::ServiceRegistration<connector::Connector, void, void> us::ModuleContext::RegisterServiceconnector::Connector(connector::Connector, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (usModuleContext.h:235)
==21976== by 0x43131D: TestActivator::setUp() (TestActivator.cpp:55)
==21976==
==21976== followed by a later acquisition of lock at 0xEB58B68
==21976== at 0x4C2BAF5: pthread_mutex_lock (in /usr/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
==21976== by 0x86099A6: us::ServiceReferenceBase::GetProperty(std::string const&) const (in/mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x8609CC6: us::ServiceReferenceBase::operator<(us::ServiceReferenceBase const&) const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861555A: __gnu_cxx::_normal_iterator<us::ServiceRegistrationBase, std::vector<us::ServiceRegistrationBase, std::allocatorus::ServiceRegistrationBase > > std::lower_bound<__gnu_cxx::__normal_iterator<us::ServiceRegistrationBase*, std::vector<us::ServiceRegistrationBase, std::allocatorus::ServiceRegistrationBase > >, us::ServiceRegistrationBase>(__gnu_cxx::__normal_iterator<us::ServiceRegistrationBase*, std::vector<us::ServiceRegistrationBase, std::allocatorus::ServiceRegistrationBase > >, gnu_cxx::normal_iterator<us::ServiceRegistrationBase*, std::vector<us::ServiceRegistrationBase, std::allocatorus::ServiceRegistrationBase > >, us::ServiceRegistrationBase const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861448C: us::ServiceRegistry::RegisterService(us::ModulePrivate, std::map<std::string, void, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x861ACB9: us::ModuleContext::RegisterService(std::map<std::string, void*, std::lessstd::string, std::allocator<std::pair<std::string const,void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x65A865D: connector::us_common::Registration<connector::us_common::ServiceFactoryConstructor<connector::us_common::ServiceConstructor1<connector::configuration::ConfigurationServiceProviderImpl, connector::us_common::Dependencyconnector::configuration::Configuration, connector::common::ConnectorLifecycle>, connector::us_common::MakeInterfaceMap1<connector::configuration::ConfigurationServiceProviderImpl, connector::ServiceProvider> >, connector::us_common::MakeInterfaceMap1<us::ServiceFactory, connector::ServiceProvider> >::start(us::ModuleContext) (Utils.hpp:412)
==21976== by 0x65A8D78: std::mem_fun1_t<void, connector::us_common::WatchableDependencyconnector::Connector, us::ServiceEvent>::operator()(connector::us_common::WatchableDependencyconnector::Connector, us::ServiceEvent) const (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libmwconnectorconfigurationactivator.so)
==21976== by 0x65A8DD4: std::_Function_handler<void ()(us::ServiceEvent const&), std::binder1st<std::mem_fun1_t<void, connector::us_common::WatchableDependencyconnector::Connector, us::ServiceEvent> > >::M_invoke(std::Any_data const&, us::ServiceEvent const&) (binders.h:120)
==21976== by 0x8601FBA: us::ServiceListeners::ServiceChanged(std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&, us::ServiceEvent const&, std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x86021D7: us::ServiceListeners::ServiceChanged(std::unordered_set<us::ServiceListenerEntry, std::hashus::ServiceListenerEntry, std::equal_tous::ServiceListenerEntry, std::allocatorus::ServiceListenerEntry >&, us::ServiceEvent const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
==21976== by 0x86146AB: us::ServiceRegistry::RegisterService(us::ModulePrivate, std::map<std::string, void, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > > const&, std::unordered_map<std::string, us::Any, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, us::Any> > > const&) (in /mathworks/devel/sbs/36/scai.Bwitcpp.j265545/matlab/bin/glnxa64/libCppMicroServices.so.2.1.0)
In the current implementation the test tests the number of characters in the file. It is assumed, that there is one line ending character on linux and two on windows.
The assumption is usually correct, however the test might fail if git is used for the administration of the test data and the "autocrlf" option is incorrectly set.
Proper configuration is:
Windows: true
Linux: input
I will add a comment to the test linking to this issue in order to document this behaviour.
Define supported framework properties as constants together with their defaults.
See jeffdiclemente#5 for details.
The code in examples/eventlistener/Activator.cpp line 72 throws an unhandled exception due to a cast exception.
If you put a try/catch around it and check the exception you'll see the what() returns
RefAnyCast: Failed to convert between const Any types
Found in 13080ed which I believe is currently the master HEAD
At least five installed headers with the suffix "Private" or "_p", that #include non-installed headers (found under core/src), and therefore can't be used by a client. The specific headers are: usBundleHooks_p.h, usBundlePrivate.h, usFrameworkPrivate.h, usServiceHooks_p.h and usServiseListenerHook_p.h. None of these installed headers appear to be required by any other installed headers. There may be additional private headers being installed as well, which probably shouldn't be installed, to prevent any confusion or inadvertent use by clients.
We want to be consistent with OSGi in every way which makes sense in the native C++ world. One of these ways is nomenclature/terminology.
All terminology within CppMicroServices (code and documentation) should be changed to use OSGi nomenclature, where applicable.
Some examples:
CppMicroServices 2.1.0 terminology | OSGi terminology |
---|---|
us::Module::Start() | us::Bundle::Start() |
us::Module::Stop() | us::Bundle::Stop() |
us::ModuleActivator::Load() | us::BundleActivator::Start() |
us::ModuleActivator::UnLoad() | us::BundleActivator::Stop() |
us::ModuleContext::InstallBundle(...) | us::BundleContext::InstallBundle(...) |
*See jeffidiclemente#1 for historical information.
Use the new travis support from Coverity Scan and fix the reported issues.
Currently, the module.name property is required to be present in a custom manifest.json file. The MODULE_NAME
define contains this information but it is not recorded in the compiled object anymore (it was recorded in the deprecated ModuleInfo
object previously).
It would be nice to not require a custom manifest.json file and record the module name in the meta data automatically.
With the newly introduced life-cycle of the framework itself and its associated modules, a Module*
could outlive its association with the framework.
A Framework*
instance could be shared between different parties.
Service instances currently need to be managed by the registering party. Using shared pointer semantics could ease memory management and keep track of used "handles" from modules within other modules and make ungetService
calls superfluous.
For Visual Studio 2008, a custom functor implementation is used for service listener objects (instead of std::(tr1)::function
). The target()
method returns different values for different service listener objects pointing to the same member function, which leads to mismatches when removing a previously registered member function from the listener registry.
Investigate the possible usage of C++11 language and library features and their implications on the minimal required compiler versions.
Features to consider:
Hi, I got wxwidgets running as a cppmicroservices module, but while getting it to work, I encountered this issue:
...cppmicroservices\core\include\usServiceEvent.h(29): fatal error C1189: #error :
The REGISTERED preprocessor define clashes with the ServiceEvent::REGISTERED enum type. Try to reorder your includes, compile with WIN32_LEAN_AND_MEAN, or undef the REGISTERED macro befor including this header.
[C:\Users\Azriel\dev\bii\sl_desktop_demo_wx\bii\build\azriel_sl_desktop_demo_wx\azriel_sl_desktop_demo_wx_test_main.vcxproj]
If my includes have an #undef
in the following order, the compilation succeeds:
#include "fenix/wxwidgets/wx/wxprec.h"
#ifndef WX_PRECOMP
#include "fenix/wxwidgets/wx/wx.h"
#endif
#undef REGISTERED
#include <azriel/cppmicroservices/core/include/usModuleRegistry.h>
I just noticed, there's a typo: befor
.
I can make a PR, but what should I call the macro? US_REGISTERED
has a double meaning.
Creating service listeners leaks memory due to the class not having a virtual destructor.
I'm trying to build CppMicroServices very naively. Here's the full log with error:
make clean && make
[ 1%] Building CXX object src/CMakeFiles/CppMicroServices.dir/util/usAny.cpp.o
[ 3%] Building CXX object src/CMakeFiles/CppMicroServices.dir/util/usThreads.cpp.o
[ 5%] Building CXX object src/CMakeFiles/CppMicroServices.dir/util/usUtils.cpp.o
[ 7%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usLDAPExpr.cpp.o
[ 9%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usLDAPFilter.cpp.o
[ 11%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceException.cpp.o
[ 13%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceEvent.cpp.o
[ 15%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceListenerEntry.cpp.o
[ 17%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceListeners.cpp.o
[ 19%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceProperties.cpp.o
[ 21%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceReference.cpp.o
[ 23%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceReferencePrivate.cpp.o
[ 25%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceRegistration.cpp.o
[ 27%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceRegistrationPrivate.cpp.o
[ 29%] Building CXX object src/CMakeFiles/CppMicroServices.dir/service/usServiceRegistry.cpp.o
[ 31%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usCoreModuleContext.cpp.o
[ 33%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleContext.cpp.o
[ 35%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModule.cpp.o
[ 37%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleEvent.cpp.o
[ 39%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleInfo.cpp.o
[ 41%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModulePrivate.cpp.o
[ 43%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleRegistry.cpp.o
[ 45%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleUtils.cpp.o
[ 47%] Building CXX object src/CMakeFiles/CppMicroServices.dir/module/usModuleVersion.cpp.o
[ 49%] Building CXX object src/CMakeFiles/CppMicroServices.dir/CppMicroServices_init.cpp.o
Linking CXX shared library ../lib/libCppMicroServices.so
[ 49%] Built target CppMicroServices
[ 50%] Building CXX object test/modules/libA/CMakeFiles/TestModuleA.dir/usTestModuleA.cpp.o
In file included from /home/simon/Workspace/Misc/CppMicroServices/include/usSharedData.h:32:0,
from /home/simon/Workspace/Misc/CppMicroServices/include/usServiceEvent.h:25,
from /home/simon/Workspace/Misc/CppMicroServices/include/usUtils_p.h:90,
from /home/simon/Workspace/Misc/CppMicroServices/include/usModuleContext.h:25,
from /home/simon/Workspace/Misc/CppMicroServices/test/modules/libA/usTestModuleA.cpp:25:
/home/simon/Workspace/Misc/CppMicroServices/include/usAtomicInt_p.h:27:25: erreur fatale: usThreads_p.h : Aucun fichier ou dossier de ce type
compilation terminée.
make[2]: *** [test/modules/libA/CMakeFiles/TestModuleA.dir/usTestModuleA.cpp.o] Erreur 1
make[1]: *** [test/modules/libA/CMakeFiles/TestModuleA.dir/all] Erreur 2
make: *** [all] Erreur 2
Fails on: usThreads_p.h: No such file or folder.
The file is in src/util/ and properly found at earlier stages of the build, but not found when trying to build the TestModule.
I'm using CMake 2.8.7 and G++ 4.6.3.
The Any class has a generic ToString() method. It should use a standard notation for printing its value. JSON is a good fit for this purpose.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.