18#include <boost/graph/graphviz.hpp>
36 QFileInfo DatabaseFile ( QString::fromStdString ( rl ) );
38 if ( DatabaseFile.exists() )
40 QString path_to_database = QString ( DatabaseFile.absoluteFilePath() );
43 INFO (
"Database location set",
"Program execution control success" );
47 INFO (
"Database initialized",
"User request" );
51 ERROR (
"Could not load database",
"OKS error ",
52 " Actions : check environment variables e.g. DUNEDAQ_DB_PATH" );
53 throw std::string (
"Could not load database" );
59 ERROR (
"Cannot open database",
"File error",
"for file", rl );
70 INFO (
"Start load objects into internal cache",
"Program execution control" );
72 std::vector<std::string> all_classes =
75 for (
auto const & x : all_classes )
80 INFO (
"All objects loaded into internal cache",
"Program execution control success",
89 INFO (
"Class to load: ",
"Program execution control", cname );
96 INFO (
"Class load success: ",
"Program execution control", cname,
97 "#objects", std::to_string ( all_objects.size() ) );
102 INFO (
"Database graph generation initiated",
"Program execution control" );
110 INFO (
"Graph generation completed successfully",
"Program execution control success" );
118 if ( not uniqueness )
121 return boost::add_vertex ( xl, g );
126 boost::graph_traits<t_graph>::vertex_iterator viter;
127 std::tie ( result, viter ) =
lookup ( g, xl );
135 return boost::add_vertex ( xl, g );
144 t_registry::iterator vat = registry.find ( x.
full_name() );
146 if ( std::end ( registry ) == vat )
150 t_registry::iterator v;
164 DEBUG (
"Processing object",
"Program execution control", o.
full_name() );
167 std::vector<tref> friends
169 DEBUG (
"Processing object",
"Program execution control", o.
full_name(),
" # friends: ",
170 std::to_string ( friends.size() ) );
172 for (
tref const & x : friends )
175 boost::add_edge ( ov, xv, g );
185 auto const & vertices = boost::vertices ( g );
187 for (
auto v = vertices.first; v != vertices.second; ++v )
208 INFO (
"Saving result",
"Program execution control",
this_dest );
210 INFO (
"Result sent to output",
"Program execution control success",
this_dest );
235 INFO (
"Sending output to stdout",
"Program execution control" )
236 boost::write_graphviz (
247 INFO (
"Sending output to file",
"Program execution control",
"File name:", ofn );
248 boost::write_graphviz (
255 ERROR (
"Could not close file",
"Program execution control",
"File name:", ofn );
259 NOTE (
"Output written to file",
"Program execution control success",
"File name:", ofn );
265 "Output could not be written file",
"Stream could not be opened",
"File name:", ofn );
static bool load(bool subscribeToChanges=true)
static void setdbinfo(QString const &location, dbinfo const itype=dbinfo::oks)
static std::vector< dbe::inner::configobject::tref > objects(std::string const &cname, bool const keep_inherited=true)
std::string class_name() const
std::string full_name() const
std::vector< T > object(tref const &item)