MADARA  3.2.3
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:
78 
83 
88 
93 
98  };
99  }
100 }
101 
102 #include "CounterFilter.inl"
103 
104 #endif // _MADARA_FILTERS_COUNTER_FILTER_H_
Abstract base class for implementing aggregate record filters via a functor interface.
knowledge::KnowledgeRecord::Integer last_message_
The time of the last clear of the peer_list.
Definition: CounterFilter.h:97
knowledge::KnowledgeRecord::Integer first_message_
The time to keep record of a peer.
Definition: CounterFilter.h:92
Provides context about the transport.
Filter for discovering neighboring peers.
Definition: CounterFilter.h:35
bool initialized_
Tracks if the first timer has been initialized.
Definition: CounterFilter.h:82
::std::map< std::string, KnowledgeRecord > KnowledgeMap
knowledge::KnowledgeRecord::Integer packets_
A map of discovered peers.
Definition: CounterFilter.h:87
Copyright (c) 2015 Carnegie Mellon University.
Provides an interface for external functions into the MADARA KaRL variable settings.