Kept: TetraIF/, Z/src, Lts/Common, Lts/Proxies/TrainingAreaBase (tabTelegrams dependency of TetraIF) plus build scaffolding (cmake/, include/, external/, doxygen/, tests/, translations/, lts-cc.conf, CTestCustom.ctest, new_docker_build.sh, rti_license.dat). Removed: out-of-scope Lts modules (Application, DDS, Plugins, Projects, Services, Tools, Viewer, all Proxies except TrainingAreaBase), top-level src/, specs/, Qt5 tree (qt5-before + .gitmodules entry), migration reports and leftover scripts.
39 lines
749 B
C++
Executable File
39 lines
749 B
C++
Executable File
/**
|
|
* Handler to publish (project) static data to dds
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2017-07-20
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "dds_handler.h"
|
|
#include "pdm_db.h"
|
|
#include "logger.h"
|
|
|
|
namespace ProjectDataManagement
|
|
{
|
|
|
|
template <typename DB>
|
|
bool publishData(const std::shared_ptr<DatabaseInterface> &db,
|
|
const std::shared_ptr<ProjectDataManagement::Interface::Dts> &dts,
|
|
NGL::INGLLogger &logger)
|
|
{
|
|
const auto cb = [dts](const DB & data)
|
|
{
|
|
dts->publish(convert(data));
|
|
};
|
|
|
|
// read from db
|
|
if (!db->select(cb))
|
|
{
|
|
ERROR_LOG(logger) << "Error reading data from database!";
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
} // namespace ProjectDataManagement
|