april  1.0.0
...
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
april.h
Go to the documentation of this file.
1 /* ========================================================================= */
2 /* ------------------------------------------------------------------------- *//*
11 
12 
13  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14  Please read COPYING and README files in root folder
15  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 */
17 /* ------------------------------------------------------------------------- */
18 /* ========================================================================= */
19 #ifndef __APRIL_MAIN_HEADER_INC__
20 #define __APRIL_MAIN_HEADER_INC__
21 //
22 //
23 //
24 //
25 /* INCLUDES ------------------------------------------------------------ */
26 
27 #include <april/april_config.h>
28 #include <april/april_global.h>
29 #include <april/april_debug.h>
30 #include <april/april_version.h>
31 #include <libbbb/1/memtrack.h>
32 #include <libbbb/1/refcnt.h>
33 
34 /* INCLUDES ============================================================ */
35 //
36 //
37 //
38 //
39 /* DEFINITIONS --------------------------------------------------------- */
40 
41 /*
42 
43 Object emit signals on certain actions if APRIL_SIGNALS is defined.
44 
45 #define LIBDIGIB_SIGNALS 1
46 #undef LIBDIGIB_SIGNALS
47 */
48 
50 #define RAND_0_1 ( ((qreal)qrand()) / RAND_MAX )
51 
53 #define RAND_ARROUND_1 ( RAND_0_1 + 0.5 )
54 
56 #define RAND_ARROUND_0 ( RAND_0_1 - 0.5 )
57 
59 #define SMALL_RANDOM ( RAND_ARROUND_0 / 100000 )
60 
62 #define RANDINT_0_MAX(m) ( qrand() % (m) )
63 
64 
67 
68 #define firstSensor_(p) static_cast<Sensor*>(p->sensors_.first())
69 #define prevSensor_(p) static_cast<Sensor*>(p->prev())
70 #define nextSensor_(p) static_cast<Sensor*>(p->next())
71 
72 #define firstActor_(p) static_cast<Actor*>(p->actors_.first())
73 #define prevActor_(p) static_cast<Actor*>(p->prev())
74 #define nextActor_(p) static_cast<Actor*>(p->next())
75 
76 #define firstActuator_(p) static_cast<Actuator*>(p->actuators_.first())
77 #define prevActuator_(p) static_cast<Actuator*>(p->prev())
78 #define nextActuator_(p) static_cast<Actuator*>(p->next())
79 
80 #define firstReflex_(p) static_cast<Reflex*>(p->reflexes_.first())
81 #define prevReflex_(p) static_cast<Reflex*>(p->prev())
82 #define nextReflex_(p) static_cast<Reflex*>(p->next())
83 
84 #define firstBrain_(p) static_cast<Brain*>(p->brains_.first())
85 #define prevBrain_(p) static_cast<Brain*>(p->prev())
86 #define nextBrain_(p) static_cast<Brain*>(p->next())
87 
88 #define firstEvent_(p) static_cast<EventSource*>(p->events_.first())
89 #define prevEvent_(p) static_cast<EventSource*>(p->prev())
90 #define nextEvent_(p) static_cast<EventSource*>(p->next())
91 
92 #define firstWorld_(p) static_cast<World*>(p->worlds_.first())
93 #define prevWorld_(p) static_cast<World*>(p->prev())
94 #define nextWorld_(p) static_cast<World*>(p->next())
95 
96 #define firstEventData_(p) static_cast<EventData*>(p->event_data_.first())
97 #define prevEventData_(p) static_cast<EventData*>(p->prev())
98 #define nextEventData_(p) static_cast<EventData*>(p->next())
99 
100 #define firstPlugin_(p) static_cast<AprilPluginLoader*>(p->plugins_.first())
101 #define prevPlugin_(p) static_cast<AprilPluginLoader*>(p->prev())
102 #define nextPlugin_(p) static_cast<AprilPluginLoader*>(p->next())
103 
105 
106 
107 #ifndef stringify
108 
110 #define xstringify(s) #s
111 
112 #define stringify(s) xstringify(s)
113 
114 #endif
115 
116 
117 
118 /* DEFINITIONS ========================================================= */
119 //
120 //
121 //
122 //
123 /* DATA ---------------------------------------------------------------- */
124 
125 /* DATA ================================================================ */
126 //
127 //
128 //
129 //
130 /* FUNCTIONS ----------------------------------------------------------- */
131 
132 /* FUNCTIONS =========================================================== */
133 //
134 //
135 //
136 //
137 #endif // __APRIL_MAIN_HEADER_INC__
138 /* ------------------------------------------------------------------------- */
139 /* ========================================================================= */