void onHopeFailed (QString const & message, codeplace const & cp) { tracked<bool> shouldChronicleHopefully (true, HERE); chronicle(shouldChronicleHopefully, message, cp); auto & app = dynamic_cast<ApplicationBase &>(*QApplication::instance()); if (app._hopesToIgnore.find(cp) != app._hopesToIgnore.end()) { chronicle(shouldChronicleHopefully, "^-- IGNORING HOPE!", HERE); return; } if (isGuiThreadCurrent()) { // This is a diret connection; it will block app.onHopeFailed(message, cp); } else { // emit a hope failure to the application on the gui thread // It does a cross-thread blocking queued connection emit app.hopeFailed(message, cp); } }
int main() { chr::vanilla_chronicle_settings settings("/tmp/example"); chr::vanilla_chronicle chronicle(settings); auto tailer = chronicle.create_tailer(); while(true) { if(!tailer.next_index()) continue; std::cout << "int: " << tailer.read<int>() << '\n'; std::cout << "text: " << tailer.read(chr::readers::chars()) << '\n'; } }