43 #ifndef RTOP_SERVER_HPP
44 #define RTOP_SERVER_HPP
50 #include "RTOpPack_RTOpServerDecl.hpp"
54 template<
class Scalar>
60 op_factories_[op_factory->create()->op_name()] = op_factory;
63 template<
class Scalar>
67 typename op_factories_t::const_iterator itr = op_factories_.find(op_name);
69 itr == op_factories_.end(), std::logic_error
70 ,
"RTOpServer<Scalar>::get_op_factory(...): Error, an operator factory with the "
71 "operator name \'" << op_name <<
"\' does not exist!"
76 template<
class Scalar>
81 o <<
"\nRTOpServer<Scalar>::print_op_factories(...): RTOp operator factories currently registered\n\n" << std::left;
82 o << setw(w) <<
"Operator name" <<
"Operator type" << std::endl;
83 o << setw(w) <<
"-------------" <<
"-------------" << std::endl;
84 for(
typename op_factories_t::const_iterator itr = op_factories_.begin(); itr != op_factories_.end(); ++itr ) {
85 o << setw(w) << itr->first <<
typeName(*itr->second->create()) << std::endl;
92 #endif // RTOP_SERVER_HPP
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< Teuchos::AbstractFactory< RTOpPack::RTOpT< Scalar > > > get_op_factory(const char op_name[]) const
Get an operator factory given the name of the operator.
void add_op_factory(const Teuchos::RCP< Teuchos::AbstractFactory< RTOpPack::RTOpT< Scalar > > > &op_factory)
Add a new abstract factory for an RTOpT operator.
void print_op_factories(std::ostream &o) const
Print out all of the operator factories that have been added.
std::string typeName(const T &t)