client-cpp  0.10.0
RecordInfo.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef RECORDINFO_HPP_
18 #define RECORDINFO_HPP_
19 
20 #include <cstdint>
21 
22 #include "kaa/log/BucketInfo.hpp"
23 #include "kaa/utils/TimeUtils.hpp"
24 
25 namespace kaa {
26 
30 class RecordInfo {
31 public:
38  return bucketInfo_;
39  }
40 
41  void setBucketInfo(const BucketInfo& bucketInfo) {
42  bucketInfo_ = bucketInfo;
43  }
44 
50  std::size_t getRecordAddedTimestampMs() const {
51  return recordAddedTimestampMs_;
52  }
53 
54  void setRecordAddedTimestampMs(std::size_t recordAddedTimestampMs) {
55  recordAddedTimestampMs_ = recordAddedTimestampMs;
56  }
57 
63  std::size_t getRecordDeliveryTimeMs() const {
64  return recordDeliveryTimeMs_;
65  }
66 
67  void setRecordDeliveryTimeMs(std::size_t recordDeliveryTimeMs) {
68  recordDeliveryTimeMs_ = recordDeliveryTimeMs;
69  }
70 
71 private:
72  BucketInfo bucketInfo_;
73  std::size_t recordAddedTimestampMs_ = TimeUtils::getCurrentTimeInMs();
74  std::size_t recordDeliveryTimeMs_ = 0;
75 
76 };
77 
78 } /* namespace kaa */
79 
80 #endif /* RECORDINFO_HPP_ */
static std::size_t getCurrentTimeInMs()
Definition: TimeUtils.hpp:26
void setRecordAddedTimestampMs(std::size_t recordAddedTimestampMs)
Definition: RecordInfo.hpp:54
std::size_t getRecordAddedTimestampMs() const
Returns the timestamp indicating when log record was scheduled for delivery.
Definition: RecordInfo.hpp:50
void setBucketInfo(const BucketInfo &bucketInfo)
Definition: RecordInfo.hpp:41
std::size_t getRecordDeliveryTimeMs() const
Returns the total spent time to deliver log record in milliseconds.
Definition: RecordInfo.hpp:63
Describes unique log record delivery info.
Definition: RecordInfo.hpp:30
BucketInfo getBucketInfo() const
Returns the parent bucket.
Definition: RecordInfo.hpp:37
void setRecordDeliveryTimeMs(std::size_t recordDeliveryTimeMs)
Definition: RecordInfo.hpp:67
Describes a unique log bucket.
Definition: BucketInfo.hpp:31