libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

Log Class Reference

Log Class Reference

Raft log. More...

#include <log.hpp>

Public Member Functions

int append (const Entry &entry)
 This method invokes storage IO.
int removeEntriesWhereIndexGreaterOrEqual (Index index)
 This method invokes storage IO.
const Entry * getEntryAtIndex (Index index) const
 Returns nullptr if there's no such index.

Detailed Description

Raft log.

This class transparently replicates its state to the storage backend, keeping the most recent state in memory. Writes are slow, reads are instantaneous.

Definition at line 25 of file log.hpp.


Member Function Documentation

int append ( const Entry &  entry )

This method invokes storage IO.

Returned value indicates whether the entry was successfully appended.

Definition at line 202 of file log.hpp.

const Entry* getEntryAtIndex ( Index  index ) const

Returns nullptr if there's no such index.

This method does not use storage IO.

Definition at line 285 of file log.hpp.

int removeEntriesWhereIndexGreaterOrEqual ( Index  index )

This method invokes storage IO.

Returned value indicates whether the requested operation has been carried out successfully.

Definition at line 242 of file log.hpp.