Migrates InfrastructureManagement to generated rtiddsgen API
Converts accessor calls to plain member access across ism service.
This commit is contained in:
30 files changed
+1322
-1314
No files matched your search
+21
-21
@@ -77,7 +77,7 @@ void HandlerMainSchedule::onMainScheduleModifyRequest(const rti::core::SampleIde
|
||||
const MainScheduleModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onMainScheduleModifyRequest: " << request;
|
||||
const Core::FunctionReplyObject ret = request.id() > 0 ? mainScheduleModify(request) : mainScheduleCreate(request);
|
||||
const Core::FunctionReplyObject ret = request.id > 0 ? mainScheduleModify(request) : mainScheduleCreate(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->mainScheduleModifyReply(cookie, ret);
|
||||
@@ -89,10 +89,10 @@ void HandlerMainSchedule::onMainScheduleCopyRequest(const rti::core::SampleIdent
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onMainScheduleCopyRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
if (request.id() > 0)
|
||||
if (request.id > 0)
|
||||
{
|
||||
ObjectMainSchedule ifs(m_mainHandler);
|
||||
ret = ifs.copyObject(request.id());
|
||||
ret = ifs.copyObject(request.id);
|
||||
onDbInsertedSchedule(ifs.getId()); // because notification is not emitted in this case
|
||||
}
|
||||
if (ret.error())
|
||||
@@ -105,14 +105,14 @@ void HandlerMainSchedule::onMainScheduleCopyRequest(const rti::core::SampleIdent
|
||||
static MainSchedule convert(const MainScheduleModifyRequest &request)
|
||||
{
|
||||
MainSchedule ddsData;
|
||||
ddsData.id(request.id());
|
||||
ddsData.name(request.name());
|
||||
ddsData.statusId(request.statusId());
|
||||
ddsData.timeCreated(request.timeCreated());
|
||||
ddsData.timeStart(request.timeStart());
|
||||
ddsData.timeEnd(request.timeEnd());
|
||||
ddsData.exerciseId(request.exerciseId());
|
||||
ddsData.description(request.description());
|
||||
ddsData.id = request.id;
|
||||
ddsData.name = request.name;
|
||||
ddsData.statusId = request.statusId;
|
||||
ddsData.timeCreated = request.timeCreated;
|
||||
ddsData.timeStart = request.timeStart;
|
||||
ddsData.timeEnd = request.timeEnd;
|
||||
ddsData.exerciseId = request.exerciseId;
|
||||
ddsData.description = request.description;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -137,9 +137,9 @@ Core::FunctionReplyObject HandlerMainSchedule::mainScheduleCreate(const Infrastr
|
||||
// ---- .elements() are explicitely NOT changed with this method ----
|
||||
Core::FunctionReplyObject HandlerMainSchedule::mainScheduleModify(const InfrastructureManagement::MainScheduleModifyRequest &request)
|
||||
{
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.id());
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(convert(request));;
|
||||
}
|
||||
@@ -149,17 +149,17 @@ void HandlerMainSchedule::onMainScheduleRemoveRequest(const rti::core::SampleIde
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.id());
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->fts()->mainScheduleRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ifs->getData(), m_mainHandler->exerciseId()))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "MainSchedule '%1' is used by another user!")).arg(ifs->getName());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "MainSchedule '%1' is used by another user!")).arg(ifs->getName());
|
||||
m_mainHandler->dds()->fts()->mainScheduleRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void HandlerMainSchedule::onMainScheduleRemoveRequest(const rti::core::SampleIde
|
||||
else
|
||||
{
|
||||
delete ifs;
|
||||
m_objectMainScheduleMap.remove(request.id());
|
||||
m_objectMainScheduleMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_mainHandler->dds()->fts()->mainScheduleRemoveReply(cookie, ret);
|
||||
@@ -190,11 +190,11 @@ void HandlerMainSchedule::onMountingPointPlanModifyRequest(const rti::core::Samp
|
||||
|
||||
Core::FunctionReplyObject HandlerMainSchedule::mountingPointPlanModify(const InfrastructureManagement::MountingPointPlanModifyRequest &request)
|
||||
{
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.mountingPointScheduleId());
|
||||
ObjectMainSchedule *ifs = m_objectMainScheduleMap.value(request.mountingPointScheduleId);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.mountingPointScheduleId(), tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.mountingPointScheduleId());
|
||||
return Core::FunctionReplyObject(request.mountingPointScheduleId, tr_lts("dds", "MainSchedule with id %1 not found")).arg(request.mountingPointScheduleId);
|
||||
|
||||
return ifs->updateElements(request.mountingPointPlans());
|
||||
return ifs->updateElements(request.mountingPointPlans);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -238,5 +238,5 @@ std::vector<MountingPointPlan> HandlerMainSchedule::getMountingPointPlans(int sc
|
||||
{
|
||||
if (!getMainSchedule(scheduleId))
|
||||
return {};
|
||||
return getMainSchedule(scheduleId)->getData().elements();
|
||||
return getMainSchedule(scheduleId)->getData().elements;
|
||||
}
|
||||
Reference in new issue
Block a user