Changeset 701 in Sophya for trunk/SophyaLib/Samba/spherepos.cc
- Timestamp:
- Jan 4, 2000, 3:27:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/spherepos.cc
r682 r701 1 // 04/01/00 : implantation de la persistance par classe deleguee - Guy Le Meur 2 1 3 #include "spherepos.h" 2 4 3 static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.cc,v 1. 3 1999-12-10 16:55:59ansari Exp $";5 static char *head_spherepos_cc_ = "$Header: /Users/garnier/temp/CVSSophya/SophyaLib/Samba/spherepos.cc,v 1.4 2000-01-04 14:27:15 ansari Exp $"; 4 6 5 7 … … 9 11 id_ = SphereCoordSys_NEUTRAL; 10 12 description_ = "NEUTRAL SphereCoordSystem"; 13 } 14 SphereCoordSys::SphereCoordSys(const SphereCoordSys& a ) 15 { 16 id_ = a.id_; 17 description_ = a.description_; 11 18 } 12 19 … … 19 26 { 20 27 } 21 22 // Temporary implementation of PPersist:: 23 // To be changed later ($CHECK$ Reza 26/10/99) 24 void SphereCoordSys::ReadSelf(PInPersist& is) 28 SphereCoordSys& SphereCoordSys::operator = (const SphereCoordSys& a) 25 29 { 26 uint_8 itab[3]; 27 is.Get(itab, 3); 28 id_ = itab[1]; 29 is.GetStr(description_); 30 id_ = a.id_; 31 description_ = a.description_; 32 return *this; 30 33 } 31 34 32 void SphereCoordSys::WriteSelf(POutPersist& os) const 35 36 //////////////////////////////////////////////////////////////// 37 // ------------------------------------------------------------------------- 38 // Les objets delegues pour la gestion de persistance 39 // ------------------------------------------------------------------------- 40 41 FIO_SphereCoordSys::FIO_SphereCoordSys() 42 { 43 dobj=new SphereCoordSys; 44 ownobj=true; 45 } 46 FIO_SphereCoordSys::FIO_SphereCoordSys(string const & filename) 47 { 48 dobj=new SphereCoordSys; 49 ownobj=true; 50 Read(filename); 51 } 52 FIO_SphereCoordSys::FIO_SphereCoordSys(const SphereCoordSys & obj) 53 { 54 dobj = new SphereCoordSys(obj); 55 ownobj=true; 56 } 57 FIO_SphereCoordSys::FIO_SphereCoordSys(SphereCoordSys * obj) 58 { 59 dobj = obj; 60 ownobj=false; 61 } 62 FIO_SphereCoordSys::~FIO_SphereCoordSys() 63 { 64 if (ownobj && dobj) delete dobj; 65 } 66 AnyDataObj* FIO_SphereCoordSys::DataObj() 67 { 68 return(dobj); 69 } 70 71 72 void FIO_SphereCoordSys::ReadSelf(PInPersist& is) 73 { 74 uint_8 itab[3]; 75 string description; 76 is.Get(itab, 3); 77 is.GetStr(description); 78 if (dobj == NULL) dobj = new SphereCoordSys(itab[1], description); 79 else *dobj= SphereCoordSys(itab[1], description); 80 } 81 void FIO_SphereCoordSys::WriteSelf(POutPersist& os) const 33 82 { 83 if (dobj == NULL) return; // Attention - $CHECK$ Guy 04/01/00 34 84 // On ecrit 3 uint_8 35 85 // 0 : Numero de version, 1 : Id, 2 reserve a l 36 86 uint_8 itab[3]; 37 87 itab[0] = 1; 38 itab[1] = id_;88 itab[1] = dobj->Id(); 39 89 itab[2] = 0; 40 90 os.Put(itab, 3); 41 os.PutStr(description_); 42 } 91 os.PutStr(dobj->description()); 92 } 93 94 43 95 44 96 //................. SpherePosition class .................
Note:
See TracChangeset
for help on using the changeset viewer.