coord.C

00001 /*
00002  *  Methods of class Coord
00003  *
00004  *   (see file coord.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 1999-2000 Jean-Alain Marck
00010  *   Copyright (c) 1999-2001 Eric Gourgoulhon
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License as published by
00016  *   the Free Software Foundation; either version 2 of the License, or
00017  *   (at your option) any later version.
00018  *
00019  *   LORENE is distributed in the hope that it will be useful,
00020  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *   GNU General Public License for more details.
00023  *
00024  *   You should have received a copy of the GNU General Public License
00025  *   along with LORENE; if not, write to the Free Software
00026  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  *
00028  */
00029 
00030 
00031 char coord_C[] = "$Header: /cvsroot/Lorene/C++/Source/Coord/coord.C,v 1.3 2008/02/18 13:53:39 j_novak Exp $" ;
00032 
00033 /*
00034  * $Id: coord.C,v 1.3 2008/02/18 13:53:39 j_novak Exp $
00035  * $Log: coord.C,v $
00036  * Revision 1.3  2008/02/18 13:53:39  j_novak
00037  * Removal of special indentation instructions.
00038  *
00039  * Revision 1.2  2002/10/16 14:36:34  j_novak
00040  * Reorganization of #include instructions of standard C++, in order to
00041  * use experimental version 3 of gcc.
00042  *
00043  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00044  * LORENE
00045  *
00046  * Revision 2.3  1999/10/15  09:16:11  eric
00047  * Depoussierage.
00048  *
00049  * Revision 2.2  1999/03/01  15:07:25  eric
00050  * *** empty log message ***
00051  *
00052  * Revision 2.1  1999/02/23  14:57:03  hyc
00053  * *** empty log message ***
00054  *
00055  * Revision 2.0  1999/02/15  10:42:45  hyc
00056  * *** empty log message ***
00057  *
00058  * $Header: /cvsroot/Lorene/C++/Source/Coord/coord.C,v 1.3 2008/02/18 13:53:39 j_novak Exp $
00059  *
00060  */
00061 
00062 // Fichier includes
00063 #include <stdlib.h>
00064 #include <stdio.h>
00065 #include "coord.h"
00066 #include "mtbl.h"
00067 
00068             //---------------//
00069             // Constructeurs //
00070                 //---------------//
00071 
00072 // Constructeur par defaut
00073 Coord::Coord() : mp(0x0), met_fait(0x0), c(0x0) {}
00074 
00075 // Constructeur
00076 Coord::Coord(const Map* mpi, Mtbl* (*construit)(const Map* ) ) : mp(mpi), 
00077                                met_fait(construit), 
00078                                c(0x0)
00079 {}
00080 
00081             //--------------//
00082             // Destructeur  //
00083             //--------------//
00084 
00085 Coord::~Coord() {
00086     delete c ;
00087 }
00088 
00089             //------------//
00090             // Impression //
00091             //------------//
00092 
00093 // Operateurs <<
00094 ostream& operator<<(ostream& o, const Coord & ci) {
00095 
00096     if (ci.c == 0x0) {
00097     o << "La coordonnee n'est pas a jour, je la fais." << endl ;
00098     ci.fait() ;
00099     }
00100     o << "Coordonnee: " << endl ;
00101     o << *(ci.c) << endl ;
00102     return o ;
00103 }
00104     
00105             //----------//
00106             // Methodes //
00107             //----------//
00108 
00109 void Coord::fait() const {
00110     delete c ;
00111     c = met_fait(mp) ;
00112 }
00113     
00114             //-----------------//
00115             // Gestion memoire //
00116             //-----------------//
00117 
00118 void Coord::del_t() const {
00119     delete c ;
00120     c = 0x0 ;
00121 }
00122 
00123             //--------------------//
00124             // Fonctions diverses //
00125             //--------------------//
00126 
00127 void Coord::set(const Map* mpi, Mtbl* (*construit)(const Map*) ) {
00128     mp = mpi ;
00129     met_fait = construit ;
00130 }

Generated on Tue Feb 7 01:35:15 2012 for LORENE by  doxygen 1.4.6