46 #ifndef MUELU_VARIABLECONTAINER_HPP
47 #define MUELU_VARIABLECONTAINER_HPP
51 #include <Teuchos_TypeNameTraits.hpp>
53 #include <Xpetra_Matrix.hpp>
54 #include <Xpetra_Operator.hpp>
79 virtual const std::type_info&
type()
const = 0;
80 virtual std::string
typeName()
const = 0;
87 const std::type_info&
type()
const {
return typeid(T); }
88 std::string
typeName()
const {
return Teuchos::TypeNameTraits<T>::name(); }
97 const std::string typeName = Teuchos::TypeNameTraits<T>::name();
98 TEUCHOS_TEST_FOR_EXCEPTION(
data_ == NULL, Teuchos::bad_any_cast,
99 "Error, cast to type Data<" << typeName <<
"> failed since the content is NULL");
101 TEUCHOS_TEST_FOR_EXCEPTION(
data_->
type() !=
typeid(T), Teuchos::bad_any_cast,
102 "Error, cast to type Data<" << typeName <<
"> failed since the actual underlying type is "
109 const std::string typeName = Teuchos::TypeNameTraits<T>::name();
110 TEUCHOS_TEST_FOR_EXCEPTION(!data, std::logic_error,
111 "Error, cast to type Data<" << typeName <<
"> failed but should not have and the actual underlying type is "
112 "\'" <<
data_->
typeName() <<
"! The problem might be related to incompatible RTTI systems in static and shared libraries!");
175 return std::string(
"");
190 request_container::iterator it =
requests_.find(reqFactory);
200 request_container::iterator it =
requests_.find(reqFactory);
202 "cannot call Release if factory has not been requested before by factory " << reqFactory);
203 if (--(it->second) == 0)
210 request_container::const_iterator it =
requests_.find(reqFactory);
211 return (it !=
requests_.end()) ? it->second : 0;
245 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
247 typedef Xpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node>
Operator;
248 typedef Xpetra::Matrix <Scalar,LocalOrdinal,GlobalOrdinal,Node>
Matrix;
251 typedef Teuchos::RCP<Operator> TO;
252 typedef Teuchos::RCP<Matrix> TM;
256 TEUCHOS_TEST_FOR_EXCEPTION(
data_ == NULL, Teuchos::bad_any_cast,
257 "Error, cast to type Data<" << Teuchos::TypeNameTraits<TO>::name() <<
"> failed since the content is NULL");
263 TEUCHOS_TEST_FOR_EXCEPTION(!data, std::logic_error,
264 "Error, cast to type Data<" << Teuchos::TypeNameTraits<TO>::name() <<
"> failed but should not have and the actual underlying type is "
265 "\'" <<
data_->
typeName() <<
"! The problem might be related to incompatible RTTI systems in static and shared libraries!");
272 TEUCHOS_TEST_FOR_EXCEPTION(
data_->
type() !=
typeid(TM), Teuchos::bad_any_cast,
273 "Error, cast to type Data<" << Teuchos::TypeNameTraits<TM>::name() <<
"> failed since the actual underlying type is "
279 TEUCHOS_TEST_FOR_EXCEPTION(!data, std::logic_error,
280 "Error, cast to type Data<" << Teuchos::TypeNameTraits<TM>::name() <<
"> failed but should not have and the actual underlying type is "
281 "\'" <<
data_->
typeName() <<
"! The problem might be related to incompatible RTTI systems in static and shared libraries!");
289 TEUCHOS_TEST_FOR_EXCEPTION(!datah, std::logic_error,
290 "Error, cast to type Data<" << Teuchos::TypeNameTraits<TO>::name() <<
"> failed but should not have and the actual underlying type is "
291 "\'" <<
datah_->
typeName() <<
"! The problem might be related to incompatible RTTI systems in static and shared libraries!");