Fix some bdd_dict_ptr not being passed by const reference.

* iface/dve2/dve2.cc, iface/dve2/dve2.hh,
src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/ltlvisit/contain.cc, src/ltlvisit/contain.hh,
src/ltlvisit/simplify.cc, src/ltlvisit/simplify.hh,
src/tgba/bddprint.cc, src/tgba/bddprint.hh, src/tgba/formula2bdd.cc,
src/tgba/formula2bdd.hh, src/tgba/taatgba.cc, src/tgba/taatgba.hh,
src/tgba/tgbagraph.hh, src/tgbaalgos/compsusp.cc,
src/tgbaalgos/compsusp.hh, src/tgbaalgos/lbtt.cc,
src/tgbaalgos/lbtt.hh, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/ltl2tgba_fm.hh, src/tgbaalgos/randomgraph.cc,
src/tgbaalgos/randomgraph.hh, src/tgbaalgos/translate.cc,
src/tgbaalgos/translate.hh, src/tgbaalgos/word.cc,
src/tgbaalgos/word.hh: Pass shared_ptr to functions by const ref.
This commit is contained in:
Alexandre Duret-Lutz 2014-08-15 11:04:16 +02:00
parent 51151ab271
commit bf6c906772
27 changed files with 62 additions and 61 deletions

View file

