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
moFileRead.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moFileRead.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 /*==============================================
32 
33 
34 Class: moFileRead
35 
36 Description: use to read files from hard disc or other local devices.
37 Specially useful for long videos or data files, because it implements
38 asynchronous reads with a thread for each file.
39 
40 Todo: Multiple threads for multiple files
41 
42 Example:
43 
44  //set the file to read from
45 moFileRead::moIODevice::SettValue( CHUNKS_SIZE, 120000 );
46 moFileRead::moIODevice::SetValue( ADD_FILE_TO_READ,(MOpointer*)pFileName );
47 
48 //get the chunks
49 if(moFileRead::moIODevice::GetState( CHUNK_AVAILABLE )
50  moFileRead::moIODevice::GetValue( FILE_CHUNK,(MOpointer*)pChunk )
51 
52 ==============================================*/
53 
54 #include "moConfig.h"
55 #include "moDeviceCode.h"
56 #include "moEventList.h"
57 #include "moIODeviceManager.h"
58 #include "moTypes.h"
59 
60 
61 //#include "sdlnet/SDL_net.h"
62 #include "SDL_thread.h"
63 
64 #ifndef __MO_FILE_READ_H
65 #define __MO_FILE_READ_H
66 
67 
68 //typedef FileInThreadData* pFileInThreadData;
69 
71 {
72 public:
74  ~moFileRead();
75 
76  void Update(moEventList*);
77  MOboolean Init();
82  MOboolean Finish();
83 
84 private:
85  moConfig config;
86 
87  moEventList *events;
88 };
89 
90 int file_read_thread_main(void *);
91 
92 #endif
93 =======
94 
95 /*==============================================
96 
97 
98 Class: ajFileRead
99 
100 Description: use to read files from hard disc or other local devices.
101 Specially useful for long videos or data files, because it implements
102 asynchronous reads with a thread for each file.
103 
104 Todo: Multiple threads for multiple files
105 
106 Example:
107 
108  //set the file to read from
109 ajFileRead::moIODevice::SettValue( CHUNKS_SIZE, 120000 );
110 ajFileRead::moIODevice::SetValue( ADD_FILE_TO_READ,(MOpointer*)pFileName );
111 
112 //get the chunks
113 if(ajFileRead::moIODevice::GetState( CHUNK_AVAILABLE )
114  ajFileRead::moIODevice::GetValue( FILE_CHUNK,(MOpointer*)pChunk )
115 
116 ==============================================*/
117 
118 #include "moConfig.h"
119 #include "ajCodigoDispositivo.h"
120 #include "moEventList.h"
121 #include "moIODeviceManager.h"
122 #include "moTypes.h"
123 
124 
125 //#include "sdlnet/SDL_net.h"
126 #include "SDL_thread.h"
127 
128 #ifndef __MO_FILE_READ_H
129 #define __MO_FILE_READ_H
130 
131 
132 //typedef FileInThreadData* pFileInThreadData;
133 
134 class LIBMOLDEO_API ajFileRead : public moIODevice
135 {
136 public:
137  ajFileRead(moEventList*);
138  ~ajFileRead();
139 
140  void Currentizar(moEventList*);
141  MOboolean Init();
142  MOswitch getEstado(MOcodigodisp);
143  MOswitch setEstado( MOcodigodisp,MOswitch);
144  MOint getValor(MOcodigodisp);
145  MOcodigodisp getCodigo( moText);
146  MOboolean Finish();
147 
148 private:
149  moConfig config;
150 
151  moEventList *eventos;
152 };
153 
154 int file_read_thread_main(void *);
155 
156 #endif
157 >>>>>>> .r166
virtual MOint GetValue(MOdevcode)=0
virtual MOboolean Finish()=0
virtual void Update(moEventList *)=0
#define MOboolean
Definition: moTypes.h:385
virtual MOdevcode GetCode(moText)=0
#define MOswitch
Definition: moTypes.h:386
#define LIBMOLDEO_API
Definition: moTypes.h:180
virtual MOboolean Init()=0
Lista de eventos.
Definition: moEventList.h:139
clase de para manejar textos
Definition: moText.h:75
#define MOdevcode
Definition: moTypes.h:412
#define MOint
Definition: moTypes.h:388
int file_read_thread_main(void *)
virtual MOswitch GetStatus(MOdevcode)=0
virtual MOswitch SetStatus(MOdevcode, MOswitch)=0
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193