MADARA  3.4.1
CounterFilter.h
Go to the documentation of this file.
1 
2 
3 #ifndef _MADARA_FILTERS_COUNTER_FILTER_H_
4 #define _MADARA_FILTERS_COUNTER_FILTER_H_
5 
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include <list>
17 
20 #include "madara/utility/StdInt.h"
21 #include "madara/MadaraExport.h"
25 
26 #include "AggregateFilter.h"
27 
28 namespace madara
29 {
30 namespace filters
31 {
35 class MADARA_EXPORT CounterFilter : public AggregateFilter
36 {
37 public:
41  CounterFilter();
42 
46  virtual ~CounterFilter();
47 
54  virtual void filter(knowledge::KnowledgeMap& records,
55  const transport::TransportContext& transport_context,
56  knowledge::Variables& vars);
57 
62  inline knowledge::KnowledgeRecord::Integer get_count();
63 
69  inline knowledge::KnowledgeRecord::Integer get_elapsed();
70 
75  inline double get_throughput();
76 
77 protected:
82 
87 
92 
97 };
98 }
99 }
100 
101 #include "CounterFilter.inl"
102 
103 #endif // _MADARA_FILTERS_COUNTER_FILTER_H_
Abstract base class for implementing aggregate record filters via a functor interface.
Filter for discovering neighboring peers.
Definition: CounterFilter.h:36
knowledge::KnowledgeRecord::Integer first_message_
The time to keep record of a peer.
Definition: CounterFilter.h:91
knowledge::KnowledgeRecord::Integer packets_
A map of discovered peers.
Definition: CounterFilter.h:86
bool initialized_
Tracks if the first timer has been initialized.
Definition: CounterFilter.h:81
knowledge::KnowledgeRecord::Integer last_message_
The time of the last clear of the peer_list.
Definition: CounterFilter.h:96
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition: Variables.h:53
Provides context about the transport.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
Copyright(c) 2020 Galois.