Salome HOME
fac8830d6f5dd9b036213a6b924999a10ac096ad
[modules/kernel.git] / src / Batch / Batch_DateType.cxx
1 /*
2  * DateType.cxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
6  * Date   : Wed Nov 26 11:15:34 2003
7  * Projet : Salome 2
8  *
9  */
10 extern "C" {
11 #include <time.h>
12 }
13 #include "Batch_DateType.hxx"
14
15 namespace Batch {
16
17         // Conversion en chaine
18   string DateType::affiche() const
19   {
20     return _data.str();
21   }
22
23         // Operateur d'affectation
24   DateType & DateType::operator =(const Date & d)
25   {
26     _data = d;
27     return *this;
28   }
29
30         // Conversion en Date
31   DateType::operator Date() const
32   {
33     return _data;
34   }
35
36         // Conversion en long
37   DateType::operator long() const
38   {
39     return _data.epoch();
40   }
41
42         // Clone duplique l'objet et en fabrique un nouveau a l'aide de new
43         // qu'il faudra detruire ensuite manuellement
44   GenericType * DateType::clone() const
45   {
46     DateType * pD = new DateType(this->_data);
47     assert(pD != 0);
48     return pD;
49   }
50
51 }