Teko  Version of the Day
 All Classes Files Functions Variables Pages
Teko_RequestHandler.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Teko: A package for block and physics based preconditioning
4 //
5 // Copyright 2010 NTESS and the Teko contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef __Teko_RequestHandler_hpp__
11 #define __Teko_RequestHandler_hpp__
12 
13 #include <vector>
14 
15 #include "Teko_RequestCallback.hpp"
16 
17 #include "Teuchos_RCP.hpp"
18 
19 namespace Teko {
20 
33  public:
34  explicit RequestHandler();
35 
40  void addRequestCallback(const Teuchos::RCP<RequestCallbackBase> &callback);
41 
46  template <typename DataT>
47  DataT request(const RequestMesg &rm) const;
48 
53  template <typename DataT>
54  inline DataT request(const std::string &rm) const {
55  return request<DataT>(RequestMesg(rm));
56  }
57 
65  template <typename DataT>
66  void preRequest(const RequestMesg &rm) const;
67 
75  template <typename DataT>
76  inline void preRequest(const std::string &rm) const {
77  preRequest<DataT>(RequestMesg(rm));
78  }
79 
80  private:
81  // stores the callbacks to be used by this handler.
82  mutable std::vector<Teuchos::RCP<RequestCallbackBase> > callbacks_;
83 
84  // hidden from the user
85  RequestHandler(const RequestHandler &rh);
86  RequestHandler &operator=(const RequestHandler &);
87  const RequestHandler &operator=(const RequestHandler &) const;
88 };
89 
90 #include "Teko_RequestHandler_impl.hpp"
91 
92 } // namespace Teko
93 
94 #endif
void preRequest(const RequestMesg &rm) const
void addRequestCallback(const Teuchos::RCP< RequestCallbackBase > &callback)
DataT request(const RequestMesg &rm) const
DataT request(const std::string &rm) const
void preRequest(const std::string &rm) const