nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer

#include <src/lib/profiles/data-management/Current/LoggingManagement.h>

Vùng đệm sự kiện nội bộ, được xây dựng dựa trên nl::Weave::TLV::WeaveCircularTLVBuffer.

Tóm tắt

Hàm khởi tạo và hàm phá

CircularEventBuffer(uint8_t *inBuffer, size_t inBufferLength, CircularEventBuffer *inPrev, CircularEventBuffer *inNext)
Hàm khởi tạo cho CircularEventBuffer (API nội bộ).

Thuộc tính công khai

mBuffer
Vùng đệm TLV cơ bản lưu trữ các sự kiện dưới dạng cách biểu diễn TLV.
mEventIdCounter
mFirstEventID
Mã sự kiện đầu tiên được lưu trữ trong hệ thống phụ ghi nhật ký cho tầm quan trọng này.
mFirstEventTimestamp
Dấu thời gian của sự kiện đầu tiên trong vùng đệm này.
mFirstEventUTCTimestamp
Dấu thời gian UTC của sự kiện đầu tiên trong vùng đệm này.
mImportance
Vùng đệm là bộ chứa cuối cùng cho những sự kiện có tầm quan trọng này.
mLastEventID
Mã sự kiện gần đây nhất đã cải thiện mức độ quan trọng này.
mLastEventTimestamp
Dấu thời gian của sự kiện cuối cùng trong vùng đệm này.
mLastEventUTCTimestamp
Dấu thời gian UTC của sự kiện cuối cùng trong vùng đệm này.
mNext
Một con trỏ CircularEventBuffer lưu trữ sự kiện quan trọng hơn.
mNonPersistedCounter
mPrev
Con trỏ CircularEventBuffer lưu trữ sự kiện ít quan trọng hơn.
mUTCInitialized
bool
Cho biết liệu dấu thời gian UTC có được khởi tạo trong vùng đệm này hay không.

Hàm công khai

AddEvent(timestamp_t inEventTimestamp)
void
Khi có dấu thời gian của một sự kiện, hãy tính thời gian delta để lưu trữ trong nhật ký.
AddEventUTC(utc_timestamp_t inEventTimestamp)
void
Khi có dấu thời gian của một sự kiện, hãy tính thời gian delta utc để lưu trữ trong nhật ký.
IsFinalDestinationForImportance(ImportanceType inImportance) const
bool
Một hàm trợ giúp xác định xem sự kiện có tầm quan trọng đã chỉ định có bị loại bỏ khỏi vùng đệm này hay không.
LoadEvents(TLVReader & reader)
RemoveEvent(size_t aNumEvents)
void
SerializeEvents(TLVWriter & writer)
VendEventID(void)
Phân bổ mã sự kiện mới dựa trên tầm quan trọng của sự kiện và đặt trước bộ đếm nếu có.

Hàm tĩnh công khai

GetNextBufferFunct(nl::Weave::TLV::TLVReader & ioReader, uintptr_t & inBufHandle, const uint8_t *& outBufStart, uint32_t & outBufLen)

Thuộc tính công khai

mBuffer

nl::Weave::TLV::WeaveCircularTLVBuffer nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mBuffer

Vùng đệm TLV cơ bản lưu trữ các sự kiện dưới dạng cách biểu diễn TLV.

mEventIdCounter

nl::Weave::MonotonicallyIncreasingCounter * nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mEventIdCounter

mFirstEventID

event_id_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mFirstEventID

Mã sự kiện đầu tiên được lưu trữ trong hệ thống phụ ghi nhật ký cho tầm quan trọng này.

mFirstEventTimestamp

timestamp_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mFirstEventTimestamp

Dấu thời gian của sự kiện đầu tiên trong vùng đệm này.

mFirstEventUTCTimestamp

utc_timestamp_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mFirstEventUTCTimestamp

Dấu thời gian UTC của sự kiện đầu tiên trong vùng đệm này.

mImportance

ImportanceType nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mImportance

Vùng đệm là bộ chứa cuối cùng cho những sự kiện có tầm quan trọng này.

Những sự kiện có tầm quan trọng thấp hơn sẽ bị loại bỏ khi bị đẩy ra khỏi vùng đệm này

