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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moIODeviceManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moIODeviceManager.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 #ifndef __MO_IODEVICE_H
32 #define __MO_IODEVICE_H
33 
34 #include "moTypes.h"
35 #include "moText.h"
36 #include "moMoldeoObject.h"
37 #include "moDeviceCode.h"
38 #include "moEventList.h"
39 #include "moRenderManager.h"
40 
41 
42 
50 
51  public:
52 
56  moIODevice();
57 
61  virtual ~moIODevice();
62 
66  virtual void Update(moEventList*) = 0;
67 
71  virtual MOboolean Init() = 0;
72 
76  virtual MOswitch GetStatus( MOdevcode) = 0;//get the status of the specific devicecode
77 
81  virtual void SetValue( MOdevcode, MOint );
82 
86  virtual void SetValue( MOdevcode, MOfloat );
87 
91  virtual void SetValue( MOdevcode, moData );
92 
96  virtual void SetValue( MOdevcode, MOlong, MOpointer );
97 
101  virtual MOpointer GetPointer( MOdevcode);//in case we need to get a buffer data pointer
102 
106  virtual MOint GetValue( MOdevcode devcode ) = 0;//get the actual value of the specific devicecode
107 
111  virtual moData GetValue( MOdevcode, moDataType );//get the actual value of the specific devicecode
112 
116  virtual MOint GetValue( MOdevcode, MOint);//get the actual value of the specific devicecode
117 
121  virtual MOint GetNValues( MOdevcode);//get the actual value of the specific devicecode
122 
126  virtual MOswitch SetStatus( MOdevcode,MOswitch) = 0;
127 
131  virtual MOdevcode GetCode( moText) = 0;//todos los codes estan definidos con un name en ascii por si las moscas
132 
136  virtual MOboolean Finish() = 0;
137 
141  MOint GetId() { return m_DeviceId; }
142 
146  void SetId( MOint p_id ) { m_DeviceId = p_id; }
147 
148  protected:
149 
150  MOint m_DeviceId;//device id relative
151 
152 };
153 
154 moDeclareExportedDynamicArray(moIODevice*, moIODevicesArray);
155 
156 #include "moIODevicePlugin.h"
157 
158 
159 
160 
169 
170  public:
171 
176 
180  virtual ~moIODeviceManager();
181 
185  moIODevice* NewIODevice( const moText& p_devname, const moText& p_configname, const moText& p_labelname, const moText& p_keyname, moMoldeoObjectType p_type, int paramindex = -1, int valueindex = -1, bool p_activate=true );
186 
190  MOboolean RemoveIODevice( MOint p_ID );
191 
192 
196  moIODevicesArray& IODevices();
197 
201  void Update();
202 
206  virtual MOboolean Init();
207 
211  virtual MOboolean Finish();
212 
216  MOswitch GetStatus(MOdevcode);
217 
221  MOswitch SetStatus( MOdevcode,MOswitch);
222 
226  MOdevcode GetCode( char*);
227 
231  moEventList* GetEvents();
232 
238  void PurgeEvents();
239 
240  private:
241 
242  moEventList *Events;
243  moIODevicesArray m_IODevices;
244  moIODevicePluginsArray m_Plugins;
245 
246  virtual void PollEvents();//aplicacion de la libreria de SDL(hay que hacer la propia)
247 };
248 
249 
250 #endif
moMoldeoObjectType
Tipos de objetos en Moldeo.
Definition: moTypes.h:525
moDataType
Definition: moValue.h:98
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
#define MOboolean
Definition: moTypes.h:385
void SetId(MOint p_id)
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
virtual MOboolean Init()
Inicializa el objeto.
Definition: moAbstract.cpp:141
#define MOswitch
Definition: moTypes.h:386
#define LIBMOLDEO_API
Definition: moTypes.h:180
moDeclareExportedDynamicArray(moIODevice *, moIODevicesArray)
#define MOfloat
Definition: moTypes.h:403
Lista de eventos.
Definition: moEventList.h:139
clase de para manejar textos
Definition: moText.h:75
#define MOlong
Definition: moTypes.h:391
#define MOdevcode
Definition: moTypes.h:412
#define MOint
Definition: moTypes.h:388
Clase Base para Objetos Moldeo ( moEffect, moIODevice, moResource, moConsole )
virtual void Update(moEventList *p_EventList)
virtual MOboolean Finish()
#define MOpointer
Definition: moTypes.h:409
virtual MOboolean Init()