Skip to content
«interface»SolidSyslogStoreBlockStoreCoreNullStoreCore · no-opSolidSyslogCore

Struct SolidSyslogStore

ClassList > SolidSyslogStore

  • #include <SolidSyslogStoreDefinition.h>
struct SolidSyslogStore
{
    enum SolidSyslogStoreWriteResult (*Write)(struct SolidSyslogStore* base, const void* data, size_t size);
    bool (*ReadNextUnsent)(struct SolidSyslogStore* base, void* data, size_t maxSize, size_t* bytesRead);
    void (*MarkSent)(struct SolidSyslogStore* base);
    bool (*HasUnsent)(struct SolidSyslogStore* base);
    size_t (*GetTotalBytes)(struct SolidSyslogStore* base);
    size_t (*GetUsedBytes)(struct SolidSyslogStore* base);
    bool (*IsTransient)(struct SolidSyslogStore* base);
};

Detailed Description

Store-and-forward vtable.

The Service loop is the only reader: it drains the buffer through Write, then repeatedly ReadNextUnsent / MarkSent as the sender accepts records. ReadNextUnsent and MarkSent form a single read cursor (see below); they are not safe to interleave from two contexts.

Public Attributes Documentation

GetTotalBytes

Configured capacity, for integrator capacity queries.

size_t(* SolidSyslogStore::GetTotalBytes) (struct SolidSyslogStore *base);


GetUsedBytes

Bytes currently occupied by retained records.

size_t(* SolidSyslogStore::GetUsedBytes) (struct SolidSyslogStore *base);


HasUnsent

bool(* SolidSyslogStore::HasUnsent) (struct SolidSyslogStore *base);

IsTransient

True when the store never retains anything (e.g.

bool(* SolidSyslogStore::IsTransient) (struct SolidSyslogStore *base);

NullStore), so a Write rejection means "I never had it, please try the sender." False for stores that actually retain records, where a rejection is the discard policy speaking and the message must NOT bypass older records via a direct-send fallback. Service consults this after a failed Write to decide whether to fall through. It asks after every rejected Write, so a store that stops retaining - a BlockStore whose device failed - answers true from then on.


MarkSent

Mark the record from the last ReadNextUnsent sent and advance the cursor.

void(* SolidSyslogStore::MarkSent) (struct SolidSyslogStore *base);

A no-op with no preceding successful read, so on a send failure the caller skips this and the same record is re-read next pass.


ReadNextUnsent

Copy the oldest unsent record into data (up tomaxSize , over-long records truncated), setbytesRead , and position the cursor on it for a following MarkSent.

bool(* SolidSyslogStore::ReadNextUnsent) (struct SolidSyslogStore *base, void *data, size_t maxSize, size_t *bytesRead);

Does not consume the record, a repeat call re-reads the same one until MarkSent advances past it. False with bytesRead 0 means nothing unsent.


Write

Take a copy of data (size bytes) as an unsent record, and say what became of it.

enum SolidSyslogStoreWriteResult(* SolidSyslogStore::Write) (struct SolidSyslogStore *base, const void *data, size_t size);

A record of no bytes is never retained, since ReadNextUnsent could not tell it from nothing unsent. size is never more than SOLIDSYSLOG_MAX_MESSAGE_SIZE: the caller guarantees it, and a store may rely on it. Report a run of lost or refused records once, when it starts, re-armed by the next record kept: the library's reports of its own events pass through Write too, so a store that reported every failure would raise one for each report of the one before.



The documentation for this class was generated from the following file Core/Interface/SolidSyslogStoreDefinition.h