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