client-cpp  0.8.1
ILogStorage.hpp
Go to the documentation of this file.
1 
17 #ifndef ILOGSTORAGE_HPP_
18 #define ILOGSTORAGE_HPP_
19 
20 #include <memory>
21 #include <cstdint>
22 
23 #include "kaa/log/BucketInfo.hpp"
24 #include "kaa/log/LogBucket.hpp"
25 
26 namespace kaa {
27 
28 class LogRecord;
29 class ILogStorageStatus;
30 
40 class ILogStorage {
41 public:
50  virtual BucketInfo addLogRecord(LogRecord&& record) = 0;
51 
58  virtual ILogStorageStatus& getStatus() = 0;
59 
66  virtual LogBucket getNextBucket() = 0;
67 
75  virtual void removeBucket(std::int32_t bucketId) = 0;
76 
85  virtual void rollbackBucket(std::int32_t bucketId) = 0;
86 
87  virtual ~ILogStorage() {}
88 };
89 
93 typedef std::shared_ptr<ILogStorage> ILogStoragePtr;
94 
95 } // namespace kaa
96 
97 #endif /* ILOGSTORAGE_HPP_ */
virtual ILogStorageStatus & getStatus()=0
Returns a log storage status.
The helper class which is used to transfer logs from LogStorage to LogCollector.
Definition: LogBucket.hpp:33
virtual BucketInfo addLogRecord(LogRecord &&record)=0
Persists a log record.
virtual ~ILogStorage()
Definition: ILogStorage.hpp:87
virtual void rollbackBucket(std::int32_t bucketId)=0
Tells a log storage to consider a log bucket as unused, i.e. a log bucket will be accessible again vi...
std::shared_ptr< ILogStorage > ILogStoragePtr
Definition: ILogStorage.hpp:93
virtual void removeBucket(std::int32_t bucketId)=0
Tells a log storage to remove a log bucket.
Describes a unique log bucket.
Definition: BucketInfo.hpp:31
Interface of a log storage.
Definition: ILogStorage.hpp:40
virtual LogBucket getNextBucket()=0
Returns a new log bucket.
The public interface to represent the current log storage state.