mLastEventID

event_id_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mLastEventID

Mã sự kiện gần đây nhất đã cải thiện mức độ quan trọng này.

mLastEventTimestamp

timestamp_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mLastEventTimestamp

Dấu thời gian của sự kiện cuối cùng trong vùng đệm này.

mLastEventUTCTimestamp

utc_timestamp_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mLastEventUTCTimestamp

Dấu thời gian UTC của sự kiện cuối cùng trong vùng đệm này.

mNext

CircularEventBuffer * nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mNext

Một con trỏ CircularEventBuffer lưu trữ sự kiện quan trọng hơn.

mNonPersistedCounter

nl::Weave::MonotonicallyIncreasingCounter nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mNonPersistedCounter

mPrev

CircularEventBuffer * nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mPrev

Con trỏ CircularEventBuffer lưu trữ sự kiện ít quan trọng hơn.

mUTCInitialized

bool nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::mUTCInitialized

Cho biết liệu dấu thời gian UTC có được khởi tạo trong vùng đệm này hay không.

Hàm công khai

AddEvent

void nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::AddEvent(
  timestamp_t inEventTimestamp
)

Khi có dấu thời gian của một sự kiện, hãy tính thời gian delta để lưu trữ trong nhật ký.

Thông tin chi tiết
Các tham số
inEventTimestamp
Dấu thời gian của sự kiện.
Trả về
int32_t Thời gian delta để mã hoá cho sự kiện.

AddEventUTC

void nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::AddEventUTC(
  utc_timestamp_t inEventTimestamp
)

Khi có dấu thời gian của một sự kiện, hãy tính thời gian delta utc để lưu trữ trong nhật ký.

Thông tin chi tiết
Các tham số
inEventTimestamp
Dấu thời gian utc của sự kiện
Trả về
int64_t Thời gian delta để mã hoá cho sự kiện.

CircularEventBuffer

 nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::CircularEventBuffer(
  uint8_t *inBuffer,
  size_t inBufferLength,
  CircularEventBuffer *inPrev,
  CircularEventBuffer *inNext
)

Hàm khởi tạo cho CircularEventBuffer (API nội bộ).

Thông tin chi tiết
Các tham số
[in] inBuffer
Bộ nhớ thực tế dùng cho việc lưu trữ sự kiện.
[in] inBufferLength
Độ dài của inBuffer tính bằng byte.
[in] inPrev
Con trỏ đến CircularEventBuffer lưu trữ các sự kiện có mức độ ưu tiên thấp hơn.
[in] inNext
Con trỏ đến CircularEventBuffer lưu trữ các sự kiện có mức độ ưu tiên cao hơn.
Trả về

IsFinalDestinationForImportance

bool nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::IsFinalDestinationForImportance(
  ImportanceType inImportance
) const 

Một hàm trợ giúp xác định xem sự kiện có tầm quan trọng đã chỉ định có bị loại bỏ khỏi vùng đệm này hay không.

Thông tin chi tiết
Các tham số
[in] inImportance
Tầm quan trọng của sự kiện.
Giá trị trả về
true
Sự kiện sẽ bị loại bỏ khỏi vùng đệm này do tràn hàng đợi.
false
Sự kiện sẽ được chuyển đến hàng đợi tiếp theo.

LoadEvents

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::LoadEvents(
  TLVReader & reader
)

RemoveEvent

void nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::RemoveEvent(
  size_t aNumEvents
)

SerializeEvents

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::SerializeEvents(
  TLVWriter & writer
)

VendEventID

event_id_t nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::VendEventID(
  void
)

Phân bổ mã sự kiện mới dựa trên tầm quan trọng của sự kiện và đặt trước bộ đếm nếu có.

Thông tin chi tiết
Trả về
event_id_t Mã sự kiện cho tầm quan trọng này.

Hàm tĩnh công khai

GetNextBufferFunct

WEAVE_ERROR nl::Weave::Profiles::DataManagement_Current::CircularEventBuffer::GetNextBufferFunct(
  nl::Weave::TLV::TLVReader & ioReader,
  uintptr_t & inBufHandle,
  const uint8_t *& outBufStart,
  uint32_t & outBufLen
)