- cmake/FindRTI.cmake: Add INTERFACE placeholder targets when RTI not found - cmake/FindRTI.cmake: Force BUILD_RTI=OFF when RTI not installed - Lts/Common/LtsSession/CMakeLists.txt: Make LtsSessionDataDds conditional on BUILD_RTI - Lts/Viewer/CMakeLists.txt: Make LtsDataView conditional on BUILD_RTI - Lts/Plugins/*/CMakeLists.txt: 97 plugin files wrapped in BUILD_RTI conditionals - cmake/NGLMacros.cmake: Fix NGL_ADD_BIG_RESOURCES macro (removed premature return()) - Multiple Qt6 API fixes: QLinkedList→std::list, QStringRef→QStringView, etc. - BUILD_RTI_FIXES_SUMMARY.md: Comprehensive documentation of all fixes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
97 lines
1.6 KiB
C++
Executable File
97 lines
1.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Helper class for storing a simple value and an implizit changed flag
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
// Qt
|
|
|
|
#include <sstream>
|
|
|
|
//----------------------------------------------------------------------------
|
|
namespace SituationMap
|
|
{
|
|
|
|
|
|
/*! \class SimpleValue
|
|
\brief Simple storing fo values
|
|
*/
|
|
template <class TYPE> class SimpleValue
|
|
{
|
|
protected:
|
|
TYPE m_value = TYPE(); // '{}' to initialize the member (and avoid unconditional jumps@valgrind)
|
|
bool m_changed = true;
|
|
|
|
public:
|
|
SimpleValue() = default;
|
|
// cppcheck-suppress noExplicitConstructor
|
|
SimpleValue(const TYPE &value) // should not be declared explicit to avoid additional writing stuff to cast values
|
|
: m_value(value)
|
|
{}
|
|
|
|
SimpleValue<TYPE> &operator=(const TYPE &newValue)
|
|
{
|
|
if (this->m_value != newValue)
|
|
{
|
|
this->m_value = newValue;
|
|
m_changed = true;
|
|
}
|
|
return *this;
|
|
}
|
|
|
|
const TYPE &operator()() const
|
|
{
|
|
return this->m_value;
|
|
}
|
|
|
|
const TYPE &value() const
|
|
{
|
|
return this->m_value;
|
|
}
|
|
|
|
TYPE &refValue()
|
|
{
|
|
m_changed = true;
|
|
return this->m_value;
|
|
}
|
|
|
|
const TYPE &refValue() const
|
|
{
|
|
return this->m_value;
|
|
}
|
|
|
|
|
|
bool changed() const
|
|
{
|
|
return m_changed;
|
|
}
|
|
|
|
void reset()
|
|
{
|
|
m_changed = false;
|
|
}
|
|
|
|
void setChanged()
|
|
{
|
|
m_changed = true;
|
|
}
|
|
|
|
|
|
friend std::ostream &operator<<(std::ostream &stream,
|
|
const SimpleValue &simpleVal)
|
|
{
|
|
stream << simpleVal.value();
|
|
return stream;
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace SituationMap
|
|
|