47 #ifndef __Teko_RequestHandler_impl_hpp__
48 #define __Teko_RequestHandler_impl_hpp__
50 template <
typename DataT>
51 DataT RequestHandler::request(
const RequestMesg & rd)
const
54 using Teuchos::rcp_dynamic_cast;
57 typedef RequestCallback<DataT> CallbackT;
60 std::vector<RCP<RequestCallbackBase> >::iterator itr;
61 for(itr=callbacks_.begin();itr!=callbacks_.end();++itr) {
62 RCP<CallbackT> cb = rcp_dynamic_cast<CallbackT>(*itr);
69 if(cb->handlesRequest(rd))
70 return cb->request(rd);
73 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::runtime_error,
74 "RequestHandler::request could not find appropriate callback: " << rd);
77 template <
typename DataT>
78 void RequestHandler::preRequest(
const RequestMesg & rd)
const
81 using Teuchos::rcp_dynamic_cast;
84 typedef RequestCallback<DataT> CallbackT;
87 std::vector<RCP<RequestCallbackBase> >::iterator itr;
88 for(itr=callbacks_.begin();itr!=callbacks_.end();++itr) {
89 RCP<CallbackT> cb = rcp_dynamic_cast<CallbackT>(*itr);
96 if(cb->handlesRequest(rd))
97 return cb->preRequest(rd);
100 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::runtime_error,
101 "RequestHandler::preRequest could not find appropriate callback: " << rd);