00001 /* 00002 * lib-gmapkernel : Un noyau de 3-G-cartes et des opérations. 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-gmapkernel 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 #ifndef ATTRIBUTE_HH 00026 #define ATTRIBUTE_HH 00027 //****************************************************************************** 00028 #include "kernel-types.hh" 00029 #include "inline-macro.hh" 00030 00031 #include <iostream> 00032 //****************************************************************************** 00047 class CAttribute 00048 { 00049 public: 00050 // @name Constructeurs et destructeur. 00051 // @{ 00052 00054 CAttribute(); 00055 00057 CAttribute(const CAttribute& CAttribute); 00058 00060 virtual ~CAttribute(); 00061 00062 // @} 00063 // @name Méthodes virtuelles pures à implémenter dans les classes filles. 00064 // @{ 00065 00069 virtual TAttributeId getType() const = 0; 00070 00077 virtual CAttribute* copy() const = 0; 00078 00084 virtual void destroy() = 0; 00085 00093 virtual void save(std::ostream& AStream) const = 0; 00094 00103 virtual void load(std::istream& AStream) = 0; 00104 00105 // @} 00106 // @name Opérateurs de flux. 00107 // @{ 00108 00113 friend std::ostream& operator<<(std::ostream& AOS, 00114 const CAttribute& AAttribute); 00115 00120 friend std::istream& operator>>(std::istream& AIS, 00121 CAttribute& AAttribute); 00122 00123 // @} 00124 // @name Méthodes de manipulation de la liste des attributs. 00125 // @{ 00126 00132 CAttribute* getNext() const; 00133 00139 void setNext(CAttribute* ANext); 00140 00146 CAttribute* getPrev() const; 00147 00153 void setPrev(CAttribute* APrev); 00154 00155 // @} 00156 00157 private: 00158 // @name Champs privés (chaînage des attributs) 00159 // @{ 00160 00162 CAttribute* FPrev; 00163 00165 CAttribute* FNext; 00166 00167 // @} 00168 }; 00169 //****************************************************************************** 00170 #include INCLUDE_INLINE("attribute.icc") 00171 //****************************************************************************** 00172 #endif // ATTRIBUTE_HH 00173 //******************************************************************************