Merge pull request #424 from apache/feature/print_function_for_dm_info master
authorPepijn Noltes <pepijnnoltes@gmail.com>
Tue, 28 Jun 2022 13:35:40 +0000 (15:35 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Jun 2022 13:35:40 +0000 (15:35 +0200)
Adds print functions for dependency manager

1  2 
libs/framework/gtest/src/DependencyManagerTestSuite.cc
libs/framework/include/celix/dm/Component.h
libs/framework/include/celix/dm/Component_Impl.h
libs/framework/include/celix_dependency_manager.h
libs/framework/include/celix_dm_component.h
libs/framework/src/dm_component_impl.c
libs/framework/src/dm_dependency_manager_impl.c

index 6f0b0d5a2287cee75b9660865fc0925e6110b71a,29ea96d994b53eab63546466154030fb1e39c82c..d5e3407f5a9984246d9a5283620b7b96608aee30
@@@ -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.