9 #include "gmlc/libguarded/shared_guarded.hpp"
15 #include <string_view>
27 std::atomic<std::size_t> mMaxSize{0};
30 static constexpr std::size_t cDefaultBufferSize{10UL};
32 explicit LogBuffer(std::size_t maxSize): mMaxSize(maxSize) {}
33 void resize(std::size_t newSize);
34 void enable(
bool enable =
true);
35 std::size_t capacity()
const {
return mMaxSize; }
36 std::size_t size()
const {
return mBuffer.lock()->size(); }
38 void push(
int logLevel, std::string_view header, std::string_view message);
41 process(
const std::function<
void(
int, std::string_view, std::string_view)>& procFunc)
const;
Definition: application_api/Federate.hpp:27
Definition: LogBuffer.hpp:24
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
void bufferToJson(const LogBuffer &buffer, Json::Value &base)
Definition: LogBuffer.cpp:60