MADARA  3.1.8
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 
18 #include "ace/High_Res_Timer.h"
19 
22 #include "madara/utility/stdint.h"
23 #include "madara/MADARA_export.h"
27 
28 #include "AggregateFilter.h"
29 
30 namespace madara
31 {
32  namespace filters
33  {
37  class MADARA_Export CounterFilter : public AggregateFilter
38  {
39  public:
43  CounterFilter ();
44 
48  virtual ~CounterFilter ();
49 
56  virtual void filter (knowledge::KnowledgeMap & records,
57  const transport::TransportContext & transport_context,
58  knowledge::Variables & vars);
59 
64  inline knowledge::KnowledgeRecord::Integer get_count ();
65 
71  inline knowledge::KnowledgeRecord::Integer get_elapsed ();
72 
77  inline double get_throughput ();
78 
79  protected:
80 
85 
90 
95 
100  };
101  }
102 }
103 
104 #include "CounterFilter.inl"
105 
106 #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:99
knowledge::KnowledgeRecord::Integer first_message_
The time to keep record of a peer.
Definition: CounterFilter.h:94
Provides context about the transport.
Filter for discovering neighboring peers.
Definition: CounterFilter.h:37
bool initialized_
Tracks if the first timer has been initialized.
Definition: CounterFilter.h:84
::std::map< std::string, KnowledgeRecord > KnowledgeMap
knowledge::KnowledgeRecord::Integer packets_
A map of discovered peers.
Definition: CounterFilter.h:89
Copyright (c) 2015 Carnegie Mellon University.
Provides an interface for external functions into the MADARA KaRL variable settings.