libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Amigas 'defines' Grupos Páginas
moAbstract.h
Ir a la documentación de este archivo.
1 /*******************************************************************************
2 
3  moAbstract.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 #ifndef __MO_ABSTRACT_H__
33 #define __MO_ABSTRACT_H__
34 
35 #include "moTypes.h"
36 #include "moText.h"
37 #include "moLock.h"
38 
40 
48 {
49 public:
50 
51  moDebug();
52 
53  virtual ~moDebug();
54 
55 
57 
62  void SetStdout( const moText& filename = moText("") );
63 
64 
66 
71  bool Lock() { return m_Lock.Lock(); }
72 
74 
79  bool Unlock() { return m_Lock.Unlock(); }
80 
82 
86  void Error( moText p_text );
87 
89 
93  void Warning( moText p_text );
94 
96 
100  void Message( moText p_text );
101 
103 
108  void Log( moText p_text );
109 
111 
115  void Push( moText p_text ) {
116  Lock();
117  m_Debug.Push( p_text );
118  Unlock();
119  }
120 
122 
127  moText poped;
128  Lock();
129  poped = m_Debug.Pop();
130  Unlock();
131  return poped;
132  }
133 
134 
137  return m_Debug.Count();
138  }
139 
141 
150  return m_Debug;
151  }
152 
153 private:
154 
158  moTextHeap m_Debug;
159 
163  ofstream moErr;
164 
168  ofstream moLog;
169 
173  ofstream moStdOut;
174 
175  streambuf *psbuf, *backup;
176 
177 
178  moLock m_Lock;
179 
180 };
181 
183 
192 {
193 public:
194 
198  moAbstract();
199  virtual ~moAbstract();
200 
206  virtual MOboolean Init();
207 
213  virtual MOboolean Finish();
214 
220  MOboolean Initialized();
221 
222 
224 
225  static moDebug *MODebug2;
227 };
228 
229 
230 
231 #endif
232 
moText Pop()
Saca y devuelve el primer texto ingresado a la lista.
Definition: moAbstract.h:126
Definition: moLock.h:50
MOint Count()
Devuelve la cantidad de mensajes almacenados.
Definition: moAbstract.h:136
#define MOboolean
Definition: moTypes.h:385
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
#define LIBMOLDEO_API
Definition: moTypes.h:180
clase de para manejar textos
Definition: moText.h:75
moTextHeap & GetMessages()
Devuelve una referencia a la pila de mensajes.
Definition: moAbstract.h:149
moText0 moText
Definition: moText.h:291
#define MOint
Definition: moTypes.h:388
lista de textos
Definition: moText.h:306
bool Lock()
Paraliza el acceso a las funciones de escritura.
Definition: moAbstract.h:71
static moDebug * MODebug2
Clase de impresión de errores para depuración.
Definition: moAbstract.h:225
void Push(moText p_text)
Apila el mensaje dentro de la pila de mensajes.
Definition: moAbstract.h:115
MOboolean m_bInitialized
Valor de inicialización.
Definition: moAbstract.h:223
bool Unlock()
Libera el acceso a las funciones de escritura.
Definition: moAbstract.h:79
static moTextHeap * MODebug
Lista de textos.
Definition: moAbstract.h:226
Lista de mensajes para la depuración de errores y anuncio de errores y mensajes.
Definition: moAbstract.h:47