MADARA  3.2.3
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:
45  const std::string & prefix = ".endpoints");
46 
50  virtual ~EndpointClear ();
51 
56  void add_trusted_originator (
57  const std::vector <std::string> & originators);
58 
63  void add_trusted_originator (const std::string & originator);
64 
70  void clear_trusted_originators (void);
71 
76  void set_prefix (const std::string & prefix);
77 
84  virtual void filter (knowledge::KnowledgeMap & records,
85  const transport::TransportContext & transport_context,
86  knowledge::Variables & vars);
87 
88  protected:
89 
94 
99 
103  std::map <std::string, bool> trusted_originators_;
104 
109  };
110  }
111 }
112 
113 #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:37
knowledge::containers::Map endpoints_
A map of discovered peers.
Provides context about the transport.
static struct madara::knowledge::tags::string_t string
This class stores a map of strings to KaRL variables.
Definition: Map.h:32
::std::map< std::string, KnowledgeRecord > KnowledgeMap
std::map< std::string, bool > trusted_originators_
originators that are trusted to prompt a clear of endpoints
bool initialized_
Tracks if the peers_ map has been initialized.
Definition: EndpointClear.h:93
Copyright (c) 2015 Carnegie Mellon University.
std::string prefix_
The context.
Definition: EndpointClear.h:98
Provides an interface for external functions into the MADARA KaRL variable settings.