client-cpp  0.9.0
BucketInfo.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 BUCKETINFO_HPP_
18 #define BUCKETINFO_HPP_
19 
20 #include <cstdint>
21 
22 namespace kaa {
23 
31 class BucketInfo {
32 public:
37 
44  BucketInfo(std::int32_t bucketId, std::size_t logCount)
45  : bucketId_(bucketId), logCount_(logCount) {}
46 
54  std::int32_t getBucketId() const {
55  return bucketId_;
56  }
57 
61  std::size_t getLogCount() const {
62  return logCount_;
63  }
64 
65  bool operator<(const BucketInfo& info) const {
66  return bucketId_ < info.bucketId_;
67  }
68 
69  bool operator==(const BucketInfo& info) const {
70  return bucketId_ == info.bucketId_;
71  }
72 
73  bool operator!=(const BucketInfo& info) const {
74  return bucketId_ != info.bucketId_;
75  }
76 
77 private:
78  std::int32_t bucketId_ = 0;
79  std::size_t logCount_ = 0;
80 };
81 } /* namespace kaa */
82 
83 #endif /* BUCKETINFO_HPP_ */
bool operator<(const BucketInfo &info) const
Definition: BucketInfo.hpp:65
BucketInfo()
Constructs an empty BucketInfo object.
Definition: BucketInfo.hpp:36
bool operator==(const BucketInfo &info) const
Definition: BucketInfo.hpp:69
bool operator!=(const BucketInfo &info) const
Definition: BucketInfo.hpp:73
std::int32_t getBucketId() const
Returns the id of a bucket.
Definition: BucketInfo.hpp:54
BucketInfo(std::int32_t bucketId, std::size_t logCount)
Constructs the BucketInfo object which contains a useful information about a log bucket.
Definition: BucketInfo.hpp:44
Describes a unique log bucket.
Definition: BucketInfo.hpp:31
std::size_t getLogCount() const
Definition: BucketInfo.hpp:61