Remote Call Framework 3.3
FilterService.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2022, Delta V Software. All rights reserved.
6 // https://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF under GPL terms.
12 //
13 // Version: 3.3
14 // Contact: support <at> deltavsoft.com
15 //
16 //******************************************************************************
17 
18 #ifndef INCLUDE_RCF_FILTERSERVICE_HPP
19 #define INCLUDE_RCF_FILTERSERVICE_HPP
20 
21 #include <map>
22 
23 #include <memory>
24 
25 #include <RCF/Filter.hpp>
26 #include <RCF/Export.hpp>
27 #include <RCF/Service.hpp>
28 #include <RCF/Tools.hpp>
29 
30 namespace RCF {
31 
32  class Session;
33  class RcfSession;
34 
35  class RCF_EXPORT FilterService :
36  public I_Service,
37  Noncopyable
38  {
39  public:
40  FilterService();
41 
42  void addFilterFactory(FilterFactoryPtr filterFactoryPtr);
43 
44  void addFilterFactory(
45  FilterFactoryPtr filterFactoryPtr,
46  const std::vector<int> &filterIds);
47 
48  std::int32_t RequestTransportFilters(const std::vector<std::int32_t> &filterIds);
49 
50  // No longer supported. Just a stub to return an error message.
51  std::int32_t QueryForTransportFilters(const std::vector<std::int32_t> &filterIds);
52 
53  FilterFactoryPtr getFilterFactoryPtr(int filterId);
54 
55  private:
56  void setTransportFilters(
57  RcfSession &session,
58  std::shared_ptr<std::vector<FilterPtr> > filters);
59 
60  void onServerStart(RcfServer &server);
61  void onServerStop(RcfServer &server);
62 
63  typedef std::map<int, FilterFactoryPtr> FilterFactoryMap;
64  FilterFactoryMap mFilterFactoryMap;
65  ReadWriteMutex mFilterFactoryMapMutex;
66  };
67 
68  typedef std::shared_ptr<FilterService> FilterServicePtr;
69 
70 } // namespace RCF
71 
72 #endif // ! INCLUDE_RCF_FILTERSERVICE_HPP
Definition: AmiIoHandler.hpp:23