@ -98,7 +98,7 @@ namespace spot
}
std::ostream&
bdd_print_sat(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_sat(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
where = &os;
@ -120,7 +120,7 @@ namespace spot
}
std::ostream&
bdd_print_acc(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_acc(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
where = &os;
@ -143,7 +143,7 @@ namespace spot
}
std::ostream&
bdd_print_accset(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_accset(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
where = &os;
@ -156,7 +156,7 @@ namespace spot
}
std::string
bdd_format_accset(bdd_dict_ptr d, bdd b)
bdd_format_accset(const bdd_dict_ptr& d, bdd b)
{
std::ostringstream os;
bdd_print_accset(os, d, b);
@ -164,7 +164,7 @@ namespace spot
}
std::string
bdd_format_sat(bdd_dict_ptr d, bdd b)
bdd_format_sat(const bdd_dict_ptr& d, bdd b)
{
std::ostringstream os;
bdd_print_sat(os, d, b);
@ -172,7 +172,7 @@ namespace spot
}
std::ostream&
bdd_print_set(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_set(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
want_acc = true;
@ -183,7 +183,7 @@ namespace spot
}
std::string
bdd_format_set(const bdd_dict_ptr d, bdd b)
bdd_format_set(const bdd_dict_ptr& d, bdd b)
{
std::ostringstream os;
bdd_print_set(os, d, b);
@ -191,7 +191,7 @@ namespace spot
}
std::ostream&
bdd_print_formula(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_formula(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
const ltl::formula* f = bdd_to_formula(b, d);
print_ltl(f, os);
@ -200,7 +200,7 @@ namespace spot
}
std::string
bdd_format_formula(bdd_dict_ptr d, bdd b)
bdd_format_formula(const bdd_dict_ptr& d, bdd b)
{
std::ostringstream os;
bdd_print_formula(os, d, b);
@ -208,7 +208,7 @@ namespace spot
}
std::ostream&
bdd_print_dot(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_dot(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
want_acc = true;
@ -219,7 +219,7 @@ namespace spot
}
std::ostream&
bdd_print_table(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_table(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
want_acc = true;
@ -236,7 +236,7 @@ namespace spot
}
std::ostream&
bdd_print_isop(std::ostream& os, bdd_dict_ptr d, bdd b)
bdd_print_isop(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{
dict = d;
want_acc = true;
@ -252,7 +252,7 @@ namespace spot
}
std::string
bdd_format_isop(bdd_dict_ptr d, bdd b)
bdd_format_isop(const bdd_dict_ptr& d, bdd b)
{
std::ostringstream os;
bdd_print_isop(os, d, b);

View file

@ -38,7 +38,7 @@ namespace spot
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_sat(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_sat(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Format a BDD as a list of literals.
///
@ -47,7 +47,7 @@ namespace spot
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::string
bdd_format_sat(bdd_dict_ptr dict, bdd b);
bdd_format_sat(const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a list of acceptance conditions.
///
@ -57,7 +57,7 @@ namespace spot
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::ostream&
bdd_print_acc(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_acc(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a set of acceptance conditions.
///
@ -67,7 +67,7 @@ namespace spot
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::ostream&
bdd_print_accset(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_accset(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Format a BDD as a set of acceptance conditions.
///
@ -76,49 +76,49 @@ namespace spot
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::string
bdd_format_accset(bdd_dict_ptr dict, bdd b);
bdd_format_accset(const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a set.
/// \param os The output stream.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_set(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_set(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Format a BDD as a set.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::string
bdd_format_set(bdd_dict_ptr dict, bdd b);
bdd_format_set(const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a formula.
/// \param os The output stream.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_formula(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_formula(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Format a BDD as a formula.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::string
bdd_format_formula(bdd_dict_ptr dict, bdd b);
bdd_format_formula(const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a diagram in dotty format.
/// \param os The output stream.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_dot(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_dot(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as a table.
/// \param os The output stream.
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_table(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_table(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
/// \brief Enable UTF-8 output for bdd printers.
SPOT_API void enable_utf8();
@ -129,7 +129,7 @@ namespace spot
/// \param b The BDD to print.
/// \return The BDD formated as a string.
SPOT_API std::string
bdd_format_isop(bdd_dict_ptr dict, bdd b);
bdd_format_isop(const bdd_dict_ptr& dict, bdd b);
/// \brief Print a BDD as an irredundant sum of product.
@ -137,7 +137,7 @@ namespace spot
/// \param dict The dictionary to use, to lookup variables.
/// \param b The BDD to print.
SPOT_API std::ostream&
bdd_print_isop(std::ostream& os, bdd_dict_ptr dict, bdd b);
bdd_print_isop(std::ostream& os, const bdd_dict_ptr& dict, bdd b);
}

View file

@ -35,7 +35,7 @@ namespace spot
class formula_to_bdd_visitor: public ltl::visitor
{
public:
formula_to_bdd_visitor(bdd_dict_ptr d, void* owner)
formula_to_bdd_visitor(const bdd_dict_ptr& d, void* owner)
: d_(d), owner_(owner)
{
}
@ -207,7 +207,7 @@ namespace spot
} // anonymous
bdd
formula_to_bdd(const formula* f, bdd_dict_ptr d, void* for_me)
formula_to_bdd(const formula* f, const bdd_dict_ptr& d, void* for_me)
{
formula_to_bdd_visitor v(d, for_me);
f->accept(v);

View file

@ -40,11 +40,11 @@ namespace spot
/// for_me. See bdd_dict::unregister_all_my_variables().
/// @{
SPOT_API bdd
formula_to_bdd(const ltl::formula* f, bdd_dict_ptr d, void* for_me);
formula_to_bdd(const ltl::formula* f, const bdd_dict_ptr& d, void* for_me);
template<typename T>
SPOT_API bdd
formula_to_bdd(const ltl::formula* f, bdd_dict_ptr d,
formula_to_bdd(const ltl::formula* f, const bdd_dict_ptr& d,
const std::shared_ptr<T>& for_me)
{
return formula_to_bdd(f, d, for_me.get());

View file

@ -33,7 +33,7 @@ namespace spot
| taa_tgba |
`--------*/
taa_tgba::taa_tgba(bdd_dict_ptr dict)
taa_tgba::taa_tgba(const bdd_dict_ptr& dict)
: dict_(dict),
all_acceptance_conditions_(bddfalse),
all_acceptance_conditions_computed_(false),

View file

@ -35,7 +35,7 @@ namespace spot
class SPOT_API taa_tgba : public tgba
{
public:
taa_tgba(bdd_dict_ptr dict);
taa_tgba(const bdd_dict_ptr& dict);
struct transition;
typedef std::list<transition*> state;

View file

@ -167,7 +167,7 @@ namespace spot
mutable unsigned init_number_;
public:
tgba_digraph(bdd_dict_ptr dict)
tgba_digraph(const bdd_dict_ptr& dict)
: dict_(dict),
all_acceptance_conditions_(bddfalse),
neg_acceptance_conditions_(bddtrue),
@ -432,7 +432,7 @@ namespace spot
};
inline tgba_digraph_ptr make_tgba_digraph(bdd_dict_ptr dict)
inline tgba_digraph_ptr make_tgba_digraph(const bdd_dict_ptr& dict)
{
return std::make_shared<tgba_digraph>(dict);
}