Page MenuHomePhabricator

Pull out CppMicroServices from Core/Code and use base-class free version
Closed, ResolvedPublic

Description

This is a feature request.

Until now, the CppMicroServices code relied on a base class for every service implementation (which has been itk::LightObject in the MITK context). This base class was configured into the CppMicroServices code and CMake configure time. Hence the library was "fixed" to this base class type and could not be easily shared across different projects which might have different base class requirements.

With "version 2" of the CppMicroServices code, the base class requirement has been removed. Further, the API has been modified to be more type-safe in the context of service references and registrations. MITK should be updated to include the improved CppMicroServices code.

Since the new design allows for the CppMicroServices code to be compiled into a generic shared library, MITK should use it that way. As discussed with Marco, the Code (currently in Core/Code/CppMicroServices) should be moved to Core/CppMicroServices and build separately. It should than be made available to other MITK modules via the MITK CMake module system (by providing a custom "module config" file for the CppMicroServices library).

Event Timeline

New remote branch pushed: bug-15707-cppmicroservices-api-version-2

TL;DR version: Git subtree support for CppMicroServices code would be nice to have, but the current Git server hooks cannot handle parent-less commits.


The pushed branch bug-15707-cppmicroservices-api-version-2 contains a commit which moved and updated the code from Core/Code/CppMicroServices to Core/CppMicroServices.

Because the CppMicroServices stuff is also available as a separate Git repository, we thought about ways how to handle changes in both repositories (MITK and CppMicroServices) in a nice way. The two main options turned out to be Git submodules and subtrees. I would like to use Git subtree:

http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/

Since we decided to move the CppMicroServices directoriy inside of Mitk, this would be the ideal point in time to introduce the CppMicroServices code as a "subtree". I have a branch ready for that. However, subtrees for external projects are initially imported by creating a separate commit (with no parent) containing the project's source code (only one commit, if --squash is used) and this is commit is then merged into the current branch:

\
* da9d6a5 Squashed 'Core/CppMicroServices/' content from commit 49a40c9
  • 9b0dba3 (HEAD, origin/master, origin/HEAD, master) Merge branch 'bug-15838-TriangulationThreshold'

Currently, the server side Git hook aborts when trying to push such a branch, because it assumes the commits always have at least one parent:

remote: Update hook checks refs/heads/bug-15707-cppmicroservices-api-version-2-subtree ...
remote: refs/heads/bug-15707-cppmicroservices-api-version-2-subtree is topic branch
remote: Traceback (most recent call last):
remote: File "./hooks/bugzilla.py", line 471, in <module>
remote: if check_commit(commit, False, skip_whitespace_and_copyright_check ) == False:
remote: File "./hooks/bugzilla.py", line 227, in check_commit
remote: first_parent = current_commit.parents[0]
remote: IndexError: tuple index out of range
remote: hooks/update.secondary died
remote: error: hook declined to update refs/heads/bug-15707-cppmicroservices-api-version-2-subtree

I would suggest to fix the Python script or to temporarily disable the server hook but I don't know if there are more side-effects lurking in the scripts due to the parent-less commit. Adding Git subtree support to to an existing source code directory later on doesn't seem to be possible without first removing that directory and committing the local changes.

[b3cd31]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-13 19:57:07 Sascha Zelzer [324c22]
Don't generate code for header only modules


2013-08-12 09:18:21 Sascha Zelzer [3112c7]
Use the new CppMicroServices API from Core/CppMicroServices.


2013-08-12 21:02:02 Sascha Zelzer [87b652]
Merge commit 'da9d6a5c2aeaa5415371bc1682ed303dc62d8320' as 'Core/CppMicroServices'


2013-08-12 21:02:02 Sascha Zelzer [da9d6a]
Squashed 'Core/CppMicroServices/' content from commit 49a40c9

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 49a40c9b59ab2184c2046247ff57a6cae69a0f9a

[c31cba]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-13 22:03:26 Sascha Zelzer [97fdb1]
COMP: Adding missing assert header.

[de6529]: COMP: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-14 00:47:51 Sascha Zelzer [d79198]
Merge commit 'a60a72c86fc75100a1823ac8591a8b6be817aec5' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-14 00:47:50 Sascha Zelzer [a60a72]
Squashed 'Core/CppMicroServices/' changes from 49a40c9..2bddc98

2bddc98 Silence warnings related to handling dlsym return values.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 2bddc98fefc9a37712ca4e2df598c6c5acb9cf97


