µEvLoop
A fast and lightweight event loop aimed at embedded platforms in C99.
functional.h
Go to the documentation of this file.
1 
6 #ifndef UEL_FUNCTIONAL_H
7 #define UEL_FUNCTIONAL_H
8 
10 #include <stdlib.h>
12 
13 #include "uevloop/utils/closure.h"
14 #include "uevloop/utils/pipeline.h"
16 #include "uevloop/utils/iterator.h"
17 
21 typedef struct uel_func_mapper uel_func_mapper_t;
24  uel_iterator_t *iterator;
26  void **destination;
28  size_t limit;
29 };
30 
38 void uel_func_mapper_init(uel_func_mapper_t *mapper, uel_iterator_t *iterator,
39  void **destination, size_t limit);
40 
50 uel_closure_t uel_func_pipeline(uel_pipeline_t *pipeline);
51 
61 uel_closure_t uel_func_conditional(uel_conditional_t *conditional);
62 
73 uel_closure_t uel_func_foreach(uel_closure_t *closure);
74 
89 uel_closure_t uel_func_map(uel_closure_t *closure);
90 
104 uel_closure_t uel_func_find(uel_closure_t *closure);
105 
118 uel_closure_t uel_func_count(uel_closure_t *closure);
119 
132 uel_closure_t uel_func_all(uel_closure_t *closure);
133 
146 uel_closure_t uel_func_none(uel_closure_t *closure);
147 
160 uel_closure_t uel_func_any(uel_closure_t *closure);
161 
162 #endif /* end of include guard: UEL_FUNCTIONAL_H */
uel_func_find
uel_closure_t uel_func_find(uel_closure_t *closure)
Wraps a closure in a find construct.
pipeline.h
Defines pipelines, structures to hold many closures and functions to invoke them sequentially,...
uel_func_mapper
Maps elements of an iterator to an area of memory. Each element is assigned to a void pointer slot.
Definition: functional.h:22
uel_func_none
uel_closure_t uel_func_none(uel_closure_t *closure)
Wraps a closure in a none construct.
closure.h
Defines closures, objects that bind functions to creating and calling contexts.
uel_func_count
uel_closure_t uel_func_count(uel_closure_t *closure)
Wraps a closure in a count construct.
uel_func_foreach
uel_closure_t uel_func_foreach(uel_closure_t *closure)
Wraps a closure in a foreach construct.
uel_func_pipeline
uel_closure_t uel_func_pipeline(uel_pipeline_t *pipeline)
Wraps a pipeline in a closure.
uel_func_mapper::iterator
uel_iterator_t * iterator
The iterator that enumerates the elements to be mapped.
Definition: functional.h:24
iterator.h
Defines iterators, structures and functions suitable for enumerating other data structures.
uel_func_any
uel_closure_t uel_func_any(uel_closure_t *closure)
Wraps a closure in a all construct.
uel_func_conditional
uel_closure_t uel_func_conditional(uel_conditional_t *conditional)
Wraps a conditional in a closure.
uel_func_map
uel_closure_t uel_func_map(uel_closure_t *closure)
Wraps a closure in a map construct.
uel_func_all
uel_closure_t uel_func_all(uel_closure_t *closure)
Wraps a closure in a all construct.
uel_func_mapper::destination
void ** destination
The area of memory to where elements will be mapped.
Definition: functional.h:26
uel_func_mapper::limit
size_t limit
The maximum size of slots to be mapped to.
Definition: functional.h:28
uel_func_mapper_init
void uel_func_mapper_init(uel_func_mapper_t *mapper, uel_iterator_t *iterator, void **destination, size_t limit)
Initialises a mapper object.
conditional.h
Contains definitions of functional conditionals, structures that act as if-else constructs.