design_pattern_for_c  V 1.00
chain_of_responsibility.h
Go to the documentation of this file.
1 
5 #ifndef CHAIN_OF_RESPONSIBILITY_H_
6 #define CHAIN_OF_RESPONSIBILITY_H_
7 
11 typedef enum {
14 } cor_result_e;
15 
19 struct chain_element_part;
22 
31 typedef cor_result_e (*chain_func)(void *arg, void *ctx);
32 
39 void cor_set_threadsafe(int is_threadsafe);
40 
50 ChainElementPart cor_add_function(const int id, chain_func func, void *ctx);
51 
59 void cor_call(const int id, void *arg);
60 
70 void cor_remove_function(const int id, chain_func func);
71 
81 void cor_remove_chain_element_part(const int id, ChainElementPart element);
82 
88 void cor_clear(void);
89 #endif
void cor_set_threadsafe(int is_threadsafe)
set thredsafe
void cor_remove_function(const int id, chain_func func)
remove to chain api
void cor_clear(void)
clear all list
cor_result_e(* chain_func)(void *arg, void *ctx)
chain func
void cor_remove_chain_element_part(const int id, ChainElementPart element)
remove to chain api
ChainElementPart cor_add_function(const int id, chain_func func, void *ctx)
add to chain api
exit to call chain_api
chain function element part class instance definition
void cor_call(const int id, void *arg)
call chain api
cor_result_e
chain_api result type
struct chain_element_part * ChainElementPart
ChainElementPart class definition.