RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 web site: http://sourceforge.net/projects/rkh-reactivesys/
28  * e-mail: francuccilea@gmail.com
29  * ---------------------------------------------------------------------------
30  */
31 
43 /* -------------------------- Development history -------------------------- */
44 /*
45  * 2017.05.04 LeFr v2.4.05 Initial version
46  */
47 
48 /* -------------------------------- Authors -------------------------------- */
49 /*
50  * LeFr Leandro Francucci francuccilea@gmail.com
51  */
52 
53 /* --------------------------------- Notes --------------------------------- */
54 /* --------------------------------- Module -------------------------------- */
55 #ifndef __RKHFWK_EVTPOOL_H__
56 #define __RKHFWK_EVTPOOL_H__
57 
58 /* ----------------------------- Include files ----------------------------- */
59 #include "rkhitl.h"
60 
61 /* ---------------------- External C language linkage ---------------------- */
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /* --------------------------------- Macros -------------------------------- */
67 /* -------------------------------- Constants ------------------------------ */
68 /* ------------------------------- Data types ------------------------------ */
69 typedef struct RKHEvtPool RKHEvtPool;
70 
71 /* -------------------------- External variables --------------------------- */
72 /* -------------------------- Function prototypes -------------------------- */
83 void rkh_evtPool_init();
84 
105 RKHEvtPool *rkh_evtPool_getPool(void *stoStart, rui16_t stoSize,
106  RKH_ES_T evtSize);
107 
121 rui8_t rkh_evtPool_getBlockSize(RKHEvtPool *const me);
122 
137 RKH_EVT_T *rkh_evtPool_get(RKHEvtPool *const me);
138 
154 void rkh_evtPool_put(RKHEvtPool *const me, RKH_EVT_T *evt);
155 
170 rui8_t rkh_evtPool_getNumUsed(RKHEvtPool *const me);
171 
188 rui8_t rkh_evtPool_getNumMin(RKHEvtPool *const me);
189 
204 rui8_t rkh_evtPool_getNumBlock(RKHEvtPool *const me);
205 
206 /* -------------------- External C language linkage end -------------------- */
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 /* ------------------------------ Module end ------------------------------- */
212 #endif
213 
214 /* ------------------------------ End of file ------------------------------ */
rui8_t rkh_evtPool_getBlockSize(RKHEvtPool *const me)
Encapsulates how RKH should obtain the block size of an event pool.
Represents events without parameters.
Definition: rkhevt.h:167
RKH engine interface.This header file is directly included in RKH interface file, rkh...
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_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_getNumMin(RKHEvtPool *const me)
Encapsulates how RKH should return the lowest number of free blocks ever present 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...
rui8_t RKH_ES_T
Definition: rkhevt.h:114
void rkh_evtPool_init()
Encapsulates the initialization of event pool manager.
rui8_t rkh_evtPool_getNumBlock(RKHEvtPool *const me)
Encapsulates how RKH should return the total number of blocks in the pool me.