11 #ifndef RTOP_SERVER_HPP
12 #define RTOP_SERVER_HPP
18 #include "RTOpPack_RTOpServerDecl.hpp"
22 template<
class Scalar>
28 op_factories_[op_factory->create()->op_name()] = op_factory;
31 template<
class Scalar>
35 typename op_factories_t::const_iterator itr = op_factories_.find(op_name);
37 itr == op_factories_.end(), std::logic_error
38 ,
"RTOpServer<Scalar>::get_op_factory(...): Error, an operator factory with the "
39 "operator name \'" << op_name <<
"\' does not exist!"
44 template<
class Scalar>
49 o <<
"\nRTOpServer<Scalar>::print_op_factories(...): RTOp operator factories currently registered\n\n" << std::left;
50 o << setw(w) <<
"Operator name" <<
"Operator type" << std::endl;
51 o << setw(w) <<
"-------------" <<
"-------------" << std::endl;
52 for(
typename op_factories_t::const_iterator itr = op_factories_.begin(); itr != op_factories_.end(); ++itr ) {
53 o << setw(w) << itr->first <<
typeName(*itr->second->create()) << std::endl;
60 #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)