MADARA  3.1.8
PacketScheduler.h
Go to the documentation of this file.
1 
2 
3 #ifndef _MADARA_PACKET_SCHEDULER_H_
4 #define _MADARA_PACKET_SCHEDULER_H_
5 
14 #include <deque>
15 #include <queue>
16 #include <time.h>
17 
18 #include "madara/LockType.h"
19 #include "madara/utility/stdint.h"
20 #include "ace/Guard_T.h"
21 #include "ace/Recursive_Thread_Mutex.h"
22 #include "madara/MADARA_export.h"
24 
25 class StrideTask;
26 
27 namespace madara
28 {
29  namespace transport
30  {
36  class MADARA_Export PacketScheduler
37  {
38  public:
42  PacketScheduler (const QoSTransportSettings * settings = 0);
43 
48  PacketScheduler (const PacketScheduler & rhs);
49 
53  virtual ~PacketScheduler ();
54 
59  void operator= (const PacketScheduler & rhs);
60 
65  bool add (void);
66 
71  void attach (const QoSTransportSettings * settings);
72 
78  uint64_t get_dropped (void);
79 
85  uint64_t get_sent (void);
86 
87 
91  void clear (void);
92 
96  void reset (void);
97 
104  void print_status (unsigned int log_level = 0,
105  const char * prefix = "PacketScheduler");
106 
107  protected:
108 
112  mutable MADARA_LOCK_TYPE mutex_;
113 
118 
122  uint64_t sent_messages_;
123 
128 
133 
137  std::priority_queue <StrideTask, std::vector <StrideTask> > queue_;
138  };
139  }
140 }
141 
142 #endif // _MADARA_PACKET_SCHEDULER_H_
std::priority_queue< StrideTask, std::vector< StrideTask > > queue_
queue used by stride scheduling algorithm
uint64_t consecutive_drops_
Consecutive dropped messages.
Provides scheduler for dropping packets.
const QoSTransportSettings * settings_
Transport settings.
uint64_t dropped_messages_
Number of dropped messages.
MADARA_LOCK_TYPE mutex_
Mutex for supporting multithreaded monitor calls.
Container for quality-of-service settings.
Copyright (c) 2015 Carnegie Mellon University.
INTERNAL USE: Task that can be added to a Stride scheduler
uint64_t sent_messages_
Number of sent messages.