[ntcore] Unify listeners (#4536)

This combines all 4 NT listener APIs (topic, value, connection, and
logging) into a single unified listener API.
This commit is contained in:
Peter Johnson
2022-10-31 21:52:14 -07:00
committed by GitHub
parent 32fbfb7da6
commit b114006543
71 changed files with 3613 additions and 5786 deletions

View File

@@ -8,13 +8,12 @@
#include "ntcore.h"
int main(int argc, char** argv) {
nt::AddLogger(
nt::GetDefaultInstance(),
[](const nt::LogMessage& msg) {
std::fputs(msg.message.c_str(), stderr);
std::fputc('\n', stderr);
},
0, UINT_MAX);
nt::AddLogger(nt::GetDefaultInstance(), 0, UINT_MAX, [](auto& event) {
if (auto msg = event.GetLogMessage()) {
std::fputs(msg->message.c_str(), stderr);
std::fputc('\n', stderr);
}
});
::testing::InitGoogleMock(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;