You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2022/06/28 13:35:46 UTC

[celix] 01/01: Merge pull request #424 from apache/feature/print_function_for_dm_info

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/celix.git

commit b85a17e3b3817f12d9202bb07ee500a857f59d7f
Merge: 424982f6 d6afb40a
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Tue Jun 28 15:35:40 2022 +0200

    Merge pull request #424 from apache/feature/print_function_for_dm_info
    
    Adds print functions for dependency manager

 bundles/shell/shell/src/dm_shell_list_command.c    | 104 +--------------------
 .../gtest/src/DependencyManagerTestSuite.cc        |  64 +++++++++++++
 libs/framework/include/celix/dm/Component.h        |   8 +-
 libs/framework/include/celix/dm/Component_Impl.h   |  18 +++-
 .../framework/include/celix/dm/DependencyManager.h |  12 ++-
 .../include/celix/dm/DependencyManager_Impl.h      |  11 +++
 libs/framework/include/celix_dependency_manager.h  |  59 +++++++-----
 libs/framework/include/celix_dm_component.h        |  23 +++--
 libs/framework/include/celix_dm_info.h             |   6 +-
 libs/framework/src/dm_component_impl.c             |  95 +++++++++++++++++--
 libs/framework/src/dm_dependency_manager_impl.c    |  27 +++++-
 libs/utils/include/celix/Utils.h                   |  32 +++++++
 12 files changed, 317 insertions(+), 142 deletions(-)

diff --cc libs/framework/include/celix_dm_component.h
index 6f0b0d5a,29ea96d9..d5e3407f
--- a/libs/framework/include/celix_dm_component.h
+++ b/libs/framework/include/celix_dm_component.h
@@@ -189,22 -163,23 +189,30 @@@ celix_status_t celix_dmComponent_setCal
  /**
   * Set the component life cycle callbacks using a MACRO for improving the type safety.
   */
 -#define CELIX_DMCOMPONENT_SETCALLBACKS(dmCmp, type, init, start, stop, deinit) \
 +#define CELIX_DM_COMPONENT_SET_CALLBACKS(dmCmp, type, init, start, stop, deinit) \
      do {  \
 -        int (*tmp_init)(type)   = (init); \
 -        int (*tmp_start)(type)  = (start); \
 -        int (*tmp_stop)(type)   = (stop); \
 -        int (*tmp_deinit)(type) = (deinit); \
 -        celix_dmComponent_setCallbacks((dmCmp), (celix_dm_cmp_lifecycle_fpt)tmp_init, (celix_dm_cmp_lifecycle_fpt)tmp_start, (celix_dm_cmp_lifecycle_fpt)tmp_stop, (celix_dm_cmp_lifecycle_fpt)tmp_deinit); \
 +        int (*_tmp_init)(type*)   = (init); \
 +        int (*_tmp_start)(type*)  = (start); \
 +        int (*_tmp_stop)(type*)   = (stop); \
 +        int (*_tmp_deinit)(type*) = (deinit); \
 +        celix_dmComponent_setCallbacks((dmCmp), (celix_dm_cmp_lifecycle_fpt)_tmp_init, (celix_dm_cmp_lifecycle_fpt)_tmp_start, (celix_dm_cmp_lifecycle_fpt)_tmp_stop, (celix_dm_cmp_lifecycle_fpt)_tmp_deinit); \
      } while(0)
  
+ 
+ bool celix_dmComponent_isActive(celix_dm_component_t *component);
+ 
+ /**
+  * Returns the string value of a provided state
+  */
+ const char* celix_dmComponent_stateToString(celix_dm_component_state_t state);
+ 
 +/**
 + * Deprecated, use CELIX_DM_COMPONENT_SET_CALLBACKS instead.
 + */
 +
 +#define CELIX_DMCOMPONENT_SETCALLBACKS(dmCmp, type, init, start, stop, deinit) \
 +    CELIX_DM_COMPONENT_SET_CALLBACKS(dmCmp, type*, init, start, stop, deinit)
 +
  /**
   * Create a DM Component info struct. Containing information about the component.
   * Caller has ownership.