[GIT] ppl/ppl(master): Simplified initialization of Threshold_Watcher<> static data member.

Module: ppl/ppl Branch: master Commit: 3edd591a85e10eaad4c65d2bee89ddddc3af982a URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=3edd591a85e10...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Fri Feb 26 18:55:07 2010 +0100
Simplified initialization of Threshold_Watcher<> static data member.
---
Watchdog/src/Threshold_Watcher.defs.hh | 8 +++++++- interfaces/C/ppl_c_implementation_common.cc | 5 ----- interfaces/Java/jni/ppl_java_common.cc | 8 -------- interfaces/OCaml/ppl_ocaml_common.cc | 5 ----- interfaces/Prolog/ppl_prolog_common.cc | 6 ------ tests/Polyhedron/weightwatch1.cc | 4 ---- 6 files changed, 7 insertions(+), 29 deletions(-)
diff --git a/Watchdog/src/Threshold_Watcher.defs.hh b/Watchdog/src/Threshold_Watcher.defs.hh index 1f74935..ef3e638 100644 --- a/Watchdog/src/Threshold_Watcher.defs.hh +++ b/Watchdog/src/Threshold_Watcher.defs.hh @@ -77,7 +77,13 @@ private: //! Check threshold reaching. static void check();
-}; +}; // class Parma_Watchdog_Library::Threshold_Watcher + + +// Templatic initialization of static data member. +template <typename Traits> +typename Parma_Watchdog_Library::Threshold_Watcher<Traits>::Initialize +Parma_Watchdog_Library::Threshold_Watcher<Traits>::init;
#include "Threshold_Watcher.inlines.hh" #include "Threshold_Watcher.templates.hh" diff --git a/interfaces/C/ppl_c_implementation_common.cc b/interfaces/C/ppl_c_implementation_common.cc index a6f2bf7..8884870 100644 --- a/interfaces/C/ppl_c_implementation_common.cc +++ b/interfaces/C/ppl_c_implementation_common.cc @@ -136,11 +136,6 @@ reset_deterministic_timeout() { using namespace Parma_Polyhedra_Library; using namespace Parma_Polyhedra_Library::Interfaces::C;
-#ifdef PPL_WATCHDOG_LIBRARY_ENABLED -template <> Weightwatch::Initialize -Weightwatch::init = Weightwatch::Initialize(); -#endif // PPL_WATCHDOG_LIBRARY_ENABLED - unsigned int PPL_POLY_CON_RELATION_IS_DISJOINT; unsigned int PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS; unsigned int PPL_POLY_CON_RELATION_IS_INCLUDED; diff --git a/interfaces/Java/jni/ppl_java_common.cc b/interfaces/Java/jni/ppl_java_common.cc index 337abb4..c32d670 100644 --- a/interfaces/Java/jni/ppl_java_common.cc +++ b/interfaces/Java/jni/ppl_java_common.cc @@ -1004,11 +1004,3 @@ build_java_congruence_system(JNIEnv* env, const Congruence_System& cgs) { } // namespace Interfaces
} // namespace Parma_Polyhedra_Library - - -#ifdef PPL_WATCHDOG_LIBRARY_ENABLED -using namespace Parma_Polyhedra_Library::Interfaces::Java; - -template <> Weightwatch::Initialize -Weightwatch::init = Weightwatch::Initialize(); -#endif // PPL_WATCHDOG_LIBRARY_ENABLED diff --git a/interfaces/OCaml/ppl_ocaml_common.cc b/interfaces/OCaml/ppl_ocaml_common.cc index 9dfd493..62b67d5 100644 --- a/interfaces/OCaml/ppl_ocaml_common.cc +++ b/interfaces/OCaml/ppl_ocaml_common.cc @@ -754,11 +754,6 @@ unregistered_value_p_MIP_Problem(const MIP_Problem& ph) { using namespace Parma_Polyhedra_Library; using namespace Parma_Polyhedra_Library::Interfaces::OCaml;
-#ifdef PPL_WATCHDOG_LIBRARY_ENABLED -template <> Weightwatch::Initialize -Weightwatch::init = Weightwatch::Initialize(); -#endif // PPL_WATCHDOG_LIBRARY_ENABLED - extern "C" CAMLprim value ppl_new_MIP_Problem_from_space_dimension(value d) try { diff --git a/interfaces/Prolog/ppl_prolog_common.cc b/interfaces/Prolog/ppl_prolog_common.cc index da8385c..94202f3 100644 --- a/interfaces/Prolog/ppl_prolog_common.cc +++ b/interfaces/Prolog/ppl_prolog_common.cc @@ -1410,12 +1410,6 @@ term_to_complexity_class(Prolog_term_ref t, const char* where) {
using namespace Parma_Polyhedra_Library::Interfaces::Prolog;
-#ifdef PPL_WATCHDOG_LIBRARY_ENABLED -template <> Weightwatch::Initialize -Weightwatch::init = Weightwatch::Initialize(); -#endif // PPL_WATCHDOG_LIBRARY_ENABLED - - extern "C" Prolog_foreign_return_type ppl_version_major(Prolog_term_ref t_v) { try { diff --git a/tests/Polyhedron/weightwatch1.cc b/tests/Polyhedron/weightwatch1.cc index 2b55ae3..30ae5cf 100644 --- a/tests/Polyhedron/weightwatch1.cc +++ b/tests/Polyhedron/weightwatch1.cc @@ -29,10 +29,6 @@ namespace { typedef Parma_Watchdog_Library::Threshold_Watcher<Weightwatch_Traits> Weightwatch;
-template <> Weightwatch::Initialize -Weightwatch::init = Weightwatch::Initialize(); - - class Deterministic_Timeout : virtual public std::exception, public Parma_Polyhedra_Library::Throwable {
participants (1)
-
Enea Zaffanella