diff --git a/src/db/db/dbLayerProperties.h b/src/db/db/dbLayerProperties.h index 8875228f0..43a4c813f 100644 --- a/src/db/db/dbLayerProperties.h +++ b/src/db/db/dbLayerProperties.h @@ -229,5 +229,17 @@ inline LayerProperties &operator+= (LayerProperties &props, const LayerOffset &o } +/** + * @brief Special extractors for LayerProperties and LayerOffset + */ +namespace tl +{ + template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::LayerProperties &p); + template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::LayerOffset &p); + + template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::LayerProperties &p); + template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::LayerOffset &p); +} // namespace tl + #endif diff --git a/src/db/db/dbTrans.h b/src/db/db/dbTrans.h index 115f6b920..f20438b6e 100644 --- a/src/db/db/dbTrans.h +++ b/src/db/db/dbTrans.h @@ -2671,6 +2671,7 @@ namespace tl template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::CplxTrans &t); template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::VCplxTrans &t); template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::DCplxTrans &t); + template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::ICplxTrans &t); template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::UnitTrans &t); template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::DUnitTrans &t); @@ -2683,6 +2684,7 @@ namespace tl template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::CplxTrans &t); template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::VCplxTrans &t); template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::DCplxTrans &t); + template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::ICplxTrans &t); } // namespace tl diff --git a/src/tl/tl/tlString.cc b/src/tl/tl/tlString.cc index 833794a55..25ceef153 100644 --- a/src/tl/tl/tlString.cc +++ b/src/tl/tl/tlString.cc @@ -44,14 +44,14 @@ static std::locale c_locale ("C"); // ------------------------------------------------------------------------- // Exception classes -ExtractorNotImplementedException::ExtractorNotImplementedException () - : Exception (tl::to_string (tr ("No string extractor available"))) +ExtractorNotImplementedException::ExtractorNotImplementedException (const std::type_info &ti) + : Exception (tl::to_string (tr ("No string extractor available for type: ")) + ti.name ()) { // .. nothing yet .. } -StringConversionException::StringConversionException () - : Exception (tl::to_string (tr ("No string conversion available"))) +StringConversionException::StringConversionException (const std::type_info &ti) + : Exception (tl::to_string (tr ("No string conversion available for type: ")) + ti.name ()) { // .. nothing yet .. } diff --git a/src/tl/tl/tlString.h b/src/tl/tl/tlString.h index 6266bbb04..02becf0d5 100644 --- a/src/tl/tl/tlString.h +++ b/src/tl/tl/tlString.h @@ -27,6 +27,7 @@ #include "tlCommon.h" #include +#include #include #include #include @@ -48,7 +49,7 @@ class TL_PUBLIC ExtractorNotImplementedException : public tl::Exception { public: - ExtractorNotImplementedException (); + ExtractorNotImplementedException (const std::type_info &ti); }; /** @@ -58,12 +59,12 @@ class TL_PUBLIC StringConversionException : public tl::Exception { public: - StringConversionException (); + StringConversionException (const std::type_info &ti); }; class Extractor; -template void extractor_impl (tl::Extractor &, T &) { throw ExtractorNotImplementedException (); } -template bool test_extractor_impl (tl::Extractor &, T &) { throw ExtractorNotImplementedException (); } +template void extractor_impl (tl::Extractor &, T &) { throw ExtractorNotImplementedException (typeid (T)); } +template bool test_extractor_impl (tl::Extractor &, T &) { throw ExtractorNotImplementedException (typeid (T)); } /** * @brief Another string class @@ -289,7 +290,7 @@ TL_PUBLIC std::string to_local (const std::string &s); template struct __redirect_to_string; template struct __redirect_to_string { static std::string to_string (const T &t) { return t.to_string (); } }; -template struct __redirect_to_string { static std::string to_string (const T &) { throw StringConversionException (); } }; +template struct __redirect_to_string { static std::string to_string (const T &) { throw StringConversionException (typeid (T)); } }; template inline std::string to_string (const T &o) { return __redirect_to_string::value>::to_string (o); } template <> inline std::string to_string (const double &d) { return to_string (d, 12); } diff --git a/src/tl/tl/tlVariant.h b/src/tl/tl/tlVariant.h index 960566844..f621d4f73 100644 --- a/src/tl/tl/tlVariant.h +++ b/src/tl/tl/tlVariant.h @@ -55,6 +55,8 @@ namespace tl class Extractor; class EvalClass; +template void extractor_impl (tl::Extractor &, T &); +template bool test_extractor_impl (tl::Extractor &, T &); /** * @brief A base class which describes a class, i.e. an object capable of converting and handling void * @@ -1662,6 +1664,12 @@ template<> inline bool Variant::can_convert_to () const { */ void initialize_variant_class_table (); +/** + * @brief Special extractors for Variant + */ +template<> TL_PUBLIC void extractor_impl (tl::Extractor &ex, Variant &v); +template<> TL_PUBLIC bool test_extractor_impl (tl::Extractor &ex, Variant &v); + } // namespace tl #endif