00001 // $Id: TypeIdValue.hh 1742 2010-11-04 14:51:56Z g0dil $ 00002 // 00003 // Copyright (C) 2006 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #ifndef HH_SENF_Utils_TypeIdValue_ 00027 #define HH_SENF_Utils_TypeIdValue_ 1 00028 00029 // Custom includes 00030 #include <typeinfo> 00031 #include <string> 00032 #include <boost/scoped_ptr.hpp> 00033 #include <boost/operators.hpp> 00034 00035 //#include "TypeIdValue.mpp" 00036 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00037 00038 namespace senf { 00039 00040 00043 class TypeIdValue : public boost::totally_ordered<TypeIdValue> 00044 { 00045 public: 00046 //-//////////////////////////////////////////////////////////////////////// 00048 //\{ 00049 00050 // my default constructor 00051 // my copy constructor 00052 // my copy assignment 00053 // default destructor 00054 // no conversion constructors 00055 00056 TypeIdValue(); 00057 TypeIdValue(std::type_info const & v); 00058 00059 //\} 00060 //-//////////////////////////////////////////////////////////////////////// 00061 00062 bool operator==(TypeIdValue const & other) const; 00063 bool operator<(TypeIdValue const & other) const; 00064 00065 std::string name() const; 00066 std::string prettyName() const; 00067 00068 std::type_info const & id() const; 00069 00070 protected: 00071 00072 private: 00073 std::type_info const * p_; 00074 }; 00075 00079 TypeIdValue const typeIdValue(); 00080 00084 template <class Type> 00085 TypeIdValue const typeIdValue(); 00086 00090 template <class Type> 00091 TypeIdValue const typeIdValue(Type const & ob); 00092 00096 std::ostream & operator<<(std::ostream & os, TypeIdValue const & v); 00097 } 00098 00099 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00100 #include "TypeIdValue.cci" 00101 //#include "TypeIdValue.ct" 00102 #include "TypeIdValue.cti" 00103 #endif 00104 00105 00106 // Local Variables: 00107 // mode: c++ 00108 // fill-column: 100 00109 // c-file-style: "senf" 00110 // indent-tabs-mode: nil 00111 // ispell-local-dictionary: "american" 00112 // compile-command: "scons -u test" 00113 // comment-column: 40 00114 // End: