Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_adaptor_impl.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Helpers for afw_adaptor implementation development
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_ADAPTOR_IMPL_H__
10 #define __AFW_ADAPTOR_IMPL_H__
11 
12 #include "afw_interface.h"
13 
29 
43 #define AFW_ADAPTOR_IMPL_LOCK_READ_BEGIN(adaptor) \
44 AFW_LOCK_READ_BEGIN((adaptor)->impl->adaptor_lock_rw)
45 
46 
52 #define AFW_ADAPTOR_IMPL_LOCK_READ_END \
53 AFW_LOCK_READ_END
54 
55 
69 #define AFW_ADAPTOR_IMPL_LOCK_WRITE_BEGIN(adaptor) \
70 AFW_LOCK_WRITE_BEGIN((adaptor)->impl->adaptor_lock_rw)
71 
72 
78 #define AFW_ADAPTOR_IMPL_LOCK_WRITE_END \
79 AFW_LOCK_WRITE_END
80 
81 
84  const afw_utf8_t *object_type_id;
85  const afw_object_t *object;
86  afw_boolean_t allow_entity;
87  afw_boolean_t allow_write;
89 
90 
100 
103 
106 
109 
112 
115 
118 
126 
136 
141 
146 
151 
158 
161 
166 
171 
176 
181 
186 
191 
196 
200  apr_hash_t *object_types_ht;
201 
208 
215 };
216 
217 
220 
223 
226 
229 
232 };
233 
234 
237 
239  const afw_pool_t *p;
240 
243 
246 
249 
252 };
253 
254 
294  const afw_adaptor_inf_t *inf,
295  afw_size_t instance_size,
296  const afw_object_t *properties,
297  const afw_pool_t *p,
298  afw_xctx_t *xctx);
299 
300 
314 AFW_DECLARE(void)
316  afw_adaptor_object_type_cache_t *object_type_cache,
318  const afw_adaptor_session_t *session,
319  afw_boolean_t all_object_types_immutable,
320  afw_xctx_t *xctx);
321 
322 
323 
335 
336 
337 
345 AFW_DECLARE(void)
347  const afw_adaptor_t *adaptor,
348  afw_xctx_t *xctx);
349 
350 
362 AFW_DECLARE(const afw_object_t *)
364  const afw_adaptor_t *adaptor,
365  const afw_utf8_t *object_type_id,
366  const afw_pool_t *p,
367  afw_xctx_t *xctx);
368 
369 
370 
379 AFW_DECLARE(void)
381  const afw_adaptor_t *adaptor,
382  afw_xctx_t *xctx);
383 
384 
385 
392 AFW_DECLARE(void)
394  const afw_adaptor_t *adaptor,
395  const afw_utf8_t *property_name,
396  afw_xctx_t *xctx);
397 
398 
406 AFW_DECLARE(void)
408  const afw_adaptor_t *adaptor,
409  const afw_utf8_t *property_name,
410  afw_xctx_t *xctx);
411 
412 
421 AFW_DECLARE(void)
423  const afw_list_t *list,
424  void * context,
425  afw_object_cb_t callback,
426  afw_xctx_t *xctx);
427 
428 
443  const afw_adaptor_journal_t *instance,
444  const afw_object_t * entry,
445  const afw_object_t * consumer,
446  const afw_value_t * const * filter,
447  afw_xctx_t *xctx);
448 
449 #define AFW_ADAPTOR_IMPL_ERROR_ADAPTOR_IMMUTABLE \
450 AFW_THROW_ERROR_Z(read_only, "Adaptor is read-only.", xctx)
451 
452 
473 AFW_DECLARE(void)
475  const afw_adaptor_t *adaptor,
476  const afw_utf8_t *object_type_id,
477  afw_boolean_t allow_entity,
478  afw_boolean_t allow_write,
479  afw_xctx_t *xctx);
480 
481 
482 AFW_END_DECLARES
483 
486 #endif /* __AFW_ADAPTOR_IMPL_H__ */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
AFW_DECLARE_CONST_DATA(afw_utf8_t) afw_s_200
afw_utf8_t for string 200
void afw_adaptor_impl_throw_property_invalid(const afw_adaptor_t *adaptor, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Developers should call this for configuration property errors.
void afw_adaptor_impl_throw_property_required(const afw_adaptor_t *adaptor, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Developers should call this for missing required configuration property.
const afw_object_t * afw_adaptor_impl_generic_object_type_object_get(const afw_adaptor_t *adaptor, const afw_utf8_t *object_type_id, const afw_pool_t *p, afw_xctx_t *xctx)
Create a generic object type object.
void afw_adaptor_impl_push_qualifiers(const afw_adaptor_t *adaptor, afw_xctx_t *xctx)
Push adaptor qualifiers to xctx.
void afw_adaptor_impl_call_object_cb_from_list(const afw_list_t *list, void *context, afw_object_cb_t callback, afw_xctx_t *xctx)
Call object cb from list.
void afw_adaptor_impl_object_type_cache_initialize(afw_adaptor_object_type_cache_t *object_type_cache, const afw_adaptor_object_type_cache_inf_t *inf, const afw_adaptor_session_t *session, afw_boolean_t all_object_types_immutable, afw_xctx_t *xctx)
Initialize object type cache instance.
afw_adaptor_t * afw_adaptor_impl_create_cede_p(const afw_adaptor_inf_t *inf, afw_size_t instance_size, const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Developers should call this in all create functions for afw_adaptor.
afw_adaptor_impl_object_type_cache_inf
inf for an implementation of afw_adaptor_object_type_cache.
struct afw_adaptor_impl_core_object_type_s afw_adaptor_impl_core_object_type_t
afw_adaptor_impl_t supported_core_object_types entry.
void afw_adaptor_impl_set_object_types_fully_loaded(const afw_adaptor_t *adaptor, afw_xctx_t *xctx)
Set object types fully loaded.
void afw_adaptor_impl_set_supported_core_object_type(const afw_adaptor_t *adaptor, const afw_utf8_t *object_type_id, afw_boolean_t allow_entity, afw_boolean_t allow_write, afw_xctx_t *xctx)
Indicates support of a core object type.
afw_boolean_t afw_adaptor_impl_is_journal_entry_applicable(const afw_adaptor_journal_t *instance, const afw_object_t *entry, const afw_object_t *consumer, const afw_value_t *const *filter, afw_xctx_t *xctx)
Determine whether a journal entry is applicable to a consumer.
afw_boolean_t(* afw_object_cb_t)(const afw_object_t *object, void *context, afw_xctx_t *xctx)
Typedef for afw_adaptor_session_object callback.
Definition: afw_common.h:1176
struct afw_authorization_policy_location_s afw_authorization_policy_location_t
_Bool afw_boolean_t
Definition: afw_common.h:373
apr_size_t afw_size_t
size_t.
Definition: afw_common.h:151
apr_int64_t afw_integer_t
typedef for big signed int.
Definition: afw_common.h:321
afw_adaptor_impl_t supported_core_object_types entry.
Internal request info used by afw_adaptor_impl*() functions.
const afw_utf8_t * resource_id
resource id
const afw_object_t * journal_entry
Journal entry.
const afw_object_t * request
Request object.
const afw_pool_t * p
Pool used.
const afw_object_options_t * options
Object options.
Internal struct used by common adaptor code for all adaptors.
apr_hash_t * object_types_ht
If not NULL, object types that last for the life of the adaptor.
AFW_ATOMIC afw_integer_t modify_object_count
modify_object() count.
const afw_utf8_t * authorization_handler_id
Authorization handler id.
const afw_object_t * metrics_object
Metrics object.
const afw_model_location_t * model_location
Model location struct if this adaptor is a model location.
AFW_ATOMIC afw_integer_t add_object_count
add_object() count.
AFW_ATOMIC afw_integer_t get_object_count
get_object() count.
apr_hash_t * supported_core_object_types
See afw_adaptor_impl_core_object_type_t.
AFW_ATOMIC afw_integer_t update_object_count
update_object() count.
const afw_lock_rw_t * adaptor_lock_rw
Read/write lock used for changing adaptor related structs.
AFW_ATOMIC afw_integer_t delete_object_count
delete_object() count.
const afw_utf8_t * source_location
Source location associated with this adaptor.
const afw_authorization_policy_location_t * policy_location
Model location struct if this adaptor is a model location.
const afw_object_t * custom_variables
Custom variables.
afw_boolean_t object_types_fully_loaded
Object types fully loaded.
const afw_value_t * authorization
Adaptor level authorization.
const afw_adaptor_inf_t * wrapped_inf
Wrapped inf.
AFW_ATOMIC afw_integer_t replace_object_count
replace_object() count.
AFW_ATOMIC afw_integer_t retrieve_objects_count
retrieve_objects() count.
afw_boolean_t all_object_types_immutable
Object types last for lifetime of adaptor.
const afw_adaptor_t * adaptor
Associated adaptor instance.
const afw_utf8_t * adaptor_id
Pointer to adaptor id.
const afw_utf8_t * journal_adaptor_id
Journal adaptor id (FIXME Going away)
Internal session info used by afw_adaptor_impl*() functions.
const afw_adaptor_session_t * wrapped_session
Session this common impl wraps.
const afw_adaptor_journal_t * wrapped_journal
Journal this common impl wraps.
afw_adaptor_session_t pub
Public part of session.
afw_adaptor_journal_t journal_pub
Public part of journal.
Interface afw_adaptor_inf_s struct.
Interface afw_adaptor_journal public struct.
Interface afw_adaptor_object_type_cache_inf_s struct.
Interface afw_adaptor_object_type_cache public struct.
Interface afw_adaptor public struct.
Interface afw_adaptor_session public struct.
Interface afw_list public struct.
Struct used by adaptor referenced by modelLocationAdaptorId.
Struct for object processing options.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.