Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_list_impl.c
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework List Implementation Helpers
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 /*
19  * Implementation of method get_entry_meta for interface afw_list.
20  */
23  const afw_list_t *instance,
24  afw_integer_t index,
25  const afw_pool_t *p,
26  afw_xctx_t *xctx)
27 {
28  const afw_value_t *entry_value;
29  const afw_value_t *result;
31 
32  /*FIXME Meta should include list meta. */
33 
34  result = NULL;
35  entry_value = afw_list_get_entry_value(instance, index, p, xctx);
36  if (entry_value) {
37  meta_self = afw_value_internal_create_meta_object_self(
38  entry_value, p, xctx);
39  result = (const afw_value_t *)& meta_self->meta_object_value;
40  }
41 
42  return result;
43 }
44 
45 
46 
47 /*
48  * Implementation of method get_next_entry_meta for interface afw_list.
49  */
52  const afw_list_t *instance,
53  const afw_iterator_t **iterator,
54  const afw_pool_t *p,
55  afw_xctx_t *xctx)
56 {
57  const afw_value_t *entry_value;
58  const afw_value_t *result;
60 
61  result = NULL;
62  entry_value = afw_list_get_next_value(instance,
63  iterator, p, xctx);
64 
65  if (entry_value) {
66  meta_self = afw_value_internal_create_meta_object_self(
67  entry_value, p, xctx);
68  result = (const afw_value_t *)& meta_self->meta_object_value;
69  }
70 
71  return result;
72 }
73 
74 
75 /*
76  * A general impl of method get_entry_meta for interface afw_list
77  * that can be accessed externally.
78  */
79 AFW_DECLARE(const afw_value_t *)
81  const afw_list_t *instance,
82  afw_integer_t index,
83  const afw_pool_t *p,
84  afw_xctx_t *xctx)
85 {
87  instance, index, p, xctx);
88 }
89 
90 
91 
92 /*
93  * A general impl of method get_next_entry_meta for interface
94  * afw_list that can be accessed externally.
95  */
96 AFW_DECLARE(const afw_value_t *)
98  const afw_list_t *instance,
99  const afw_iterator_t **iterator,
100  const afw_pool_t *p,
101  afw_xctx_t *xctx)
102 {
104  instance, iterator, p, xctx);
105 }
#define AFW_DEFINE_INTERNAL(type)
Define an internal function for /src/afw/ source*.c files.
#define AFW_DECLARE(type)
Declare a public afw function.
Adaptive Framework Core Internal.
struct afw_iterator_s afw_iterator_t
apr_int64_t afw_integer_t
typedef for big signed int.
Definition: afw_common.h:321
afw_list_impl_get_next_entry_meta(const afw_list_t *instance, const afw_iterator_t **iterator, const afw_pool_t *p, afw_xctx_t *xctx)
A general impl of method get_next_entry_meta for interface afw_list.
Definition: afw_list_impl.c:51
const afw_value_t * afw_list_external_impl_get_entry_meta(const afw_list_t *instance, afw_integer_t index, const afw_pool_t *p, afw_xctx_t *xctx)
A general impl of method get_entry_meta for interface afw_list that can be accessed externally.
Definition: afw_list_impl.c:80
afw_list_impl_get_entry_meta(const afw_list_t *instance, afw_integer_t index, const afw_pool_t *p, afw_xctx_t *xctx)
A general impl of method get_entry_meta for interface afw_list.
Definition: afw_list_impl.c:22
const afw_value_t * afw_list_external_impl_get_next_entry_meta(const afw_list_t *instance, const afw_iterator_t **iterator, const afw_pool_t *p, afw_xctx_t *xctx)
A general impl of method get_next_entry_meta for interface afw_list that can be accessed externally.
Definition: afw_list_impl.c:97
#define afw_list_get_entry_value(instance, index, p, xctx)
Call method get_entry_value of interface afw_list.
#define afw_list_get_next_value(instance, iterator, p, xctx)
Call method get_next_value of interface afw_list.
Interface afw_list public struct.
Interface afw_pool public struct.
Interface afw_value public struct.
Interface afw_xctx public struct.