libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
moEventList.h
Go to the documentation of this file.
1
/*******************************************************************************
2
3
moEventList.h
4
5
****************************************************************************
6
* *
7
* This source is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This code is distributed in the hope that it will be useful, but *
13
* WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15
* General Public License for more details. *
16
* *
17
* A copy of the GNU General Public License is available on the World *
18
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19
* obtain it by writing to the Free Software Foundation, *
20
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
* *
22
****************************************************************************
23
24
Copyright(C) 2006 Fabricio Costa
25
26
Authors:
27
Fabricio Costa
28
29
*******************************************************************************/
30
31
#include "
moValue.h
"
32
#include "
moLock.h
"
33
34
#ifndef __MOEVENTO_H
35
#define __MOEVENTO_H
36
38
41
struct
LIBMOLDEO_API
moEventStruct
42
{
43
MOint
valid
;
44
MOint
deviceid
;
45
MOint
devicecode
;
46
MOint
reservedvalue0
;
47
MOint
reservedvalue1
;
48
MOint
reservedvalue2
;
49
MOint
reservedvalue3
;
50
};
51
53
56
class
LIBMOLDEO_API
moEvent
{
57
public
:
58
59
moEvent
*
previous
;
60
moEvent
*
next
;
61
62
MOint
deviceid
;
//esto vuela
63
MOint
devicecode
;
//esto puede q quede
64
MOint
reservedvalue0
;
65
MOint
reservedvalue1
;
66
MOint
reservedvalue2
;
67
MOint
reservedvalue3
;
68
MOpointer
pointer
;
69
71
moEvent
();
73
moEvent
(
MOint
did,
MOint
cod,
MOint
val0 = 0,
MOint
val1 = 0,
MOint
val2 = 0,
MOint
val3 = 0,
MOpointer
ptr=0);
75
moEvent
(
MOint
did,
MOint
cod,
MOint
val0,
MOpointer
ptr );
77
virtual
~
moEvent
();
78
79
moText
JSON
;
80
81
virtual
const
moText
& ToJSON();
82
};
83
84
#define MO_MESSAGE 0xFABC05
85
#define MO_DATAMESSAGE 0xFABFAB
86
88
97
class
LIBMOLDEO_API
moMessage
:
public
moEvent
{
98
99
public
:
100
moMessage
();
101
moMessage
(
const
moMessage
& src) :
moEvent
() {
102
(*this) = src;
103
}
104
moMessage
&
operator=
(
const
moMessage
& src);
105
106
moMessage
(
MOint
m_MoldeoIdDest,
MOint
m_MoldeoIdSrc,
const
moData
& data );
107
moMessage
(
MOint
m_MoldeoIdDest,
MOint
m_InletIdDest,
MOint
m_MoldeoIdSrc,
const
moData
& data );
108
moMessage
(
MOint
p_MoldeoIdDest,
MOint
m_InletIdDest,
moMoldeoObjectType
p_TypeDest,
MOint
p_MoldeoIdSrc,
moMoldeoObjectType
p_TypeSrc,
const
moData
& p_data );
109
moMessage
(
MOint
p_MoldeoIdDest,
MOint
m_InletIdDest,
moMoldeoObjectType
p_TypeDest,
moText
p_NameDest,
MOint
p_MoldeoIdSrc,
moMoldeoObjectType
p_TypeSrc,
moText
p_NameSrc,
const
moData
& p_data );
110
virtual
~
moMessage
();
111
112
moData
m_Data
;
113
114
MOint
m_MoldeoIdDest
;
115
MOint
m_InletIdDest
;
116
moMoldeoObjectType
m_TypeDest
;
117
moText
m_NameDest
;
118
119
MOint
m_MoldeoIdSrc
;
120
MOint
m_OutletIdSrc
;
121
moMoldeoObjectType
m_TypeSrc
;
122
moText
m_NameSrc
;
123
124
virtual
const
moText
&
ToJSON
();
125
};
126
127
moDeclareExportedDynamicArray
(
moMessage
, moMessages );
128
129
130
132
139
class
LIBMOLDEO_API
moEventList
:
public
moAbstract
{
140
141
public
:
142
143
moLock
m_lock
;
144
145
moEvent
*
First
;
146
moEvent
*
Last
;
147
148
moEventList
();
149
virtual
~
moEventList
();
150
151
152
MOboolean
Init
();
153
void
Add(
moMessage
* p_Message );
154
void
Add(
moEvent
* p_Event );
155
void
Add(
MOint
did,
MOint
cod,
MOint
val0 = 0,
MOint
val1 = 0,
MOint
val2 = 0,
MOint
val3 = 0,
MOpointer
ptr=0);
156
void
Add(
MOint
did,
MOint
cod,
MOint
val0,
MOpointer
ptr );
157
MOboolean
Delete(
moEvent
*ev);
158
MOboolean
Delete(
moMessage
*ev);
159
MOboolean
Finish
();
160
161
};
162
163
// moEventPacket class **************************************************
165
171
class
LIBMOLDEO_API
moEventPacket
:
public
moAbstract
172
{
173
public
:
174
moEventPacket
(
float
p_sendInterval,
int
p_maxEventNum);
175
~
moEventPacket
();
176
177
void
ClearPacket();
178
bool
AddEvent(
moEvent
*e);
179
bool
ReadyToSend();
180
181
int
GetNumEvents
() {
return
num_events; }
182
int
GetPacketSize
() {
return
num_events *
sizeof
(
moEventStruct
); }
183
moEventStruct
*
GetPacket
() {
return
buffer_events; }
184
moEventStruct
GetEvent
(
int
i) {
return
buffer_events[i]; }
185
private
:
186
float
sendInterval;
187
int
maxEventNum;
188
189
float
time0;
190
191
moEventStruct
* buffer_events;
192
void
* pointer;
193
moEventStruct
empty_event;
194
int
num_events;
195
bool
packet_full;
196
};
197
198
moDeclareExportedDynamicArray
(
moEventPacket
*, moEventPacketArray );
199
200
#endif
moMoldeoObjectType
moMoldeoObjectType
Tipos de objetos en Moldeo.
Definition:
moTypes.h:525
moEvent::next
moEvent * next
Definition:
moEventList.h:60
moMessage::m_InletIdDest
MOint m_InletIdDest
Definition:
moEventList.h:115
moEventList::First
moEvent * First
Definition:
moEventList.h:145
moMessage::m_MoldeoIdSrc
MOint m_MoldeoIdSrc
Definition:
moEventList.h:119
moEvent::ToJSON
virtual const moText & ToJSON()
Definition:
moEventList.cpp:226
moEvent
Clase Evento.
Definition:
moEventList.h:56
moMessage::m_MoldeoIdDest
MOint m_MoldeoIdDest
Definition:
moEventList.h:114
moAbstract::Finish
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition:
moAbstract.cpp:147
moLock
Definition:
moLock.h:50
moEvent::deviceid
MOint deviceid
Definition:
moEventList.h:62
moEvent::pointer
MOpointer pointer
Definition:
moEventList.h:68
moEventPacket::GetPacket
moEventStruct * GetPacket()
Definition:
moEventList.h:183
moMessage::moMessage
moMessage(const moMessage &src)
Definition:
moEventList.h:101
MOboolean
#define MOboolean
Definition:
moTypes.h:385
moValue.h
moEvent::JSON
moText JSON
Definition:
moEventList.h:79
moMessage
Clase Mensaje.
Definition:
moEventList.h:97
moMessage::m_NameSrc
moText m_NameSrc
Definition:
moEventList.h:122
moAbstract
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition:
moAbstract.h:191
moAbstract::Init
virtual MOboolean Init()
Inicializa el objeto.
Definition:
moAbstract.cpp:141
moEvent::previous
moEvent * previous
Definition:
moEventList.h:59
moMessage::m_NameDest
moText m_NameDest
Definition:
moEventList.h:117
moEventPacket::GetPacketSize
int GetPacketSize()
Definition:
moEventList.h:182
moEventStruct::reservedvalue0
MOint reservedvalue0
Definition:
moEventList.h:46
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
moMessage::m_TypeDest
moMoldeoObjectType m_TypeDest
Definition:
moEventList.h:116
moEventStruct::reservedvalue1
MOint reservedvalue1
Definition:
moEventList.h:47
moEventList
Lista de eventos.
Definition:
moEventList.h:139
moText0
clase de para manejar textos
Definition:
moText.h:75
moEvent::reservedvalue1
MOint reservedvalue1
Definition:
moEventList.h:65
moEventStruct::reservedvalue2
MOint reservedvalue2
Definition:
moEventList.h:48
moEventStruct::devicecode
MOint devicecode
Definition:
moEventList.h:45
moEventPacket::GetNumEvents
int GetNumEvents()
Definition:
moEventList.h:181
MOint
#define MOint
Definition:
moTypes.h:388
moEventStruct
Estructura base de un evento.
Definition:
moEventList.h:41
moEvent::reservedvalue0
MOint reservedvalue0
Definition:
moEventList.h:64
moLock.h
moEvent::reservedvalue3
MOint reservedvalue3
Definition:
moEventList.h:67
moEvent::devicecode
MOint devicecode
Definition:
moEventList.h:63
moEventStruct::reservedvalue3
MOint reservedvalue3
Definition:
moEventList.h:49
moEventStruct::deviceid
MOint deviceid
Definition:
moEventList.h:44
operator=
moMatrix3 & operator=(const moMatrix3 &rkM)
Definition:
moMathMatrix.h:2102
moData
Definition:
moValue.h:155
moEventList::m_lock
moLock m_lock
Definition:
moEventList.h:143
moEventStruct::valid
MOint valid
Definition:
moEventList.h:43
moDeclareExportedDynamicArray
moDeclareExportedDynamicArray(moMessage, moMessages)
moEventPacket
Paquete de eventos.
Definition:
moEventList.h:171
moMessage::m_Data
moData m_Data
Definition:
moEventList.h:112
moEventPacket::GetEvent
moEventStruct GetEvent(int i)
Definition:
moEventList.h:184
moMessage::m_TypeSrc
moMoldeoObjectType m_TypeSrc
Definition:
moEventList.h:121
MOpointer
#define MOpointer
Definition:
moTypes.h:409
moEventList::Last
moEvent * Last
Definition:
moEventList.h:146
moEvent::reservedvalue2
MOint reservedvalue2
Definition:
moEventList.h:66
moMessage::m_OutletIdSrc
MOint m_OutletIdSrc
Definition:
moEventList.h:120
libmoldeo
moEventList.h
Generated on Wed May 17 2017 14:09:17 for libmoldeo (Moldeo 1.0 Core) by
1.8.8