hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ClientWorkerItem.hpp
Go to the documentation of this file.
1 
15 #ifndef CLIENT_WORKER_ITEM_HPP
16 #define CLIENT_WORKER_ITEM_HPP
17 
18 #include <iostream>
19 #include <vector>
20 #include <deque>
21 
22 #include "Dictionary.hpp"
23 
24 namespace HCE
25 {
26 namespace handlers
27 {
28 //-----------------------------------------------------------------------------
30 {
31 public:
32  TimeoutShiftCounter(void);
33 
36 
37  void reset(void);
38  void responceTimeStamp(size_t rtimestamp);
39  void recount(unsigned int timeout);
40 
41  size_t getRcounter(void) const {return rcounter;}
42  size_t getRdiff(void) const {return rdiff;}
43  unsigned int getShift(void) const {return shift;}
44  private:
45  size_t rcounter;
46  size_t rdiff;
47  unsigned int shift;
48 };
49 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 typedef std::deque<ResourceUsageData> ResourceUsageCollection;
53 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
55 typedef struct ClientWorkerItem
56 {
57  ClientWorkerItem(void);
58  explicit ClientWorkerItem(const std::string& identity_, int64_t expiry_=0, unsigned long long frequency_=0, unsigned long long count_=0);
59  ClientWorkerItem(const ClientWorkerItem& rhs);
60  ClientWorkerItem(ClientWorkerItem&& rhs);
61 
62  ClientWorkerItem& operator=(const ClientWorkerItem& rhs);
63  ClientWorkerItem& operator=(ClientWorkerItem&& rhs);
64 
65  void clear(void);
66 
67  static bool sortByFrequencyPredicate(const ClientWorkerItem& d1, const ClientWorkerItem& d2);
68 
69  std::string identity;
70  int64_t expiry;
71  unsigned long long frequency;
72  unsigned long long count;
73  std::vector<ClientWorkerItem> route;
75  size_t rtimestamp;
77  std::string property;
78  double cpu;
79  double iowait;
80 
82 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 } // end namespace handlers
85 } // end namespace HCE
86 
87 #endif // CLIENT_WORKER_ITEM_HPP