client-cpp  0.0.1-SNAPSHOT
DefaultLogUploadConfiguration.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 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 DEFAULTLOGUPLOADCONFIGURATION_HPP_
18 #define DEFAULTLOGUPLOADCONFIGURATION_HPP_
19 
21 
22 namespace kaa {
23 
25 public:
27  : blockSize_(DEFAULT_BLOCK_SIZE)
28  , maxStorageVolume_(DEFAULT_MAX_STORAGE_VOLUME)
29  , volumeThreshold_(DEFAULT_VOLUME_THRESHOLD) {}
30 
31  DefaultLogUploadConfiguration(size_t blockSize, size_t maxStorageVolume, size_t volumeThreshold)
32  : blockSize_(blockSize)
33  , maxStorageVolume_(maxStorageVolume)
34  , volumeThreshold_(volumeThreshold) {}
35 
36  size_t getBlockSize() const { return blockSize_; }
37  size_t getMaxStorageVolume() const { return maxStorageVolume_; }
38  size_t getVolumeThreshold() const { return volumeThreshold_; }
39 
40 private:
41  size_t blockSize_;
42  size_t maxStorageVolume_;
43  size_t volumeThreshold_;
44 
45  static const size_t DEFAULT_BLOCK_SIZE = 8192; //8 Kb
46  static const size_t DEFAULT_MAX_STORAGE_VOLUME = 1024*1024; //1 Mb
47  static const size_t DEFAULT_VOLUME_THRESHOLD = DEFAULT_BLOCK_SIZE * 4; // 32 Kb
48 };
49 
50 } // namespace kaa
51 
52 #endif /* DEFAULTLOGUPLOADCONFIGURATION_HPP_ */
DefaultLogUploadConfiguration(size_t blockSize, size_t maxStorageVolume, size_t volumeThreshold)