2013-08-14 00:28:02 Sascha Zelzer [43a160]
COMP: Fixed ToF PMD module to compile with new micro services API.


2013-08-14 00:27:23 Sascha Zelzer [43c398]
COMP: Removed std::map from DLL interface

Also added mutex locks for thread safety.

[886da4]: COMP: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-14 12:22:42 Sascha Zelzer [c92341]
Merge commit 'f601d46e40ef25e440bf1a4ae3fff625e2437d13' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-14 12:22:42 Sascha Zelzer [f601d4]
Squashed 'Core/CppMicroServices/' changes from 2bddc98..2d40eb1

2d40eb1 Silence Clang warning about unused member.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 2d40eb1b64a25100a19f05bd2d6be47732a7b337

[e28f62]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-14 14:15:16 Caspar Goch [58f0df]
Added include which is not transitively included in MSVS 2010 and later

[6ff776]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-14 15:25:35 Sascha Zelzer [045e9b]
Merge commit '1e8fdff777c0e9d171634823ab3a1f986e93712b' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-14 15:25:35 Sascha Zelzer [1e8fdf]
Squashed 'Core/CppMicroServices/' changes from 2bddc98..8dcbc82

8dcbc82 Added include which is not transitively included in MSVS 2010 and later
f0199b8 Don't track invalid service references at all.
1b34711 Align ServiceTracker API by return std::vector.
d21222b Check for invalid references in operators.
2d40eb1 Silence Clang warning about unused member.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 8dcbc82d75e1a2a18c488e2c0103ee6b7ad67ee6

[9ad37a]: COMP: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-14 16:07:54 Sascha Zelzer [99cb82]
Don not hard code interface ids in filter expressions.


2013-08-14 16:07:26 Sascha Zelzer [85522e]
Adapt to changed micro services API.

New remote branch pushed: bug-15707-FixToFDeviceFactories

[fa6a93]: Merge branch 'bug-15707-FixToFDeviceFactories'

Merged commits:

2013-08-15 13:16:45 Thomas Kilgus [b21fce]
MicroServices are now in namespace us. Fixed includes etc..

[0376cc]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-15 17:33:26 Sascha Zelzer [900d24]
Don't use install components for now.


2013-08-15 17:02:44 Sascha Zelzer [912d7d]
Merge commit 'dee28ad5fbf506a5039f39168b5c6bb44e903f53' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-15 17:02:44 Sascha Zelzer [dee28a]
Squashed 'Core/CppMicroServices/' changes from 8dcbc82..1ade259

1ade259 Make the install component name for sdk artifacts configurable.
efa3f7c Added a utility class for creating LDAP filter strings.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 1ade2593ee95d2d56e1aab3093c4ca8538d6dd1d

[b29562]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-16 03:36:05 Sascha Zelzer [1364de]
Merge commit 'e1fd2e3bfc71857d80e37085c3d7c591fadaf1aa' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-16 03:36:05 Sascha Zelzer [e1fd2e]
Squashed 'Core/CppMicroServices/' changes from 1ade259..913d225

913d225 Fixed return value for UngetService().
ee77b13 Fixed initial reference count value for ServiceObjects.
ae91e5b Removed all code related enabled/disabled service factory support.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 913d2259ed4d6da684a56056cc4be5f73b011514

[6d6f11]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-18 18:29:14 Sascha Zelzer [ac900b]
Merge commit 'f04a669ec67801242237915d89a7dde8da12f8ec' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-18 18:29:14 Sascha Zelzer [f04a66]
Squashed 'Core/CppMicroServices/' changes from 913d225..100cffb

100cffb Use the safe bool idiom to avoid unwanted implicit conversions.

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 100cffb0793126a305257af959bbfae5aa5aec87

[ca4ffc]: Merge branch 'bug-15707-cppmicroservices-api-version-2-subtree'

Merged commits:

2013-08-27 10:29:02 Sascha Zelzer [636137]
Merge commit 'c502918c668414f818c8167d4acaa99038b1f007' into bug-15707-cppmicroservices-api-version-2-subtree


2013-08-27 10:29:01 Sascha Zelzer [c50291]
Squashed 'Core/CppMicroServices/' changes from 100cffb..2a5abcb

2a5abcb Fixed OR operator for LDAP expressions.
70acf9e Added support for NULL values in LDAP expressions.
01a4608 Disable warning 4503 (decorated name length exceeded).

git-subtree-dir: Core/CppMicroServices
git-subtree-split: 2a5abcb34ed09599031a39f079e57515d3f23022