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

Method createTimeDomain

pj_datastore/src/engine.cpp:240–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238// ---------------------------------------------------------------------------
239
240Expected<TimeDomainId> DataEngine::createTimeDomain(std::string name, TimeDomainId requested_id) {
241 std::unique_lock<std::recursive_mutex> lock(impl_->mutex_);
242 TimeDomainId id = requested_id != 0 ? requested_id : impl_->next_time_domain_id;
243 if (requested_id != 0) {
244 if (impl_->time_domains.find(requested_id) != impl_->time_domains.end()) {
245 return PJ::unexpected(fmt::format("Time domain {} already exists", requested_id));
246 }
247 if (impl_->next_time_domain_id <= id) {
248 impl_->next_time_domain_id = id + 1;
249 }
250 } else {
251 ++impl_->next_time_domain_id;
252 }
253 TimeDomain td;
254 td.id = id;
255 td.name = std::move(name);
256 impl_->time_domains.emplace(id, std::move(td));
257 return id;
258}
259
260const TimeDomain* DataEngine::getTimeDomain(TimeDomainId id) const {
261 auto it = impl_->time_domains.find(id);

Callers 15

PlotFixtureMethod · 0.80
TESTFunction · 0.80
SetUpMethod · 0.80
TESTFunction · 0.80
makeShiftedDatasetFunction · 0.80
makeEmptyShiftedDatasetFunction · 0.80
TESTFunction · 0.80
addDatasetFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
mainFunction · 0.80
beginLoadMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by 12

PlotFixtureMethod · 0.64
TESTFunction · 0.64
SetUpMethod · 0.64
TESTFunction · 0.64
makeShiftedDatasetFunction · 0.64
makeEmptyShiftedDatasetFunction · 0.64
TESTFunction · 0.64
addDatasetFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64