10 #ifndef __Teko_RequestHandler_impl_hpp__
11 #define __Teko_RequestHandler_impl_hpp__
13 template <
typename DataT>
14 DataT RequestHandler::request(
const RequestMesg& rd)
const {
16 using Teuchos::rcp_dynamic_cast;
19 typedef RequestCallback<DataT> CallbackT;
22 std::vector<RCP<RequestCallbackBase> >::iterator itr;
23 for (itr = callbacks_.begin(); itr != callbacks_.end(); ++itr) {
24 RCP<CallbackT> cb = rcp_dynamic_cast<CallbackT>(*itr);
27 if (cb == Teuchos::null)
continue;
30 if (cb->handlesRequest(rd))
return cb->request(rd);
33 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::runtime_error,
34 "RequestHandler::request could not find appropriate callback: " << rd);
37 template <
typename DataT>
38 void RequestHandler::preRequest(
const RequestMesg& rd)
const {
40 using Teuchos::rcp_dynamic_cast;
43 typedef RequestCallback<DataT> CallbackT;
46 std::vector<RCP<RequestCallbackBase> >::iterator itr;
47 for (itr = callbacks_.begin(); itr != callbacks_.end(); ++itr) {
48 RCP<CallbackT> cb = rcp_dynamic_cast<CallbackT>(*itr);
51 if (cb == Teuchos::null)
continue;
54 if (cb->handlesRequest(rd))
return cb->preRequest(rd);
57 TEUCHOS_TEST_FOR_EXCEPTION(
58 true, std::runtime_error,
59 "RequestHandler::preRequest could not find appropriate callback: " << rd);