Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_service.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Service Support
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_SERVICE_H__
10 #define __AFW_SERVICE_H__
11 
13 #include "afw_interface.h"
14 
30 
35  afw_service_t *service,
36  void *data,
37  const afw_object_t *properties,
38  const afw_pool_t *p,
39  afw_xctx_t *xctx);
40 
46 struct afw_service_s {
47 
49  const afw_pool_t *p;
50 
60 
66  const afw_utf8_t *type;
67 
70 
73 
76 
79 
82 
85 
88 
91 
98 
105 
108 
110  void *data;
111 
114 };
115 
116 
124 AFW_DECLARE(void)
126  const afw_service_t *service,
127  const afw_pool_t *p,
128  afw_xctx_t *xctx);
129 
130 
136 AFW_DECLARE(const afw_utf8_t *)
138 
139 
145 AFW_DECLARE(const afw_value_t *)
147 
148 
154 AFW_DECLARE(const afw_utf8_t *)
156 
157 
163 AFW_DECLARE(const afw_value_t *)
165 
166 
174 
175 
181 AFW_DECLARE(const afw_utf8_t *)
183 
184 
190 AFW_DECLARE(const afw_value_t *)
192 
193 
199 AFW_DECLARE(const afw_utf8_t *)
201 
202 
208 AFW_DECLARE(const afw_value_t *)
210 
211 
219 
220 
222 AFW_DECLARE(const afw_object_t *)
224  const afw_utf8_t *service_id,
225  const afw_pool_t *p,
226  afw_xctx_t *xctx);
227 
228 
239 AFW_DECLARE(void)
241  const afw_object_t *properties,
242  const afw_utf8_t *source_location,
243  const afw_pool_t *p, afw_xctx_t *xctx);
244 
245 
256 AFW_DECLARE(void)
258  const afw_utf8_t *service_id,
259  afw_boolean_t manual_start,
260  afw_xctx_t *xctx);
261 
262 
263 
269 AFW_DECLARE(void)
271  const afw_utf8_t *service_id,
272  afw_xctx_t *xctx);
273 
274 
275 
281 AFW_DECLARE(void)
283  const afw_utf8_t *service_id,
284  afw_xctx_t *xctx);
285 
286 
287 
288 AFW_END_DECLARES
289 
292 #endif /* __AFW_SERVICE_H__ */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
_Bool afw_boolean_t
Definition: afw_common.h:373
enum afw_service_status_e afw_service_status_t
Typedef for service status enum.
enum afw_service_startup_e afw_service_startup_t
Typedef for service startup type enum.
struct afw_thread_mutex_s afw_thread_mutex_t
const afw_utf8_t * afw_service_startup_description(afw_service_startup_t startup)
Get description for a afw_service_startup_t enum.
Definition: afw_service.c:165
void afw_service_restart(const afw_utf8_t *service_id, afw_xctx_t *xctx)
Restart a service.
Definition: afw_service.c:1465
const afw_value_t * afw_service_startup_as_value(afw_service_startup_t startup)
Convert afw_service_startup_t enum to corresponding adaptive value.
Definition: afw_service.c:150
void(* afw_service_create_cede_p_t)(afw_service_t *service, void *data, const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Function passed to afw_service_start_cede_p.
Definition: afw_service.h:34
void afw_service_start_using_AdaptiveConf_cede_p(const afw_object_t *properties, const afw_utf8_t *source_location, const afw_pool_t *p, afw_xctx_t *xctx)
Start a service using AdaptiveConf object and cede p.
Definition: afw_service.c:1147
void afw_service_stop(const afw_utf8_t *service_id, afw_xctx_t *xctx)
Stop a service.
Definition: afw_service.c:1266
const afw_object_t * afw_service_get_object(const afw_utf8_t *service_id, const afw_pool_t *p, afw_xctx_t *xctx)
Get a service object.
Definition: afw_service.c:1058
const afw_utf8_t * afw_service_status_description(afw_service_status_t status)
Get description for a afw_service_status_t enum.
Definition: afw_service.c:240
afw_service_status_t afw_service_status_as_enum(const afw_utf8_t *s)
Convert utf8 to corresponding afw_service_status_t enum.
Definition: afw_service.c:270
void afw_service_context_prepare(const afw_service_t *service, const afw_pool_t *p, afw_xctx_t *xctx)
Prepare expression evaluation context for service::.
const afw_utf8_t * afw_service_status_as_utf8(afw_service_status_t status)
Convert afw_service_status_t enum to corresponding utf8.
Definition: afw_service.c:210
const afw_value_t * afw_service_status_description_as_value(afw_service_status_t status)
Get description as value for a afw_service_status_t enum.
Definition: afw_service.c:255
const afw_value_t * afw_service_startup_description_as_value(afw_service_startup_t startup)
Get description as value for a afw_service_startup_t enum.
Definition: afw_service.c:180
const afw_value_t * afw_service_status_as_value(afw_service_status_t status)
Convert afw_service_status_t enum to corresponding adaptive value.
Definition: afw_service.c:225
const afw_utf8_t * afw_service_startup_as_utf8(afw_service_startup_t startup)
Convert afw_service_startup_t enum to corresponding utf8.
Definition: afw_service.c:135
void afw_service_start(const afw_utf8_t *service_id, afw_boolean_t manual_start, afw_xctx_t *xctx)
Start a service.
Definition: afw_service.c:1201
afw_service_startup_t afw_service_startup_as_enum(const afw_utf8_t *s)
Convert utf8 to corresponding afw_service_startup_t enum.
Definition: afw_service.c:195
date, time, and time zone.
Definition: afw_common.h:1760
Interface afw_object public struct.
Interface afw_pool public struct.
Runtime service struct.
Definition: afw_service.h:46
const afw_utf8_t * status_message
Optional status message.
Definition: afw_service.h:97
afw_utf8_t service_id
Service's name.
Definition: afw_service.h:59
const afw_utf8_t * conf_source_location
The source location associated with the conf for this service.
Definition: afw_service.h:84
afw_thread_mutex_t * mutex
Mutex used when changing status.
Definition: afw_service.h:107
afw_dateTime_t start_time
Start time.
Definition: afw_service.h:90
afw_boolean_t has_service_conf
Has a service conf object.
Definition: afw_service.h:113
const afw_pool_t * p
Pool that holds service's resources.
Definition: afw_service.h:49
const afw_utf8_t * source_location
The source location associated with this service.
Definition: afw_service.h:78
const afw_service_type_t * service_type
afw_service_type instance for this service_type_id.
Definition: afw_service.h:69
const afw_utf8_t * conf_subtype
This is the value of the subtype property from conf or NULL.
Definition: afw_service.h:75
const afw_utf8_t * status_debug
Optional status debug.
Definition: afw_service.h:104
const afw_utf8_t * type
The part before the dash ('-') in service_id.
Definition: afw_service.h:66
const afw_utf8_t * conf_id
The part after the dash ('-') in the service id.
Definition: afw_service.h:72
const afw_object_t * properties
The properties object containing runtime and conf properties.
Definition: afw_service.h:81
afw_service_status_t status
The status of the service.
Definition: afw_service.h:87
Interface afw_service_type public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.