MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / setSecondaryEngine

Method setSecondaryEngine

pj_datastore/src/plugin_data_host.cpp:2066–2079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2064}
2065
2066void DatastoreSourceWriteHost::setSecondaryEngine(DataEngine* secondary) {
2067 // Wire the secondary engine for streaming pause/resume lockstep. Mirroring
2068 // is bidirectional: the active WriteCore mirrors to whichever engine is
2069 // the other one. Called once by the streaming runtime host right after
2070 // construction; passing nullptr disables mirroring.
2071 state_->secondary_engine = secondary;
2072 // Called once right after construction, before any ingest worker runs, so
2073 // mutating the live core's mirror target in place is safe (no concurrent reader
2074 // yet); load() merely unwraps the atomic.
2075 if (auto core = state_->core.load(std::memory_order_acquire)) {
2076 // Whichever direction we're currently pointed at, mirror to the other.
2077 core->secondary_engine = (&core->engine == state_->primary_engine) ? secondary : state_->primary_engine;
2078 }
2079}
2080
2081DatastoreParserWriteHost::DatastoreParserWriteHost(DataEngine& engine, TopicHandle topic)
2082 : state_(std::make_unique<DatastoreParserWriteHostState>(engine, topic)) {}

Callers 4

DataSourceRuntimeHostMethod · 0.80
cbEnsureParserBindingMethod · 0.80
TESTFunction · 0.80
TESTFunction · 0.80

Calls 1

loadMethod · 0.45

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64