client-cpp  0.0.1-SNAPSHOT
ILogStorage.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 ILOGSTORAGE_HPP_
18 #define ILOGSTORAGE_HPP_
19 
20 #include "kaa/log/LogRecord.hpp"
21 #include <list>
22 #include <boost/smart_ptr/shared_ptr.hpp>
23 
24 namespace kaa {
25 
32 class ILogStorage {
33 public:
34  typedef std::list<LogRecord> container_type;
35 
39  virtual void addLogRecord(const LogRecord & record) = 0;
40 
48  virtual container_type getRecordBlock(size_t blockSize, const std::string& blockId) = 0;
49 
55  virtual void removeRecordBlock(const std::string& blockId) = 0;
56 
62  virtual void notifyUploadFailed(const std::string& blockId) = 0;
63 
67  virtual void removeOldestRecords(size_t allowedVolume) = 0;
68 
69  virtual ~ILogStorage() {}
70 };
71 
72 typedef boost::shared_ptr<ILogStorage> LogStoragePtr;
73 
74 } // namespace kaa
75 
76 
77 #endif /* ILOGSTORAGE_HPP_ */
virtual void removeOldestRecords(size_t allowedVolume)=0
virtual container_type getRecordBlock(size_t blockSize, const std::string &blockId)=0
std::list< LogRecord > container_type
Definition: ILogStorage.hpp:34
virtual ~ILogStorage()
Definition: ILogStorage.hpp:69
virtual void notifyUploadFailed(const std::string &blockId)=0
virtual void removeRecordBlock(const std::string &blockId)=0
boost::shared_ptr< ILogStorage > LogStoragePtr
Definition: ILogStorage.hpp:72
virtual void addLogRecord(const LogRecord &record)=0