Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* 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
|
||||
Reference in new issue
Block a user