Salome HOME
Increment version number (2.2.3)
[modules/kernel.git] / src / Batch / Batch_GenericType.hxx
1 /*
2  * GenericType.hxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Date   : Septembre 2003
6  * Projet : SALOME 2
7  *
8  */
9
10 #ifndef _GENERICTYPE_H_
11 #define _GENERICTYPE_H_
12
13
14 #include <iostream>
15 #include <string>
16
17 namespace Batch {
18
19   class GenericType
20   {
21   public:
22                 // Constructeur et destructeur
23     GenericType() { _nb++; }
24     virtual ~GenericType() { _nb--; }
25
26                 // Operateur pour l'affichage sur un stream
27     friend std::ostream & operator << (std::ostream & os, const GenericType & obj);
28
29                 // Conversion en chaine
30     virtual std::string affiche() const;
31
32                 // Clone duplique l'objet et en fabrique un nouveau a l'aide de new
33                 // qu'il faudra detruire ensuite manuellement
34     virtual GenericType * clone() const;
35
36                 // Retourne le nombre d'objets GenericType et al.
37                 static int getNb() { return _nb; }
38
39   protected:
40
41   private:
42                 static int _nb; // nombre total d'objets GenericType et al.
43   
44   };
45
46 }
47
48 #endif
49