MADARA  3.4.1
EndpointClear.h
Go to the documentation of this file.
1 
2 
3 #ifndef _MADARA_FILTERS_ENDPOINT_CLEAR_H_
4 #define _MADARA_FILTERS_ENDPOINT_CLEAR_H_
5 
15 #include <string>
16 #include <vector>
17 #include <map>
18 #include <list>
21 #include "madara/utility/StdInt.h"
22 #include "madara/MadaraExport.h"
26 
27 #include "AggregateFilter.h"
28 
29 namespace madara
30 {
31 namespace filters
32 {
37 class MADARA_EXPORT EndpointClear : public AggregateFilter
38 {
39 public:
44  EndpointClear(const std::string& prefix = ".endpoints");
45 
49  virtual ~EndpointClear();
50 
55  void add_trusted_originator(const std::vector<std::string>& originators);
56 
61  void add_trusted_originator(const std::string& originator);
62 
68  void clear_trusted_originators(void);
69 
74  void set_prefix(const std::string& prefix);
75 
82  virtual void filter(knowledge::KnowledgeMap& records,
83  const transport::TransportContext& transport_context,
84  knowledge::Variables& vars);
85 
86 protected:
91 
96 
100  std::map<std::string, bool> trusted_originators_;
101 
106 };
107 }
108 }
109 
110 #endif // _MADARA_FILTERS_ENDPOINT_CLEAR_H_
Abstract base class for implementing aggregate record filters via a functor interface.
Filter for deleting endpoints, usually when new endpoints have been discovered.
Definition: EndpointClear.h:38
knowledge::containers::Map endpoints_
A map of discovered peers.
bool initialized_
Tracks if the peers_ map has been initialized.
Definition: EndpointClear.h:90
std::string prefix_
The context.
Definition: EndpointClear.h:95
std::map< std::string, bool > trusted_originators_
originators that are trusted to prompt a clear of endpoints
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition: Variables.h:53
This class stores a map of strings to KaRL variables.
Definition: Map.h:33
Provides context about the transport.
constexpr string_t string
::std::map< std::string, KnowledgeRecord > KnowledgeMap
Copyright(c) 2020 Galois.