00001 /* 00002 * lib-spamod : Visualisation des objets en discret. 00003 * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC 00004 * http://www.sic.sp2mi.univ-poitiers.fr/ 00005 * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS, 00006 * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/ 00007 * 00008 * This file is part of lib-spamod 00009 * 00010 * This program is free software: you can redistribute it and/or modify 00011 * it under the terms of the GNU Lesser General Public License as published by 00012 * the Free Software Foundation, either version 3 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public License 00021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 /****************************************************************************** 00025 * Fichier : Ineq_Use_Att.h * 00026 * Auteur : DEXET Martine * 00027 *----------------------------------------------------------------------------* 00028 * Ce fichier contient la spécification de la classe Ineq_Use_Att. Cette * 00029 * classe permet de stocker un objet de la classe Ineq_Use en tant * 00030 * qu'attribut. * 00031 * * 00032 *****************************************************************************/ 00033 00034 00035 #ifndef INEQ_USE_ATT_H 00036 #define INEQ_USE_ATT_H 00037 00038 #include "ineq-use.hh" 00039 #include "attribute.hh" 00040 00041 00042 /****************************************************************************** 00043 * Classe Ineq_Use_Att * 00044 *****************************************************************************/ 00045 00046 class Ineq_Use_Att : public CAttribute { 00047 00048 public: 00049 00050 // Constructeur. 00051 Ineq_Use_Att(); 00052 00053 // Destructeur. 00054 virtual ~Ineq_Use_Att(); 00055 00056 // Surcharge des méthodes de la classe CAttribute. 00057 TAttributeId getType() const; 00058 Ineq_Use * Get_Data(); 00059 CAttribute * copy() const; 00060 void destroy(); 00061 void save(std::ostream &fd) const; 00062 void load(std::istream &fd); 00063 00064 private: 00065 00066 // Pointeur sur un objet de la classe Ineq_Use. 00067 Ineq_Use * tab; 00068 }; 00069 00070 /****************************************************************************** 00071 * Fichier : Ineq_Use_Att.inl * 00072 * Auteur : DEXET Martine * 00073 *----------------------------------------------------------------------------* 00074 * Ce fichier contient l'implémentation des méthodes de la classe * 00075 * Ineq_Use_Att. * 00076 * * 00077 *****************************************************************************/ 00078 00079 // Constructeur. 00080 inline 00081 Ineq_Use_Att::Ineq_Use_Att() 00082 { 00083 tab = new Ineq_Use(); 00084 } 00085 00086 00087 // Destructeur. 00088 inline 00089 Ineq_Use_Att::~Ineq_Use_Att() 00090 { 00091 delete tab; 00092 } 00093 00094 00095 // Surcharge des méthodes de la classe CAttribute. 00096 inline 00097 TAttributeId Ineq_Use_Att::getType() const 00098 { 00099 return USE_ATTRIBUTE_ID; 00100 } 00101 00102 inline 00103 Ineq_Use * Ineq_Use_Att::Get_Data() 00104 { 00105 return tab; 00106 } 00107 00108 inline 00109 CAttribute * Ineq_Use_Att::copy() const 00110 { 00111 Ineq_Use_Att* i = new Ineq_Use_Att(); 00112 00113 for (int j=0; j<6; j++) 00114 i->tab->Set_Use(j, tab->Get_Use(j)); 00115 00116 return i; 00117 } 00118 00119 00120 inline 00121 void Ineq_Use_Att::destroy() 00122 { 00123 delete this; 00124 } 00125 00126 00127 inline 00128 void Ineq_Use_Att::save(std::ostream &fd) const 00129 { 00130 for (int i=0; i<6; i++) 00131 fd << tab->Get_Use(i) << " "; 00132 00133 fd << std::endl; 00134 } 00135 00136 inline 00137 void Ineq_Use_Att::load(std::istream &fd) 00138 { 00139 } 00140 00141 #endif