Skip to content
Snippets Groups Projects
Commit 7683dbb7 authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny: Committed by Johannes Junggeburth
Browse files

add warning message if node could not be published

parent 1326bc1b
No related branches found
No related tags found
1 merge request!327New schema for the GeoModel SQLite database and updated I/O
......@@ -6,18 +6,26 @@ template<typename Iter> void GeoPublisher::printInsertionStatus(Iter it, bool su
std::cout << "GeoModelKernel::GeoPublisher : Insertion of " << it->first << (success ? " succeeded\n" : " failed\n");
}
template<class N, typename T> void GeoPublisher::publishNode(N node,T keyT)
template <class N, typename T>
void GeoPublisher::publishNode(N node, T keyT)
{
std::any key = keyT;
static_assert(std::is_same_v<GeoVFullPhysVol*, N> || std::is_same_v<GeoAlignableTransform*, N>,
static_assert(std::is_same_v<GeoVFullPhysVol *, N> || std::is_same_v<GeoAlignableTransform *, N>,
"ERROR!!! The node type is not currently supported by 'GeoPublisher'.\n If in doubt, please ask to `geomodel-developers@cern.ch'.\n");
if constexpr (std::is_same_v<GeoVFullPhysVol*, N>) {
const auto [iter, success] = m_publishedFPV.insert( {node, key} );
if(!success) printInsertionStatus(iter, success);
} else if constexpr (std::is_same_v<GeoAlignableTransform*, N>) {
const auto [iter, success] = m_publishedAXF.insert( {node, key} );
if(!success) printInsertionStatus(iter, success);
if constexpr (std::is_same_v<GeoVFullPhysVol *, N>)
{
const auto [iter, success] = m_publishedFPV.insert({node, key});
if (!success) {
std::cout << "WARNING! Publication of GeoVFullPhysVol node: " << node << ", key: " << keyT << " failed." << std::endl;
printInsertionStatus(iter, success);
}
}
else if constexpr (std::is_same_v<GeoAlignableTransform *, N>)
{
const auto [iter, success] = m_publishedAXF.insert({node, key});
if (!success) {
std::cout << "WARNING! Publication of AlignableTransform node: " << node << ", key: " << keyT << " failed." << std::endl;
printInsertionStatus(iter, success);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment