Apache Celix  2.4.0
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
celix_dm_service_dependency.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef CELIX_DM_SERVICE_DEPENDENCY_H_
21 #define CELIX_DM_SERVICE_DEPENDENCY_H_
22 
23 #include "celix_types.h"
24 #include "celix_errno.h"
25 #include "celix_threads.h"
26 #include "celix_dm_info.h"
27 #include "celix_framework_export.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
38 
39 typedef int (*celix_dm_service_update_fp)(void *handle, void* service);
40 typedef int (*celix_dm_service_swap_fp)(void *handle, void* oldService, void* newService);
41 
42 typedef int (*celix_dm_service_update_with_props_fp)(void *handle, void* service, const celix_properties_t *props);
43 typedef int (*celix_dm_service_swap_with_props_fp)(void *handle, void* oldService, void* newService, const celix_properties_t *newProps);
44 
49  celix_dm_service_swap_fp swap; //not used, deprecated
50 
56 
57 #define CELIX_EMPTY_DM_SERVICE_DEPENDENCY_CALLBACK_OPTIONS { .set = NULL, \
58  .add = NULL, \
59  .remove = NULL, \
60  .swap = NULL, \
61  .setWithProps = NULL, \
62  .addWithProps = NULL, \
63  .removeWithProps = NULL, \
64  .swapWithProps = NULL }
65 
73 CELIX_FRAMEWORK_EXPORT celix_dm_service_dependency_t* celix_dmServiceDependency_create(void);
74 
82 CELIX_FRAMEWORK_EXPORT void celix_dmServiceDependency_destroy(celix_dm_service_dependency_t *dep);
83 
87 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setRequired(celix_dm_service_dependency_t *dependency, bool required);
88 
93 CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t celix_dmServiceDependency_setAddCLanguageFilter(celix_dm_service_dependency_t *dependency, bool addCLangFilter);
94 
108 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setStrategy(celix_dm_service_dependency_t *dependency, celix_dm_service_dependency_strategy_t strategy);
109 
113 CELIX_FRAMEWORK_EXPORT celix_dm_service_dependency_strategy_t celix_dmServiceDependency_getStrategy(celix_dm_service_dependency_t *dependency);
114 
122 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setService(celix_dm_service_dependency_t *dependency, const char* serviceName, const char* serviceVersionRange, const char* filter);
123 
127 CELIX_FRAMEWORK_EXPORT const char* celix_dmServiceDependency_getFilter(celix_dm_service_dependency_t *dependency);
128 
134 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallback(celix_dm_service_dependency_t *dependency, celix_dm_service_update_fp set);
135 
142 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbackWithProperties(celix_dm_service_dependency_t *dependency, celix_dm_service_update_with_props_fp set);
143 
150 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbacksWithOptions(celix_dm_service_dependency_t *dependency, const celix_dm_service_dependency_callback_options_t *opts);
151 
157 CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbackHandle(celix_dm_service_dependency_t *dependency, void* handle);
158 
163 CELIX_FRAMEWORK_EXPORT dm_service_dependency_info_t* celix_dmServiceDependency_createInfo(celix_dm_service_dependency_t* dep);
164 
168 CELIX_FRAMEWORK_EXPORT void celix_dmServiceDependency_destroyInfo(celix_dm_service_dependency_t *dep, dm_service_dependency_info_t *info);
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif /* CELIX_DM_SERVICE_DEPENDENCY_H_ */
celix_dmServiceDependency_setCallback
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallback(celix_dm_service_dependency_t *dependency, celix_dm_service_update_fp set)
celix_dm_service_dependency_callback_options::swapWithProps
celix_dm_service_swap_with_props_fp swapWithProps
Definition: celix_dm_service_dependency.h:54
celix_dm_service_dependency_callback_options::removeWithProps
celix_dm_service_update_with_props_fp removeWithProps
Definition: celix_dm_service_dependency.h:53
celix_dm_service_dependency_callback_options::add
celix_dm_service_update_fp add
Definition: celix_dm_service_dependency.h:47
celix_dm_service_dependency_strategy_enum
celix_dm_service_dependency_strategy_enum
Definition: celix_dm_service_dependency.h:34
celix_dm_info.h
celix_dm_service_dependency_info_struct
Definition: celix_dm_info.h:41
celix_dm_service_dependency_callback_options::remove
celix_dm_service_update_fp remove
Definition: celix_dm_service_dependency.h:48
celix_dmServiceDependency_setStrategy
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setStrategy(celix_dm_service_dependency_t *dependency, celix_dm_service_dependency_strategy_t strategy)
celix_dm_service_dependency_callback_options_t
struct celix_dm_service_dependency_callback_options celix_dm_service_dependency_callback_options_t
celix_dmServiceDependency_getStrategy
CELIX_FRAMEWORK_EXPORT celix_dm_service_dependency_strategy_t celix_dmServiceDependency_getStrategy(celix_dm_service_dependency_t *dependency)
celix_dm_service_dependency_callback_options::swap
celix_dm_service_swap_fp swap
Definition: celix_dm_service_dependency.h:49
celix_dm_service_dependency_callback_options::set
celix_dm_service_update_fp set
Definition: celix_dm_service_dependency.h:46
celix_dmServiceDependency_setAddCLanguageFilter
CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t celix_dmServiceDependency_setAddCLanguageFilter(celix_dm_service_dependency_t *dependency, bool addCLangFilter)
celix_dmServiceDependency_destroyInfo
CELIX_FRAMEWORK_EXPORT void celix_dmServiceDependency_destroyInfo(celix_dm_service_dependency_t *dep, dm_service_dependency_info_t *info)
celix_dm_service_dependency_callback_options::setWithProps
celix_dm_service_update_with_props_fp setWithProps
Definition: celix_dm_service_dependency.h:51
celix_dmServiceDependency_setRequired
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setRequired(celix_dm_service_dependency_t *dependency, bool required)
celix_dm_service_dependency_callback_options::addWithProps
celix_dm_service_update_with_props_fp addWithProps
Definition: celix_dm_service_dependency.h:52
DM_SERVICE_DEPENDENCY_STRATEGY_LOCKING
@ DM_SERVICE_DEPENDENCY_STRATEGY_LOCKING
Definition: celix_dm_service_dependency.h:35
celix_dmServiceDependency_setCallbackHandle
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbackHandle(celix_dm_service_dependency_t *dependency, void *handle)
celix_dm_service_swap_with_props_fp
int(* celix_dm_service_swap_with_props_fp)(void *handle, void *oldService, void *newService, const celix_properties_t *newProps)
Definition: celix_dm_service_dependency.h:43
celix_dm_service_update_fp
int(* celix_dm_service_update_fp)(void *handle, void *service)
Definition: celix_dm_service_dependency.h:39
celix_dmServiceDependency_setService
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setService(celix_dm_service_dependency_t *dependency, const char *serviceName, const char *serviceVersionRange, const char *filter)
celix_dm_service_update_with_props_fp
int(* celix_dm_service_update_with_props_fp)(void *handle, void *service, const celix_properties_t *props)
Definition: celix_dm_service_dependency.h:42
celix_dm_service_dependency_callback_options
Definition: celix_dm_service_dependency.h:45
celix_dmServiceDependency_destroy
CELIX_FRAMEWORK_EXPORT void celix_dmServiceDependency_destroy(celix_dm_service_dependency_t *dep)
celix_dmServiceDependency_create
CELIX_FRAMEWORK_EXPORT celix_dm_service_dependency_t * celix_dmServiceDependency_create(void)
celix_dmServiceDependency_setCallbackWithProperties
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbackWithProperties(celix_dm_service_dependency_t *dependency, celix_dm_service_update_with_props_fp set)
DM_SERVICE_DEPENDENCY_STRATEGY_SUSPEND
@ DM_SERVICE_DEPENDENCY_STRATEGY_SUSPEND
Definition: celix_dm_service_dependency.h:36
celix_dm_service_swap_fp
int(* celix_dm_service_swap_fp)(void *handle, void *oldService, void *newService)
Definition: celix_dm_service_dependency.h:40
celix_dmServiceDependency_setCallbacksWithOptions
CELIX_FRAMEWORK_EXPORT celix_status_t celix_dmServiceDependency_setCallbacksWithOptions(celix_dm_service_dependency_t *dependency, const celix_dm_service_dependency_callback_options_t *opts)
celix_dm_service_dependency_strategy_t
enum celix_dm_service_dependency_strategy_enum celix_dm_service_dependency_strategy_t
celix_dmServiceDependency_createInfo
CELIX_FRAMEWORK_EXPORT dm_service_dependency_info_t * celix_dmServiceDependency_createInfo(celix_dm_service_dependency_t *dep)
celix_dmServiceDependency_getFilter
const CELIX_FRAMEWORK_EXPORT char * celix_dmServiceDependency_getFilter(celix_dm_service_dependency_t *dependency)