- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
83 lines
2.1 KiB
C++
Executable File
83 lines
2.1 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ProxyBuilding to handle access to HandlerBuildingModelInterface
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Norbert Thoden, ESVG, 2024-09-09
|
|
*/
|
|
|
|
#include "proxy_building.h"
|
|
|
|
|
|
|
|
|
|
namespace CentralEffectSimulation
|
|
{
|
|
|
|
#define LOG_ERROR_NO_HNDL_BLDG_MDL ERROR_LOG(m_logger) << LOGFUNCTION << " no handlerBuildingModel"
|
|
#define CHECK_HNDL_BLDG_MDL_RETVAL if (!(isSet_handlerBuildingModel())) { LOG_ERROR_NO_HNDL_BLDG_MDL; return {}; }
|
|
|
|
|
|
class ProxyBuilding::Private
|
|
{
|
|
public:
|
|
Private()
|
|
{}
|
|
|
|
~Private()
|
|
{}
|
|
|
|
std::weak_ptr<CesBuildings::HandlerBuildingModelInterface> m_handlerBuildingModel_wPtr;
|
|
|
|
}; // class ProxyBuilding::Private
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
ProxyBuilding::ProxyBuilding(QObject *parent)
|
|
: BaseClass(parent)
|
|
, d(new Private)
|
|
, m_logger(CentralEffectSimulation::getLogger("ProxyBuilding"))
|
|
{
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
|
}
|
|
//-----------------------------------------------------------------------------
|
|
|
|
ProxyBuilding::~ProxyBuilding()
|
|
{
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
|
delete d;
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
|
}
|
|
|
|
void ProxyBuilding::set_handlerBuildingModel(std::shared_ptr<CesBuildings::HandlerBuildingModelInterface> handlerBuildingModel)
|
|
{
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
|
INFO_LOG(m_logger) << LOGFUNCTION << " set handlerBuildingModel to: " << handlerBuildingModel;
|
|
d->m_handlerBuildingModel_wPtr = handlerBuildingModel;
|
|
TRACE_LOG(m_logger) << LOGFUNCTION << " END";
|
|
}
|
|
|
|
void ProxyBuilding::clear_handlerBuildingModel()
|
|
{
|
|
d->m_handlerBuildingModel_wPtr.reset();
|
|
}
|
|
|
|
bool ProxyBuilding::isSet_handlerBuildingModel() const
|
|
{
|
|
auto sp = d->m_handlerBuildingModel_wPtr.lock();
|
|
return sp.get(); // return sp; no viable conversion
|
|
}
|
|
|
|
std::shared_ptr<CesBuildings::HandlerBuildingModelInterface> ProxyBuilding::handlerBuildingModelInterface()
|
|
{
|
|
auto sp = d->m_handlerBuildingModel_wPtr.lock();
|
|
return sp;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
}
|
|
|