RKH
rkhfwk_evtpool.h
Go to the documentation of this file.
1 /*
2  * --------------------------------------------------------------------------
3  *
4  * Framework RKH
5  * -------------
6  *
7  * State-machine framework for reactive embedded systems
8  *
9  * Copyright (C) 2010 Leandro Francucci.
10  * All rights reserved. Protected by international copyright laws.
11  *
12  *
13  * RKH is free software: you can redistribute it and/or modify it under the
14  * terms of the GNU General Public License as published by the Free Software
15  * Foundation, either version 3 of the License, or (at your option) any
16  * later version.
17  *
18  * RKH is distributed in the hope that it will be useful, but WITHOUT ANY
19  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21  * more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with RKH, see copying.txt file.
25  *
26  * Contact information:
27  * RKH site: http://vortexmakes.com/que-es/
28  * RKH GitHub: https://github.com/vortexmakes/RKH
29  * RKH Sourceforge: https://sourceforge.net/projects/rkh-reactivesys/
30  * e-mail: lf@vortexmakes.com
31  * ---------------------------------------------------------------------------
32  */
33 
45 /* -------------------------- Development history -------------------------- */
46 /*
47  * 2017.05.04 LeFr v2.4.05 Initial version
48  */
49 
50 /* -------------------------------- Authors -------------------------------- */
51 /*
52  * LeFr Leandro Francucci lf@vortexmakes.com
53  */
54 
55 /* --------------------------------- Notes --------------------------------- */
56 /* --------------------------------- Module -------------------------------- */
57 #ifndef __RKHFWK_EVTPOOL_H__
58 #define __RKHFWK_EVTPOOL_H__
59 
60 /* ----------------------------- Include files ----------------------------- */
61 #include "rkhitl.h"
62 
63 /* ---------------------- External C language linkage ---------------------- */
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /* --------------------------------- Macros -------------------------------- */
69 /* -------------------------------- Constants ------------------------------ */
70 /* ------------------------------- Data types ------------------------------ */
71 typedef struct RKHEvtPool RKHEvtPool;
72 
73 /* -------------------------- External variables --------------------------- */
74 /* -------------------------- Function prototypes -------------------------- */
86 
107 RKHEvtPool *rkh_evtPool_getPool(void *stoStart, rui16_t stoSize,
108  RKH_ES_T evtSize);
109 
123 rui8_t rkh_evtPool_getBlockSize(RKHEvtPool *const me);
124 
139 RKH_EVT_T *rkh_evtPool_get(RKHEvtPool *const me);
140 
156 void rkh_evtPool_put(RKHEvtPool *const me, RKH_EVT_T *evt);
157 
172 rui8_t rkh_evtPool_getNumUsed(RKHEvtPool *const me);
173 
190 rui8_t rkh_evtPool_getNumMin(RKHEvtPool *const me);
191 
206 rui8_t rkh_evtPool_getNumBlock(RKHEvtPool *const me);
207 
208 /* -------------------- External C language linkage end -------------------- */
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 /* ------------------------------ Module end ------------------------------- */
214 #endif
215 
216 /* ------------------------------ End of file ------------------------------ */
rui8_t RKH_ES_T
Definition: rkhevt.h:116
void rkh_evtPool_init()
Encapsulates the initialization of event pool manager.
rui8_t rkh_evtPool_getBlockSize(RKHEvtPool *const me)
Encapsulates how RKH should obtain the block size of an event pool.
rui8_t rkh_evtPool_getNumMin(RKHEvtPool *const me)
Encapsulates how RKH should return the lowest number of free blocks ever present in the pool me....
RKH_EVT_T * rkh_evtPool_get(RKHEvtPool *const me)
Encapsulates how RKH should obtain an event evt from the event pool me.
rui8_t rkh_evtPool_getNumBlock(RKHEvtPool *const me)
Encapsulates how RKH should return the total number of blocks in the pool me.
rui8_t rkh_evtPool_getNumUsed(RKHEvtPool *const me)
Encapsulates how RKH should return the current number of memory blocks used in the pool me.
RKHEvtPool * rkh_evtPool_getPool(void *stoStart, rui16_t stoSize, RKH_ES_T evtSize)
Encapsulates the creation of an event pool.
void rkh_evtPool_put(RKHEvtPool *const me, RKH_EVT_T *evt)
Encapsulates how RKH should return an event evt to the event pool me.
RKH engine interface.This header file is directly included in RKH interface file, rkh....
Represents events without parameters.
Definition: rkhevt.h:170