XMLIOSERVER 0.4
Serveur d'Entrées/Sorties parallèles
|
00001 /* ************************************************************************** * 00002 * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * 00003 * ************************************************************************** */ 00004 00005 #ifndef __OBJECT_HPP__ 00006 #define __OBJECT_HPP__ 00007 00016 #ifndef __XIOS_NO_EXTERN 00017 00018 // C++ standard headers 00019 #include <string> 00020 #include <iostream> 00021 00022 // Boost headers 00023 #include <boost/optional.hpp> 00024 00025 #endif // __XIOS_NO_EXTERN 00026 00027 // ////////////////////////////// Déclarations ///////////////////////////// // 00028 00029 // Classe de gestion d'erreur. 00030 class CException; 00031 00033 namespace xmlioserver 00034 { 00039 class CObject 00040 { 00041 public : // Destructeur 00042 00044 virtual ~CObject(void); 00045 00046 public : // Accesseurs 00047 00052 const std::string & getId(void) const; 00053 00054 public : // Mutateurs 00055 00057 void resetId(void); 00058 00064 void setId(const std::string & _new_id); 00065 00066 public : // Tests sur l'objet 00067 00072 bool hasId(void) const; 00073 00074 public : // Opérateurs de comparaison 00075 00082 bool operator == (const CObject & _other_obj) const; 00083 00090 bool operator != (const CObject & _other_obj) const; 00091 00092 public :// Flux de sortie 00093 00101 friend std::ostream & operator << (std::ostream & _os, const CObject & _object); 00102 00103 public : // virtual - Autres méthodes 00104 00105 00111 virtual std::string toString(void) const = 0; 00112 00118 virtual void fromString(const std::string & _object_str) = 0; 00119 00120 protected : // Constructeurs 00121 00123 CObject(void); 00124 00130 explicit CObject(const std::string & _id); 00131 00137 CObject(const CObject & _object); 00138 00144 CObject(const CObject * const _object_ptr); // NIY 00145 00146 private : // Propriétés 00147 00148 boost::optional<std::string> id ; 00150 }; // class CObject 00151 00152 } // namespace xmlioserver 00153 00154 #endif // __OBJECT_HPP__ 00155