client-cpp  0.0.1-SNAPSHOT
kaa::MemoryLogStorage Class Reference

#include <MemoryLogStorage.hpp>

+ Inheritance diagram for kaa::MemoryLogStorage:
+ Collaboration diagram for kaa::MemoryLogStorage:

Public Member Functions

 MemoryLogStorage (size_t blockSize)
 
 ~MemoryLogStorage ()
 
void addLogRecord (const LogRecord &record)
 
container_type getRecordBlock (size_t blockSize, const std::string &blockId)
 
void removeRecordBlock (const std::string &blockId)
 
void notifyUploadFailed (const std::string &blockId)
 
void removeOldestRecords (size_t allowedVolume)
 
size_t getConsumedVolume () const
 
size_t getRecordsCount () const
 
- Public Member Functions inherited from kaa::ILogStorage
virtual ~ILogStorage ()
 
- Public Member Functions inherited from kaa::ILogStorageStatus
virtual ~ILogStorageStatus ()
 

Additional Inherited Members

- Public Types inherited from kaa::ILogStorage
typedef std::list< LogRecordcontainer_type
 

Detailed Description

Default ILogStorage implementation.

Log records are stored in memory. After application restarts logs will be purged.

Definition at line 33 of file MemoryLogStorage.hpp.

Constructor & Destructor Documentation

kaa::MemoryLogStorage::MemoryLogStorage ( size_t  blockSize)
inline

Definition at line 51 of file MemoryLogStorage.hpp.

kaa::MemoryLogStorage::~MemoryLogStorage ( )
inline

Definition at line 57 of file MemoryLogStorage.hpp.

Member Function Documentation

void kaa::MemoryLogStorage::addLogRecord ( const LogRecord record)
virtual

ILogStorage public interface implementation

Implements kaa::ILogStorage.

size_t kaa::MemoryLogStorage::getConsumedVolume ( ) const
virtual

ILogStorageStatus public interface implementation

Implements kaa::ILogStorageStatus.

container_type kaa::MemoryLogStorage::getRecordBlock ( size_t  blockSize,
const std::string &  blockId 
)
virtual

Returns record block of given size

Parameters
blockSizeSize of a log record block
blockIdUnique identifier of the log record block.
Returns
Container of records

Implements kaa::ILogStorage.

size_t kaa::MemoryLogStorage::getRecordsCount ( ) const
virtual

Returns amount of stored records.

Returns
Amount of stored records

Implements kaa::ILogStorageStatus.

void kaa::MemoryLogStorage::notifyUploadFailed ( const std::string &  blockId)
virtual

Called when log block upload failed.

Parameters
blockIdUnique identifier of the log block.

Implements kaa::ILogStorage.

void kaa::MemoryLogStorage::removeOldestRecords ( size_t  allowedVolume)
virtual

Shrink storage to fit allowed volume size.

Implements kaa::ILogStorage.

void kaa::MemoryLogStorage::removeRecordBlock ( const std::string &  blockId)
virtual

Called when log block was successfully uploaded.

Parameters
blockIdUnique identifier of the log block.

Implements kaa::ILogStorage.


The documentation for this class was generated from the following file: