client-cpp  0.8.1
LogBucket.hpp
Go to the documentation of this file.
1 
17 #ifndef LOGBUCKET_HPP_
18 #define LOGBUCKET_HPP_
19 
20 #include <list>
21 #include <cstdint>
22 #include <utility>
23 
24 #include "kaa/log/LogRecord.hpp"
25 
26 namespace kaa {
27 
33 class LogBucket {
34 public:
35 
39  LogBucket() {}
40 
47  LogBucket(std::int32_t id, std::list<LogRecord>&& records)
48  : id_(id), logRecords_(std::move(records)) { }
49 
56  LogBucket(std::int32_t id, const std::list<LogRecord>& records)
57  : id_(id), logRecords_(records) { }
58 
66  std::int32_t getBucketId() const {
67  return id_;
68  }
69 
75  std::list<LogRecord>& getRecords() {
76  return logRecords_;
77  }
78 
79 private:
80  std::int32_t id_ = 0;
81  std::list<LogRecord> logRecords_;
82 };
83 
84 } /* namespace kaa */
85 
86 #endif /* LOGBUCKET_HPP_ */
The helper class which is used to transfer logs from LogStorage to LogCollector.
Definition: LogBucket.hpp:33
std::list< LogRecord > & getRecords()
Returns log records of the bucket.
Definition: LogBucket.hpp:75
LogBucket(std::int32_t id, const std::list< LogRecord > &records)
Constructs LogBucket object.
Definition: LogBucket.hpp:56
LogBucket(std::int32_t id, std::list< LogRecord > &&records)
Constructs LogBucket object.
Definition: LogBucket.hpp:47
LogBucket()
Constructs empty LogBucket object.
Definition: LogBucket.hpp:39
std::int32_t getBucketId() const
Returns a log bucket id.
Definition: LogBucket.hpp:66