MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / SetData

Method SetData

src/engine/ConsoleObjects.cpp:364–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362 inline T const& GetDataRef() const { return m_Data; }
363
364 inline bool SetData(T const& value, SetBy setby)
365 {
366 VariableState flags = this->GetState();
367 if (flags.CanSetValue(setby))
368 {
369 m_Data = value;
370 this->m_State.setby = setby;
371
372 if (m_OnChange)
373 m_OnChange(*this);
374 return true;
375 }
376 else
377 {
378 VariableState state = this->GetState();
379 if (state.read_only)
380 donut::log::error("cvar '%s' is read-only - value not set", this->GetName().c_str());
381 else
382 donut::log::error("cvar '%s' not enough privilege with '%s' to override '%s' - value not set",
383 this->GetName().c_str(), AsString(setby), AsString((SetBy)state.setby));
384 }
385 return false;
386 }
387
388 virtual bool SetValueFromString(std::string_view s, SetBy setby) override
389 {

Callers 2

SetValueFromStringMethod · 0.95
RegisterVariableMethod · 0.45

Calls 4

errorFunction · 0.85
AsStringFunction · 0.85
GetStateMethod · 0.80
CanSetValueMethod · 0.80

Tested by

no test coverage detected