X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FTypeIdValue.hh;fp=senf%2FUtils%2FTypeIdValue.hh;h=f1b80182cdcab8e3d6024350db2c5f2906261a37;hb=a9d8ca7d0cd9d0ee9d3bd37988546d016ea5c27a;hp=85eebf03df0ae7184dcc3b56282023d08cb6c242;hpb=d0db5121616e343a54adee7be05583ba1d7af2c4;p=senf.git diff --git a/senf/Utils/TypeIdValue.hh b/senf/Utils/TypeIdValue.hh index 85eebf0..f1b8018 100644 --- a/senf/Utils/TypeIdValue.hh +++ b/senf/Utils/TypeIdValue.hh @@ -54,8 +54,7 @@ namespace senf { // no conversion constructors TypeIdValue(); - TypeIdValue(TypeIdValue const & other); - TypeIdValue const & operator=(TypeIdValue const & other); + TypeIdValue(std::type_info const & v); ///@} /////////////////////////////////////////////////////////////////////////// @@ -64,28 +63,14 @@ namespace senf { bool operator<(TypeIdValue const & other) const; std::string name() const; + std::string prettyName() const; + std::type_info const & id() const; protected: private: - template TypeIdValue(Type *); - - struct Value { - virtual ~Value(); - virtual std::type_info const & id() = 0; - virtual Value * clone() = 0; - }; - - template - struct ValueImpl : public Value { - virtual std::type_info const & id(); - virtual Value * clone(); - }; - - boost::scoped_ptr value_; - - template friend TypeIdValue const typeIdValue(); + std::type_info const * p_; }; TypeIdValue const typeIdValue(); @@ -93,6 +78,9 @@ namespace senf { template TypeIdValue const typeIdValue(); + template + TypeIdValue const typeidValue(Type const & ob); + std::ostream & operator<<(std::ostream & os, TypeIdValue const & v); }