diff --git a/resource/dfu_match_id_based.hpp b/resource/dfu_match_id_based.hpp index c44284622..dfb109e3f 100644 --- a/resource/dfu_match_id_based.hpp +++ b/resource/dfu_match_id_based.hpp @@ -216,7 +216,6 @@ class greater_interval_first_t : public dfu_match_cb_t const std::vector &resources, const f_resource_graph_t &g, scoring_api_t &dfu) { - using namespace boost; using namespace boost::icl; int score = MATCH_MET; fold::interval_greater comp; @@ -230,7 +229,7 @@ class greater_interval_first_t : public dfu_match_cb_t break; } dfu.transform (subsystem, type, - icl::inserter (comp.ivset, comp.ivset.end ()), + boost::icl::inserter (comp.ivset, comp.ivset.end ()), fold::to_interval); dfu.choose_accum_best_k (subsystem, type, count, comp); } @@ -242,7 +241,6 @@ class greater_interval_first_t : public dfu_match_cb_t const std::vector &resources, const f_resource_graph_t &g, scoring_api_t &dfu) { - using namespace boost; using namespace boost::icl; int score = MATCH_MET; int64_t overall; @@ -261,7 +259,7 @@ class greater_interval_first_t : public dfu_match_cb_t break; } dfu.transform (subsystem, c_type, - icl::inserter (comp.ivset, comp.ivset.end ()), + boost::icl::inserter (comp.ivset, comp.ivset.end ()), fold::to_interval); dfu.choose_accum_best_k (subsystem, c_type, count, comp); } diff --git a/resource/resource_gen.cpp b/resource/resource_gen.cpp index 830334be7..f179d7e30 100644 --- a/resource/resource_gen.cpp +++ b/resource/resource_gen.cpp @@ -37,14 +37,13 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; /*! Note that this class must be copy-constructible * required by the concept of the depth first search * visitor. It must be lightweight. */ -class dfs_emitter_t : public default_dfs_visitor { +class dfs_emitter_t : public boost::default_dfs_visitor { public: dfs_emitter_t (); dfs_emitter_t (resource_graph_db_t *db_p, resource_gen_spec_t *g); @@ -184,7 +183,7 @@ vtx_t dfs_emitter_t::emit_vertex (ggv_t u, gge_t e, const gg_t &recipe, vtx_t src_v, int i, int sz, int j) { resource_graph_db_t &db = *m_db_p; - if (src_v == graph_traits::null_vertex()) + if (src_v == boost::graph_traits::null_vertex()) if (db.roots.find (recipe[u].subsystem) != db.roots.end ()) return db.roots[recipe[u].subsystem]; @@ -193,7 +192,7 @@ vtx_t dfs_emitter_t::emit_vertex (ggv_t u, gge_t e, const gg_t &recipe, string ssys = recipe[u].subsystem; int id = 0; - if (src_v == graph_traits::null_vertex()) { + if (src_v == boost::graph_traits::null_vertex()) { // ROOT!! db.roots[recipe[u].subsystem] = v; id = 0; @@ -290,7 +289,7 @@ void dfs_emitter_t::tree_edge (gge_t e, const gg_t &recipe) if (recipe[src_ggv].root) { //! ROOT if (m_gen_src_vtx[src_ggv].empty ()) { - vtx_t null_v = graph_traits::null_vertex(); + vtx_t null_v = boost::graph_traits::null_vertex(); m_gen_src_vtx[src_ggv].push_back (emit_vertex (src_ggv, e, recipe, null_v, 0, 1, 0)); } @@ -453,7 +452,7 @@ int resource_generator_t::read_graphml (const string &fn, resource_graph_db_t &d // with emitter visitor. // dfs_emitter_t emitter (&db, &m_gspec); - depth_first_search (m_gspec.gen_graph (), visitor (emitter)); + depth_first_search (m_gspec.gen_graph (), boost::visitor (emitter)); m_err_msg += emitter.err_message (); return (m_err_msg == "")? rc : -1; diff --git a/resource/resource_gen_spec.cpp b/resource/resource_gen_spec.cpp index 45881ef89..12a0e809b 100644 --- a/resource/resource_gen_spec.cpp +++ b/resource/resource_gen_spec.cpp @@ -36,7 +36,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; struct str2enum_t @@ -87,7 +86,7 @@ class gg_label_writer_sim_t { * * ********************************************************************************/ -void resource_gen_spec_t::setup_dynamic_property (dynamic_properties &dp, gg_t &g) +void resource_gen_spec_t::setup_dynamic_property (boost::dynamic_properties &dp, gg_t &g) { dp.property("root", get(&resource_pool_gen_t::root, g)); dp.property("type", get(&resource_pool_gen_t::type, g)); @@ -159,7 +158,7 @@ int resource_gen_spec_t::read_graphml (const string &ifn) try { boost::read_graphml (in_file, g, dp); - } catch (graph_exception &e) { + } catch (boost::graph_exception &e) { cerr << e.what () << endl; rc = -1; } @@ -199,7 +198,7 @@ int resource_gen_spec_t::write_graphviz (const string &ofn, bool simple) gg_label_writer_sim_t ewr (e_rel_map); boost::write_graphviz (out_file, g, vwr, ewr); } - } catch (graph_exception &e) { + } catch (boost::graph_exception &e) { cerr << e.what () << endl; rc = -1; } diff --git a/resource/resource_gen_spec.hpp b/resource/resource_gen_spec.hpp index 4445a983d..d65b19578 100644 --- a/resource/resource_gen_spec.hpp +++ b/resource/resource_gen_spec.hpp @@ -34,8 +34,6 @@ namespace Flux { namespace resource_model { -using namespace boost; - enum gen_meth_t { MULTIPLY, ASSOCIATE_IN, @@ -66,30 +64,30 @@ struct relation_gen_t { int as_src_uplvl; }; -typedef adjacency_list< - vecS, - vecS, - directedS, +typedef boost::adjacency_list< + boost::vecS, + boost::vecS, + boost::directedS, resource_pool_gen_t, relation_gen_t > gg_t; typedef std::string resource_pool_gen_t::* pgen_t; typedef std::string relation_gen_t::* rgen_t; -typedef graph_traits::vertex_descriptor ggv_t; -typedef graph_traits::edge_descriptor gge_t; +typedef boost::graph_traits::vertex_descriptor ggv_t; +typedef boost::graph_traits::edge_descriptor gge_t; -typedef property_map::type vtx_type_map_t; -typedef property_map::type vtx_basename_map_t; -typedef property_map::type vtx_size_map_t; -typedef property_map::type vtx_unit_map_t; -typedef property_map::type vtx_subsystem_map_t; -typedef property_map::type edg_e_subsystem_map_t; -typedef property_map::type edg_relation_map_t; -typedef property_map::type edg_rrelation_map_t; -typedef property_map::type edg_gen_method_map_t; -typedef property_map::type edg_id_method_map_t; -typedef property_map::type edg_multi_scale_map_t; +typedef boost::property_map::type vtx_type_map_t; +typedef boost::property_map::type vtx_basename_map_t; +typedef boost::property_map::type vtx_size_map_t; +typedef boost::property_map::type vtx_unit_map_t; +typedef boost::property_map::type vtx_subsystem_map_t; +typedef boost::property_map::type edg_e_subsystem_map_t; +typedef boost::property_map::type edg_relation_map_t; +typedef boost::property_map::type edg_rrelation_map_t; +typedef boost::property_map::type edg_gen_method_map_t; +typedef boost::property_map::type edg_id_method_map_t; +typedef boost::property_map::type edg_multi_scale_map_t; class resource_gen_spec_t { public: @@ -101,9 +99,9 @@ class resource_gen_spec_t { int write_graphviz (const std::string &ofn, bool simple=false); private: - void setup_dynamic_property (dynamic_properties &dp, gg_t &g); + void setup_dynamic_property (boost::dynamic_properties &dp, gg_t &g); gg_t g; - dynamic_properties dp; + boost::dynamic_properties dp; }; } // namespace resource_model diff --git a/resource/resource_graph.hpp b/resource/resource_graph.hpp index 075f76192..8f07413dd 100644 --- a/resource/resource_graph.hpp +++ b/resource/resource_graph.hpp @@ -35,8 +35,6 @@ namespace Flux { namespace resource_model { -using namespace boost; - enum class emit_format_t { GRAPHVIZ_DOT, GRAPH_ML, }; typedef pool_infra_t resource_pool_t::* pinfra_t; @@ -44,7 +42,7 @@ typedef std::string resource_pool_t::* pname_t; typedef std::string resource_relation_t::* rname_t; typedef relation_infra_t resource_relation_t::* rinfra_t; -typedef adjacency_list resource_graph_t; /*! For each chosen subsystem, a selector has std::set. @@ -65,7 +63,7 @@ class subsystem_selector_t { m_selector = sel; } bool operator () (const graph_entity &ent) const { - typedef typename property_traits::value_type infra_type; + typedef typename boost::property_traits::value_type infra_type; const infra_type &inf = get (m_imap, ent); const multi_subsystems_t &subsystems = inf.member_of; for (auto &kv : subsystems) { @@ -87,25 +85,25 @@ class subsystem_selector_t { inframap m_imap; }; -typedef property_map::type vtx_infra_map_t; -typedef property_map::type edg_infra_map_t; -typedef graph_traits::vertex_descriptor vtx_t; -typedef graph_traits::edge_descriptor edg_t; -typedef graph_traits::vertex_iterator vtx_iterator_t; -typedef graph_traits::edge_iterator edg_iterator_t; -typedef graph_traits::out_edge_iterator out_edg_iterator_t; -typedef filtered_graph::type vtx_infra_map_t; +typedef boost::property_map::type edg_infra_map_t; +typedef boost::graph_traits::vertex_descriptor vtx_t; +typedef boost::graph_traits::edge_descriptor edg_t; +typedef boost::graph_traits::vertex_iterator vtx_iterator_t; +typedef boost::graph_traits::edge_iterator edg_iterator_t; +typedef boost::graph_traits::out_edge_iterator out_edg_iterator_t; +typedef boost::filtered_graph, subsystem_selector_t> f_resource_graph_t; -typedef property_map::type f_edg_infra_map_t; -typedef property_map::type f_vtx_infra_map_t; -typedef property_map::type f_res_name_map_t; -typedef property_map::type f_rel_name_map_t; -typedef property_map::type f_vtx_infra_map_t; -typedef graph_traits::vertex_iterator f_vtx_iterator_t; -typedef graph_traits::edge_iterator f_edg_iterator_t; -typedef graph_traits::out_edge_iterator f_out_edg_iterator_t; +typedef boost::property_map::type f_edg_infra_map_t; +typedef boost::property_map::type f_vtx_infra_map_t; +typedef boost::property_map::type f_res_name_map_t; +typedef boost::property_map::type f_rel_name_map_t; +typedef boost::property_map::type f_vtx_infra_map_t; +typedef boost::graph_traits::vertex_iterator f_vtx_iterator_t; +typedef boost::graph_traits::edge_iterator f_edg_iterator_t; +typedef boost::graph_traits::out_edge_iterator f_out_edg_iterator_t; /*! Resource graph data store. * Adjacency_list graph, roots of this graph and various indexing. diff --git a/resource/utilities/grug2dot.cpp b/resource/utilities/grug2dot.cpp index ecb27100a..2735f14e2 100644 --- a/resource/utilities/grug2dot.cpp +++ b/resource/utilities/grug2dot.cpp @@ -33,7 +33,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; #define OPTIONS "hm" @@ -85,7 +84,7 @@ int main (int argc, char *argv[]) resource_gen_spec_t gspec; string fn (argv[optind]); - filesystem::path path = fn; + boost::filesystem::path path = fn; string base = path.stem ().string (); if (gspec.read_graphml (fn) != 0) { diff --git a/resource/utilities/resource-query.cpp b/resource/utilities/resource-query.cpp index 8b4039627..f5314541c 100644 --- a/resource/utilities/resource-query.cpp +++ b/resource/utilities/resource-query.cpp @@ -43,7 +43,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; #define OPTIONS "G:S:P:g:o:t:e:h" @@ -176,9 +175,9 @@ static void set_default_params (resource_context_t *ctx) static int string_to_graph_format (string st, emit_format_t &format) { int rc = 0; - if (iequals (st, string ("dot"))) + if (boost::iequals (st, string ("dot"))) format = emit_format_t::GRAPHVIZ_DOT; - else if (iequals (st, string ("graphml"))) + else if (boost::iequals (st, string ("graphml"))) format = emit_format_t::GRAPH_ML; else rc = -1; @@ -216,57 +215,57 @@ static int set_subsystems_use (resource_context_t *ctx, string n) dfu_match_cb_t &matcher = *(ctx->matcher); const string &matcher_type = matcher.matcher_name (); - if (iequals (matcher_type, string ("CA"))) { + if (boost::iequals (matcher_type, string ("CA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); - } else if (iequals (matcher_type, string ("IBA"))) { + } else if (boost::iequals (matcher_type, string ("IBA"))) { if ( (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "*"); - } else if (iequals (matcher_type, string ("IBBA"))) { + } else if (boost::iequals (matcher_type, string ("IBBA"))) { if ( (rc = subsystem_exist (ctx, "ibnetbw")) == 0) matcher.add_subsystem ("ibnetbw", "*"); - } else if (iequals (matcher_type, string ("PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("PA"))) { + } else if (boost::iequals (matcher_type, string ("PA"))) { if ( (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "*"); - } else if (iequals (matcher_type, string ("C+PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("C+PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( !rc && (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("C+IBA"))) { + } else if (boost::iequals (matcher_type, string ("C+IBA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_up"); - } else if (iequals (matcher_type, string ("C+PA"))) { + } else if (boost::iequals (matcher_type, string ("C+PA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); if ( !rc && (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "draws_from"); - } else if (iequals (matcher_type, string ("IB+IBBA"))) { + } else if (boost::iequals (matcher_type, string ("IB+IBBA"))) { if ( (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_down"); if ( !rc && (rc = subsystem_exist (ctx, "ibnetbw")) == 0) matcher.add_subsystem ("ibnetbw", "*"); - } else if (iequals (matcher_type, string ("C+P+IBA"))) { + } else if (boost::iequals (matcher_type, string ("C+P+IBA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "draws_from"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_up"); - } else if (iequals (matcher_type, string ("V+PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("V+PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "virtual1")) == 0) matcher.add_subsystem ("virtual1", "*"); if ( !rc && (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("VA"))) { + } else if (boost::iequals (matcher_type, string ("VA"))) { if ( (rc = subsystem_exist (ctx, "virtual1")) == 0) matcher.add_subsystem ("virtual1", "*"); - } else if (iequals (matcher_type, string ("ALL"))) { + } else if (boost::iequals (matcher_type, string ("ALL"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) @@ -323,13 +322,13 @@ static void flatten (f_resource_graph_t &fg, map &paths, static void write_to_graphml (f_resource_graph_t &fg, fstream &o) { - dynamic_properties dp; + boost::dynamic_properties dp; map esubsystems; map subsystems, properties, paths; - associative_property_map> subsystems_map (subsystems); - associative_property_map> esubsystems_map (esubsystems); - associative_property_map> props_map (properties); - associative_property_map> paths_map (paths); + boost::associative_property_map> subsystems_map (subsystems); + boost::associative_property_map> esubsystems_map (esubsystems); + boost::associative_property_map> props_map (properties); + boost::associative_property_map> paths_map (paths); flatten (fg, paths, subsystems, esubsystems);