From 616aef27a874733e555132b88ba776bf7e60e157 Mon Sep 17 00:00:00 2001 From: Matteo Settenvini Date: Tue, 25 Sep 2018 09:56:28 +0200 Subject: [PATCH] Replace autotools with CMake at the toplevel, backend now compiles with newer GCC --- .bzrignore | 57 - .gitignore | 59 +- CMakeLists.txt | 628 +++++++++ INSTALL | 291 ---- Makefile.am | 666 --------- README | 16 +- TODO | 0 autogen.sh | 20 - config/Doxyfile.in | 1237 ----------------- config/indenter | 11 - config/sgpemv2-uninstalled.pc.in | 18 - config/sgpemv2.pc.in | 18 - config/svn2cl.sh | 130 -- config/svn2cl.xsl | 215 --- configure.ac | 169 --- distro/deb/build.sh | 55 - distro/deb/control-file-v1.0 | 22 - distro/deb/control-file-v1.1 | 22 - distro/deb/readme.txt | 17 - distro/ebuild/sgpemv2-1.0.ebuild | 68 - distro/rpm/SPECS/sgpemv2-1.0.spec | 114 -- distro/rpm/readme.txt | 12 - distro/win32/_sgpem.vcproj | 229 --- distro/win32/backend.vcproj | 721 ---------- distro/win32/config/config.h | 23 - distro/win32/install.txt | 11 - distro/win32/pyloader.vcproj | 229 --- distro/win32/sgpemv2.sln | 56 - distro/win32/sgpemv2.vcproj | 369 ----- distro/win32/xmlsave.vcproj | 233 ---- m4/compilerflags.m4 | 60 - m4/linkingflags.m4 | 31 - m4/sgpemv2-dirs.m4 | 81 -- m4/visibility.m4 | 52 - plugins/pyloader/src/plugin.cc | 6 +- plugins/pyloader/src/python_cpu_policy.cc | 56 +- plugins/pyloader/src/python_cpu_policy.hh | 14 +- .../pyloader/src/python_cpu_policy_manager.cc | 8 +- plugins/pyloader/src/sgpem.i | 6 +- .../src/testsuite/test-python_loader.cc | 10 +- plugins/xmlsave/src/plugin.cc | 6 +- plugins/xmlsave/src/xml_serializer.cc | 54 +- plugins/xmlsave/src/xml_serializer.hh | 6 +- plugins/xmlsave/src/xml_serializer_factory.cc | 2 +- plugins/xmlsave/src/xml_serializer_factory.hh | 2 +- plugins/xmlsave/src/xml_visitor.cc | 64 +- plugins/xmlsave/src/xml_visitor.hh | 30 +- src/add_request_dialog.cc | 2 +- src/add_request_dialog.hh | 2 +- src/backend/concrete_environment.cc | 3 +- src/backend/concrete_history.cc | 37 +- src/backend/concrete_history.hh | 2 +- src/backend/concrete_simulation.cc | 50 +- src/backend/concrete_simulation.hh | 8 +- src/backend/cpu_policies_gatekeeper.cc | 34 +- src/backend/cpu_policy.cc | 8 +- src/backend/dynamic_process.cc | 15 +- src/backend/dynamic_process.hh | 6 +- src/backend/dynamic_request.cc | 10 +- src/backend/dynamic_request.hh | 6 +- src/backend/dynamic_resource.cc | 1 - src/backend/dynamic_resource.hh | 23 +- src/backend/dynamic_schedulable.cc | 1 - src/backend/dynamic_sub_request.cc | 13 +- src/backend/dynamic_sub_request.hh | 11 +- src/backend/dynamic_thread.cc | 15 +- src/backend/dynamic_thread.hh | 8 +- gettext.h => src/backend/gettext.h | 0 src/backend/global_preferences.cc | 50 +- src/backend/module.cc | 2 +- src/backend/plugin_manager.cc | 9 +- src/backend/policy_parameters.cc | 6 +- src/backend/ready_queue.cc | 8 +- src/backend/resource_policies_gatekeeper.cc | 14 +- src/backend/resource_policy_fifo.cc | 4 +- src/backend/resource_policy_fifo.hh | 4 +- src/backend/resource_policy_lifo.cc | 4 +- src/backend/resource_policy_lifo.hh | 4 +- src/backend/resource_policy_priority.cc | 4 +- src/backend/resource_policy_priority.hh | 4 +- .../resource_policy_priority_inheritance.cc | 4 +- .../resource_policy_priority_inheritance.hh | 4 +- src/backend/scheduler.cc | 128 +- src/backend/serializers_gatekeeper.cc | 6 +- src/backend/sgpemv2/config.h.in | 7 + .../sgpemv2/cpu_policies_gatekeeper.hh | 4 +- src/backend/sgpemv2/cpu_policy.hh | 14 +- src/backend/sgpemv2/global_preferences.hh | 8 +- src/backend/sgpemv2/history.hh | 10 +- src/backend/sgpemv2/module.hh | 2 +- src/backend/sgpemv2/null_policy_exception.hh | 4 +- src/backend/sgpemv2/policy_parameters.hh | 6 +- src/backend/sgpemv2/ready_queue.hh | 8 +- .../sgpemv2/resource_policies_gatekeeper.hh | 2 +- src/backend/sgpemv2/resource_policy.hh | 4 +- src/backend/sgpemv2/scheduler.hh | 10 +- src/backend/sgpemv2/serialize_visitor.hh | 16 +- src/backend/sgpemv2/serializer.hh | 4 +- src/backend/sgpemv2/serializers_gatekeeper.hh | 4 +- src/backend/sgpemv2/simulation.hh | 6 +- src/backend/sgpemv2/statistics.hh | 6 +- src/backend/sgpemv2/string_utils.hh | 2 +- src/backend/sgpemv2/templates/deletor.tcc | 39 - src/backend/sgpemv2/templates/down_cast.tcc | 2 +- src/backend/sgpemv2/templates/singleton.tcc | 4 +- src/backend/sgpemv2/templates/smartp.hh | 172 --- src/backend/sgpemv2/templates/smartp.tcc | 178 --- src/backend/simulation.cc | 4 +- src/backend/static_request.cc | 2 +- src/backend/string_utils.cc | 22 +- src/cairo_widget.cc | 2 +- src/configure_policy_dialog.cc | 20 +- src/graphical_preferences_editor.cc | 10 +- src/gui_builder.cc | 26 +- src/holt_widget.cc | 35 +- src/main.cc | 4 +- src/resources_widget.cc | 6 +- src/schedulables_tree_widget.cc | 20 +- src/simulation_controller.cc | 34 +- src/testsuite/test-holt_widget.cc | 10 +- src/testsuite/test-parse_command.cc | 8 +- src/testsuite/test-simulation_widget.cc | 10 +- src/testsuite/test-stepforward.cc | 25 +- src/text_simulation.cc | 93 +- 124 files changed, 1242 insertions(+), 6315 deletions(-) delete mode 100644 .bzrignore create mode 100644 CMakeLists.txt delete mode 100644 INSTALL delete mode 100644 Makefile.am delete mode 100644 TODO delete mode 100755 autogen.sh delete mode 100644 config/Doxyfile.in delete mode 100755 config/indenter delete mode 100644 config/sgpemv2-uninstalled.pc.in delete mode 100644 config/sgpemv2.pc.in delete mode 100755 config/svn2cl.sh delete mode 100644 config/svn2cl.xsl delete mode 100644 configure.ac delete mode 100755 distro/deb/build.sh delete mode 100644 distro/deb/control-file-v1.0 delete mode 100644 distro/deb/control-file-v1.1 delete mode 100644 distro/deb/readme.txt delete mode 100644 distro/ebuild/sgpemv2-1.0.ebuild delete mode 100644 distro/rpm/SPECS/sgpemv2-1.0.spec delete mode 100644 distro/rpm/readme.txt delete mode 100644 distro/win32/_sgpem.vcproj delete mode 100644 distro/win32/backend.vcproj delete mode 100644 distro/win32/config/config.h delete mode 100644 distro/win32/install.txt delete mode 100644 distro/win32/pyloader.vcproj delete mode 100644 distro/win32/sgpemv2.sln delete mode 100644 distro/win32/sgpemv2.vcproj delete mode 100644 distro/win32/xmlsave.vcproj delete mode 100644 m4/compilerflags.m4 delete mode 100644 m4/linkingflags.m4 delete mode 100644 m4/sgpemv2-dirs.m4 delete mode 100644 m4/visibility.m4 rename gettext.h => src/backend/gettext.h (100%) create mode 100644 src/backend/sgpemv2/config.h.in delete mode 100644 src/backend/sgpemv2/templates/deletor.tcc delete mode 100644 src/backend/sgpemv2/templates/smartp.hh delete mode 100644 src/backend/sgpemv2/templates/smartp.tcc diff --git a/.bzrignore b/.bzrignore deleted file mode 100644 index a44212c..0000000 --- a/.bzrignore +++ /dev/null @@ -1,57 +0,0 @@ -.bzrignore -./=* -,,semantic.cache -stamp-* -*.info -doc/vers-*.texi -ABOUT-NLS -INSTALL -Makefile.in -configure -config/config.guess -config/config.rpath -config/depcomp -config/install-sh -config/ltmain.sh -config/mdate-sh -config/missing -config/mkinstalldirs -config/py-compile -config/texinfo.tex -m4/codeset.m4 -m4/gettext.m4 -m4/glibc21.m4 -m4/iconv.m4 -m4/intdiv0.m4 -m4/intmax.m4 -m4/inttypes-pri.m4 -m4/inttypes.m4 -m4/inttypes_h.m4 -m4/isc-posix.m4 -m4/lcmessage.m4 -m4/lib-ld.m4 -m4/lib-link.m4 -m4/lib-prefix.m4 -m4/longdouble.m4 -m4/longlong.m4 -m4/nls.m4 -m4/po.m4 -m4/printf-posix.m4 -m4/progtest.m4 -m4/signed.m4 -m4/size_max.m4 -m4/stdint_h.m4 -m4/uintmax_t.m4 -m4/ulonglong.m4 -m4/wchar_t.m4 -m4/wint_t.m4 -m4/xsize.m4 -po/Makefile.in.in -po/Makevars.template -po/Rules-quot -po/boldquot.sed -po/en@boldquot.header -po/en@quot.header -po/insert-header.sin -po/quot.sed -po/remove-potcdate.sin diff --git a/.gitignore b/.gitignore index cadb30a..dab6212 100644 --- a/.gitignore +++ b/.gitignore @@ -1,59 +1,2 @@ *~ - -**/ChangeLog -**/config.h -**/config.log -**/config/* -**/autom4te.cache - -**/configure -**/Makefile.in -**/aclocal.m4 - -__build__ -__inst__ -distro/deb/* - -**/m4/codeset.m4 -**/m4/gettext.m4 -**/m4/glibc21.m4 -**/m4/glibc2.m4 -**/m4/iconv.m4 -**/m4/intdiv0.m4 -**/m4/intldir.m4 -**/m4/intl.m4 -**/m4/intlmacosx.m4 -**/m4/intmax.m4 -**/m4/inttypes_h.m4 -**/m4/inttypes-pri.m4 -**/m4/lcmessage.m4 -**/m4/lib-ld.m4 -**/m4/lib-link.m4 -**/m4/lib-prefix.m4 -**/m4/libtool.m4 -**/m4/lock.m4 -**/m4/longlong.m4 -**/m4/lt~obsolete.m4 -**/m4/ltoptions.m4 -**/m4/ltsugar.m4 -**/m4/ltversion.m4 -**/m4/nls.m4 -**/m4/pkg.m4 -**/m4/po.m4 -**/m4/printf-posix.m4 -**/m4/progtest.m4 -**/m4/size_max.m4 -**/m4/stdint_h.m4 -**/m4/uintmax_t.m4 -**/m4/wchar_t.m4 -**/m4/wint_t.m4 -**/m4/xsize.m4 - -**/po/Rules-quot -**/po/boldquot.sed -**/po/en@boldquot.header -**/po/en@quot.header -**/po/insert-header.sin -**/po/quot.sed -**/po/remove-potcdate.sin -**/po/Makevars.template +/CMakeLists.txt.user diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..74465b9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,628 @@ +cmake_minimum_required(VERSION 3.11) + +project(sgpemv2 VERSION 1.2) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR [=[ + ** This seems to be the pkg root directory. + ** Compiling here your sources is considered + ** as unpolite as exploring your nose with + ** your pinky whilst attending a wedding party. + ** + ** Please create a separate build dir and then + ** run CMake into it. + ]=]) +endif() + +include(FindPkgConfig) +include(GNUInstallDirs) + +set(CMAKE_CXX_STANDARD 17) + +# ------------------------------------------- + +function(pkg_config_to_tgt tgt) # ARGN: modules + REQUIRED + if(NOT ${tgt}_FOUND) + pkg_check_modules(${tgt} + ${ARGN}) + endif() + + if(${tgt}_FOUND) + add_library(${tgt} INTERFACE IMPORTED) + set_target_properties(${tgt} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${${tgt}_INCLUDE_DIRS}" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${${tgt}_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${${tgt}_LIBRARY_DIRS};${${tgt}_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${${tgt}_CFLAGS_OTHER}") + endif() +endfunction(pkg_config_to_tgt) + + +function(target_sources_add_headers tgt basedir) # ARGN: [ ...] + set(visibilities PUBLIC PRIVATE INTERFACE) + cmake_parse_arguments("" "" "" "${visibilities}" ${ARGN}) + list(APPEND _PUBLIC ${_UNPARSED_ARGUMENTS}) + + unset(target_sources_headers) + foreach(visibility IN LISTS visibilities) + list(APPEND target_sources_headers ${visibility}) + foreach(header IN LISTS "_${visibility}") + if(IS_ABSOLUTE "${header}") + string(REGEX REPLACE ".*/${basedir}/(.*)$" "\\1" rel_header "${header}") + list(APPEND target_sources_headers + "$" + "$") + else() + list(APPEND target_sources_headers + "$" + "$") + endif() + endforeach() + endforeach() + + target_sources(${tgt} ${type} ${target_sources_headers}) +endfunction(target_sources_add_headers) + +# ------------------------------------------- + +find_package(Gettext REQUIRED) +find_package(Intl REQUIRED) +find_package(Doxygen COMPONENTS dot) + +add_compile_options(-Wall -pedantic -Wextra) +add_definitions(-DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE) +set(CMAKE_CXX_VISIBILITY_PRESET "hidden") +set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + +pkg_config_to_tgt(sgpemv2-backend-deps + "gthread-2.0 >= 2.32.0" + "sigc++-2.0 >= 2.2.9" + "glibmm-2.4 >= 2.32.0") + +pkg_config_to_tgt(sgpemv2-frontend-deps + "cairomm-1.0 >= 1.10.0" + "gtkmm-3.0 >= 3.4.0") + +# ------------------------------------------- + +# TODO: no translations yet, so leave commented and untested. +# foreach(lang IN ITEMS ... languages ...) +# gettext_create_translations(${CMAKE_CURRENT_BINARY_DIR}/po/${lang}.mo ALL +# ${CMAKE_CURRENT_BINARY_DIR}/po/${lang}.po) +# gettext_process_po_files(${lang} ALL +# INSTALL_DESTINATION ${CMAKE_INSTALL_LOCALEDIR} +# PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/po/${lang}.po) +# endforeach() + +gettext_process_pot_file(${CMAKE_CURRENT_SOURCE_DIR}/po/sgpemv2.pot ALL + INSTALL_DESTINATION ${CMAKE_INSTALL_LOCALEDIR} LANGUAGES ${languages}) + +add_custom_target(doc + COMMENT "Build all the documentation") + +if(NOT DOXYGEN_FOUND) + message(STATUS "Cannot find doxygen with dot. Skipping API documentation.") +else() + set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/api) + doxygen_add_docs(api-doc + ${CMAKE_CURRENT_SOURCE_DIR}/src/backend/sgpemv2 + ${CMAKE_CURRENT_BINARY_DIR}/src/backend/sgpemv2 + COMMENT "Building documentation via Doxygen") + add_dependencies(doc api-doc) + + install(DIRECTORY ${DOXYGEN_OUTPUT_DIRECTORY}/html + DESTINATION ${CMAKE_INSTALL_DOCDIR} + OPTIONAL) +endif() + +# TODO: eventually migrate to sphinx. +find_program(MAKEINFO makeinfo) +find_program(CONVERT convert) +if(NOT (MAKEINFO AND CONVERT)) + message(STATUS "Cannot find makeinfo or convert. Skipping Info documentation.") +else() + set(output ${CMAKE_CURRENT_BINARY_DIR}/doc/sgpemv2.info) + set(inputs doc/fdl.texi + doc/gpl.texi + doc/sgpem2uman.texi + doc/sgpem2dman.texi) + set(images doc/holt_circle.gif + doc/main-window.gif + doc/simulation_widget.gif) + set(text_image doc/main-window.txt) + + set(img_deps) + foreach(img IN LISTS images) + get_filename_component(img_we ${img} NAME_WE) + set(img_eps ${CMAKE_CURRENT_BINARY_DIR}/doc/${img_we}.eps) + set(img_pdf ${CMAKE_CURRENT_BINARY_DIR}/doc/${img_we}.pdf) + add_custom_command(OUTPUT ${img_eps} COMMAND ${CONVERT} ${img} ${img_eps}) + add_custom_command(OUTPUT ${img_pdf} COMMAND ${CONVERT} ${img} ${img_pdf}) + list(APPEND img_deps ${img_eps} ${img_pdf}) + install(FILES ${img_eps} ${img_pdf} ${CMAKE_CURRENT_SOURCE_DIR}/doc/main-window.txt + DESTINATION ${CMAKE_INSTALL_INFODIR}/sgpemv2-figures) + endforeach() + + add_custom_command(OUTPUT ${output} + COMMAND ${MAKEINFO_EXECUTABLE} -o ${output} ${inputs} + DEPENDS ${inputs} ${img_deps} + COMMENT "Creating Info file documentation" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc + VERBATIM) + + install(FILES ${output} + DESTINATION ${CMAKE_INSTALL_INFODIR}) + + add_custom_target(info-doc ALL DEPENDS ${outputs}) + add_dependencies(doc info-doc) +endif() + +# ------------------------------------------- + +set(localedir ${CMAKE_INSTALL_FULL_LOCALEDIR}) +set(uidir ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ui) +set(policiesdir ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/policies) +set(plugindir ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}/plugins) + +configure_file(src/backend/sgpemv2/config.h.in + src/backend/sgpemv2/config.h + @ONLY) + +add_library(sgpemv2-backend SHARED) +set_target_properties(sgpemv2-backend PROPERTIES + POSITION_INDEPENDENT_CODE ON + VERSION 1.2 + SOVERSION 1.2.0) +target_include_directories(sgpemv2-backend + PUBLIC $ + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/backend + ${Intl_INCLUDE_DIRS}) +target_link_libraries(sgpemv2-backend + PRIVATE sgpemv2-backend-deps + ${Intl_LIBRARIES}) + +target_sources_add_headers(sgpemv2-backend src/backend/ + PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/src/backend/sgpemv2/config.h + + sgpemv2/cpu_policies_gatekeeper.hh + sgpemv2/cpu_policy.hh + sgpemv2/cpu_policy_exception.hh + sgpemv2/cpu_policy_manager.hh + sgpemv2/environment.hh + sgpemv2/global_preferences.hh + sgpemv2/history.hh + sgpemv2/history_observer.hh + sgpemv2/invalid_plugin_exception.hh + sgpemv2/key_file.hh + sgpemv2/malformed_policy_exception.hh + sgpemv2/module.hh + sgpemv2/null_policy_exception.hh + sgpemv2/policy_parameters.hh + sgpemv2/plugin.hh + sgpemv2/plugin_manager.hh + sgpemv2/process_statistics.hh + sgpemv2/ready_queue.hh + sgpemv2/request.hh + sgpemv2/resource.hh + sgpemv2/resource_policies_gatekeeper.hh + sgpemv2/resource_policy.hh + sgpemv2/resource_policy_manager.hh + sgpemv2/process.hh + sgpemv2/schedulable.hh + sgpemv2/schedulable_statistics.hh + sgpemv2/scheduler.hh + sgpemv2/serialize_visitor.hh + sgpemv2/serializer.hh + sgpemv2/serializer_error.hh + sgpemv2/serializers_gatekeeper.hh + sgpemv2/sgpemv2-visibility.hh + sgpemv2/simulation.hh + sgpemv2/simulation_observer.hh + sgpemv2/simulation_statistics.hh + sgpemv2/statistics.hh + sgpemv2/string_utils.hh + sgpemv2/sub_request.hh + sgpemv2/thread.hh + sgpemv2/thread_statistics.hh + sgpemv2/user_interrupt_exception.hh + + sgpemv2/templates/down_cast.tcc + sgpemv2/templates/parameter.tcc + sgpemv2/templates/sequences.tcc + sgpemv2/templates/singleton.hh + sgpemv2/templates/singleton.tcc + + PRIVATE sgpemv2/config.h.in # not distributed + + concrete_environment.cc + concrete_environment.hh + concrete_history.cc + concrete_history.hh + concrete_process_statistics.cc + concrete_process_statistics.hh + concrete_simulation.cc + concrete_simulation.hh + concrete_simulation_statistics.cc + concrete_simulation_statistics.hh + concrete_statistics.cc + concrete_statistics.hh + concrete_thread_statistics.cc + concrete_thread_statistics.hh + cpp_resource_policy_manager.cc + cpp_resource_policy_manager.hh + cpu_policies_gatekeeper.cc + cpu_policy.cc + cpu_policy_exception.cc + cpu_policy_manager.cc + dynamic_process.cc + dynamic_process.hh + dynamic_request.cc + dynamic_request.hh + dynamic_resource.cc + dynamic_resource.hh + dynamic_schedulable.cc + dynamic_schedulable.hh + dynamic_sub_request.cc + dynamic_sub_request.hh + dynamic_thread.cc + dynamic_thread.hh + environment.cc + gettext.h + global_preferences.cc + history.cc + history_observer.cc + invalid_plugin_exception.cc + key_file.cc + malformed_policy_exception.cc + module.cc + null_policy_exception.cc + plugin_manager.cc + policy_parameters.cc + process.cc + process_statistics.cc + ready_queue.cc + request.cc + resource.cc + resource_policies_gatekeeper.cc + resource_policy.cc + resource_policy_fifo.cc + resource_policy_fifo.hh + resource_policy_lifo.cc + resource_policy_lifo.hh + resource_policy_manager.cc + resource_policy_priority.cc + resource_policy_priority.hh + resource_policy_priority_inheritance.hh + resource_policy_priority_inheritance.cc + schedulable.cc + schedulable_statistics.cc + scheduler.cc + serialize_visitor.cc + serializer.cc + serializer_error.cc + serializers_gatekeeper.cc + simulation.cc + simulation_observer.cc + simulation_statistics.cc + static_process.cc + static_process.hh + static_request.cc + static_request.hh + static_resource.cc + static_resource.hh + static_schedulable.cc + static_schedulable.hh + static_sub_request.cc + static_sub_request.hh + static_thread.cc + static_thread.hh + statistics.cc + string_utils.cc + sub_request.cc + thread.cc + thread_statistics.cc + user_interrupt_exception.cc) + +# TODO: plugins! +# add_subdirectory(plugins/pyloader) +# add_subdirectory(plugins/xmlsave) + +# ------------------------------------------- + +add_executable(sgpemv2) +target_include_directories(sgpemv2 + PRIVATE ${Intl_INCLUDE_DIRS}) +target_link_libraries(sgpemv2 + PRIVATE sgpemv2-backend + sgpemv2-frontend-deps + ${Intl_LIBRARIES}) + +target_sources(sgpemv2 + PRIVATE src/add_request_dialog.cc + src/add_request_dialog.hh + src/cairo_elements.cc + src/cairo_elements.hh + src/cairo_widget.cc + src/cairo_widget.hh + src/configure_policy_dialog.cc + src/configure_policy_dialog.hh + src/graphical_preferences_editor.cc + src/graphical_preferences_editor.hh + src/gui_builder.cc + src/gui_builder.hh + src/holt_container_window.cc + src/holt_container_window.hh + src/holt_widget.cc + src/holt_widget.hh + src/jump_to_dialog.cc + src/jump_to_dialog.hh + src/main.cc + src/main.hh + src/parse_opts.cc + src/parse_opts.hh + src/ready_queue_widget.cc + src/ready_queue_widget.hh + src/resources_widget.cc + src/resources_widget.hh + src/schedulables_statistics_widget.cc + src/schedulables_statistics_widget.hh + src/schedulables_statistics_widget.hh + src/schedulables_tree_widget.cc + src/schedulables_tree_widget.hh + src/simulation_controller.cc + src/simulation_controller.hh + src/simulation_statistics_widget.cc + src/simulation_statistics_widget.hh + src/simulation_widget.cc + src/simulation_widget.hh + src/statistics_container_window.cc + src/statistics_container_window.hh + src/text_simulation.cc + src/text_simulation.hh) + +# ------------------------------------------- + +# TODO: port the tests! + +# # ############################################################ +# # +# # check : testsuite +# # +# # ############################################################ + +# if COND_TESTS + +# # DEJATOOL = src/testsuite/example-test.exp + +# noinst_PROGRAMS = \ +# src/testsuite/test-cairo_widget \ +# src/testsuite/test-history \ +# src/testsuite/test-holt_widget \ +# src/testsuite/test-key_file \ +# src/testsuite/test-simulation_widget \ +# src/testsuite/test-statistics +# # disable : +# # src/testsuite/test-global_preferences_serialization +# # src/testsuite/test-parse_command +# # src/testsuite/test-stepforward + +# src_testsuite_test_history_CPPFLAGS = \ +# -I@top_srcdir@/src/backend \ +# $(GLIBMM_CFLAGS) +# src_testsuite_test_history_LDFLAGS = \ +# -Wl,-rpath -Wl,"$(pkglibdir)" \ +# src/backend/libbackend.la \ +# $(GLIBMM_LIBS) +# src_testsuite_test_history_SOURCES = \ +# src/backend/concrete_environment.cc \ +# src/backend/concrete_history.cc \ +# src/backend/dynamic_process.cc \ +# src/backend/dynamic_request.cc \ +# src/backend/dynamic_resource.cc \ +# src/backend/dynamic_schedulable.cc \ +# src/backend/dynamic_sub_request.cc \ +# src/backend/dynamic_thread.cc \ +# src/backend/static_process.cc \ +# src/backend/static_request.cc \ +# src/backend/static_resource.cc \ +# src/backend/static_schedulable.cc \ +# src/backend/static_sub_request.cc \ +# src/backend/static_thread.cc \ +# src/testsuite/test-history.cc + + +# src_testsuite_test_statistics_CPPFLAGS = \ +# -I@top_srcdir@/src/backend \ +# $(GLIBMM_CFLAGS) $(GTHREAD_CFLAGS) +# src_testsuite_test_statistics_LDFLAGS = \ +# -Wl,-rpath -Wl,"$(pkglibdir)" \ +# src/backend/libbackend.la \ +# $(GLIBMM_LIBS) $(GTHREAD_LIBS) +# src_testsuite_test_statistics_SOURCES = \ +# src/backend/statistics.cc \ +# src/backend/concrete_process_statistics.cc \ +# src/backend/concrete_thread_statistics.cc \ +# src/backend/concrete_simulation_statistics.cc \ +# src/backend/concrete_statistics.cc \ +# src/testsuite/test-statistics.cc + + + +# #src_testsuite_test_global_preferences_serialization_CPPFLAGS = \ +# # -I@top_srcdir@/src/backend \ +# # $(GLIBMM_CFLAGS) +# #src_testsuite_test_global_preferences_serialization_LDFLAGS = \ +# # src/backend/libbackend.la \ +# # -Wl,-rpath -Wl,"$(pkglibdir)" \ +# # $(GLIBMM_LIBS) +# #src_testsuite_test_global_preferences_serialization_SOURCES = \ +# # src/testsuite/test-global_preferences_serialization.cc + +# src_testsuite_test_key_file_CPPFLAGS = \ +# -I@top_srcdir@/src/backend \ +# $(GLIBMM_CFLAGS) +# src_testsuite_test_key_file_LDFLAGS = \ +# -Wl,-rpath -Wl,"$(pkglibdir)" \ +# src/backend/libbackend.la \ +# $(GLIBMM_LIBS) +# src_testsuite_test_key_file_SOURCES = \ +# src/testsuite/test-key_file.cc + +# src_testsuite_test_cairo_widget_CPPFLAGS = \ +# -I@top_srcdir@/src \ +# -I@top_srcdir@/src/backend \ +# $(CAIROMM_CFLAGS) \ +# $(GTKMM_CFLAGS) \ +# $(GLIBMM_CFLAGS) +# src_testsuite_test_cairo_widget_LDFLAGS = \ +# $(CAIROMM_LIBS) \ +# $(GTKMM_LIBS) \ +# $(GLIBMM_LIBS) +# src_testsuite_test_cairo_widget_SOURCES = \ +# src/cairo_elements.cc \ +# src/cairo_widget.cc \ +# src/testsuite/test-cairo_widget.cc + +# src_testsuite_test_simulation_widget_CPPFLAGS = \ +# -I@top_srcdir@/src \ +# -I@top_srcdir@/src/backend \ +# $(CAIROMM_CFLAGS) \ +# $(GTKMM_CFLAGS) \ +# $(GLIBMM_CFLAGS) \ +# $(GTHREAD_CFLAGS) +# src_testsuite_test_simulation_widget_LDFLAGS = \ +# src/backend/libbackend.la \ +# -Wl,-rpath -Wl,"$(pkglibdir)" \ +# $(CAIROMM_LIBS) \ +# $(GTKMM_LIBS) \ +# $(GLIBMM_LIBS) \ +# $(GTHREAD_LIBS) +# src_testsuite_test_simulation_widget_SOURCES = \ +# src/cairo_elements.cc \ +# src/cairo_widget.cc \ +# src/simulation_widget.cc \ +# src/testsuite/test-simulation_widget.cc + +# src_testsuite_test_holt_widget_CPPFLAGS = \ +# -I@top_srcdir@/src \ +# -I@top_srcdir@/src/backend \ +# $(CAIROMM_CFLAGS) \ +# $(GTKMM_CFLAGS) \ +# $(GLIBMM_CFLAGS) \ +# $(GTHREAD_CFLAGS) +# src_testsuite_test_holt_widget_LDFLAGS = \ +# src/backend/libbackend.la \ +# -Wl,-rpath -Wl,"$(pkglibdir)" \ +# $(CAIROMM_LIBS) \ +# $(GTKMM_LIBS) \ +# $(GLIBMM_LIBS) \ +# $(GTHREAD_LIBS) +# src_testsuite_test_holt_widget_SOURCES = \ +# src/cairo_elements.cc \ +# src/cairo_widget.cc \ +# src/simulation_widget.cc \ +# src/holt_container_window.cc \ +# src/holt_widget.cc \ +# src/testsuite/test-holt_widget.cc + +# #src_testsuite_test_parse_command_CPPFLAGS = \ +# # -I@top_srcdir@/src \ +# # -I@top_srcdir@/src/templates \ +# # $(GLIBMM_CFLAGS) +# #src_testsuite_test_parse_command_LDFLAGS = \ +# # src/backend/libbackend.la \ +# # -Wl,-rpath -Wl,"$(pkglibdir)" \ +# # $(GLIBMM_LIBS) +# #src_testsuite_test_parse_command_SOURCES = \ +# # src/testsuite/test-parse_command.cc + + +# # advice: get dummy_policy from the somewhere in the repository, and compile it in. +# #src_testsuite_test_stepforward_CPPFLAGS = \ +# # -I@top_srcdir@/src \ +# # -I@top_srcdir@/src/templates \ +# # $(GLIBMM_CFLAGS) +# #src_testsuite_test_stepforward_LDFLAGS = \ +# # src/backend/libbackend.la \ +# # -Wl,-rpath -Wl,"$(pkglibdir)" \ +# # $(GLIBMM_LIBS) +# #src_testsuite_test_stepforward_SOURCES = \ +# # src/testsuite/stubs/history.cc \ +# # src/testsuite/stubs/prrpolicy.cc \ +# # src/testsuite/stubs/policy_manager.cc \ +# # src/backend/scheduler.cc \ +# # src/testsuite/test-stepforward.cc + + +# # Workaround an automake bug that leaves behind some files +# # while it's finishing the distcheck target +# CLEANFILES += \ +# src/testsuite/.libs/test-cairo_widget \ +# src/testsuite/.libs/test-history \ +# src/testsuite/.libs/test-holt_widget \ +# src/testsuite/.libs/test-key_file \ +# src/testsuite/.libs/test-simulation_widget \ +# src/testsuite/.libs/test-statistics + +# # disabled: +# # src/testsuite/.libs/test-global_preferences_serialization + +# endif #~ if COND_TESTS + +# # ############################################################ +# # +# # extra files to distribute +# # +# # ############################################################ + +# noinst_DATA += \ +# src/testsuite/scheduling-wizards/wizard-deadlock-test \ +# src/testsuite/scheduling-wizards/wizard-gap-fail \ +# src/testsuite/scheduling-wizards/wizard-assert-fail \ +# src/testsuite/scheduling-wizards/wizard-unblock-test \ +# src/testsuite/scheduling-wizards/wizard-complex-test \ +# src/testsuite/scheduling-wizards/wizard-priority-inversion-porno \ +# src/testsuite/scheduling-wizards/wizard-priority-preemption-fail \ +# src/testsuite/scheduling-wizards/wizard-block-fail + +# examples_DATA = \ +# src/testsuite/scheduling-wizards/environments/Colori_rr_prio_1_2.xgp \ +# src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp \ +# src/testsuite/scheduling-wizards/environments/Ducks_rr_2.xgp \ +# src/testsuite/scheduling-wizards/environments/FruitsBasket_complex.xgp \ +# src/testsuite/scheduling-wizards/environments/Fantozzi_lifo_requests.xgp \ +# src/testsuite/scheduling-wizards/environments/Matteo_deadlock.xgp \ +# src/testsuite/scheduling-wizards/environments/Matteo_preemption_fail.xgp \ +# src/testsuite/scheduling-wizards/environments/Modernita_gap_terminated.xgp \ +# src/testsuite/scheduling-wizards/environments/MyAutoDeadlock.xgp \ +# src/testsuite/scheduling-wizards/environments/Pensieri_fcfs.xgp \ +# src/testsuite/scheduling-wizards/environments/Porno_priority_inversion.xgp \ +# src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_block_fail.xgp \ +# src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_blocked.xgp \ +# src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_assert_fail.xgp \ +# src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_fail.xgp \ +# src/testsuite/scheduling-wizards/environments/TheSecretOfMonkeyIsland.xgp + +# EXTRA_DIST += $(noinst_DATA) $(examples_DATA) + +# ------------------------------------------- + +install(FILES data/logo.png + ui/add-process-dialog.ui + ui/add-request-dialog.ui + ui/add-resource-dialog.ui + ui/add-thread-dialog.ui + ui/configure-dialog.ui + ui/jump-to-dialog.ui + ui/main-window.ui + ui/statistics-window.ui + DESTINATION ${uidir}) + +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/sgpemv2.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/sgpemv2.png + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons) + +# TODO: create the export set diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 8b82ade..0000000 --- a/INSTALL +++ /dev/null @@ -1,291 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 6. Often, you can also type `make uninstall' to remove the installed - files again. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index c625015..0000000 --- a/Makefile.am +++ /dev/null @@ -1,666 +0,0 @@ -# Makefile.am - Copyright 2005, 2006, University -# of Padova, dept. of Pure and Applied -# Mathematics -# -# This file is part of SGPEMv2. -# -# This is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# SGPEMv2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - - - -# extra calls -.PHONY : apidox generate-extra-images - -# this should be the only recursive call inside sgpemv2 main pkg -# please note the "." directory _has_ to come first, before plugins -SUBDIRS = . po - -# ################################# # -# Additional directories building: # -# ################################# # - -# allow building of provided plugins -# FIXME: how to make this dynamic? e.g. for plugins/* ? -SUBDIRS += \ - plugins/pyloader \ - plugins/xmlsave - -datarootdir = @datarootdir@ -sharedir = $(pkgdatadir) -examplesdir = $(sharedir)/examples -policiesdir = $(sharedir)/policies -plugindir = $(sharedir)/plugins -uidir = $(sharedir)/ui - -applicationsdir = @datadir@/applications -iconsdir = @datadir@/pixmaps -localedir = @datadir@/locale -aclocaldir = @datadir@/aclocal - -# used for installing templates include files -templatesdir = $(pkgincludedir)/templates - -#define empty global variables -bin_PROGRAMS = -pkglib_LTLIBRARIES = -plugin_LTLIBRARIES = -noinst_HEADERS = -noinst_DATA = -pkginclude_HEADERS = -templates_HEADERS = -EXTRA_DIST = -MAINTAINERCLEANFILES = -MOSTLYCLEANFILES = -CLEANFILES = - -# ############################################################ -# -# extra dist, cleanup and automake/aclocal flags -# -# ############################################################ - -ACLOCAL_AMFLAGS = -I m4 --install - -install_macros = \ - m4/sgpemv2-dirs.m4 -macros = \ - m4/compilerflags.m4 \ - m4/linkingflags.m4 - -distro_files = \ - distro/deb/control-file-v1.0 \ - distro/deb/build.sh \ - distro/deb/readme.txt \ - distro/ebuild/sgpemv2-1.0.ebuild \ - distro/rpm/SPECS/sgpemv2-1.0.spec \ - distro/rpm/readme.txt \ - distro/win32/pyloader.vcproj \ - distro/win32/sgpemv2.vcproj \ - distro/win32/backend.vcproj \ - distro/win32/config/config.h \ - distro/win32/xmlsave.vcproj \ - distro/win32/sgpemv2.sln \ - distro/win32/_sgpem.vcproj - -EXTRA_DIST += \ - gettext.h \ - $(install_macros) \ - $(macros) \ - $(distro_files) - -aclocal_DATA = $(install_macros) - -MAINTAINERCLEANFILES += doc/API - -# ############################################################ -# -# desktop files and other distribution data -# -# ############################################################ - -pkgconfdir = $(libdir)/pkgconfig -pkgconf_DATA = config/sgpemv2.pc - -applications_DATA = data/sgpemv2.desktop -icons_DATA = data/scc-sgpemv2.png - -EXTRA_DIST += $(applications_DATA) $(icons_DATA) - -# ############################################################ -# -# documentation -# -# ############################################################ - -info_TEXINFOS = \ - doc/sgpem2uman.texi \ - doc/sgpem2dman.texi - -sgpem2uman_TEXINFOS = $(licenses) doc/vers-uman.texi -sgpem2dman_TEXINFOS = $(licenses) doc/vers-dman.texi - -licenses = doc/fdl.texi doc/gpl.texi - -EXTRA_DIST += $(licenses) - - -# Images for the documentation -gif_images = \ - doc/holt_circle.gif \ - doc/main-window.gif \ - doc/simulation_widget.gif -text_images = \ - doc/main-window.txt - -# Generate all kind of images needed by texinfo via convert -%.pdf : %.gif - convert "$<" "$(top_srcdir)/$@" -%.eps : %.gif - convert "$<" "$(top_srcdir)/$@" - -EXTRA_DIST += $(gif_images:%.gif=%.eps) \ - $(gif_images:%.gif=%.pdf) \ - $(text_images) - -apidox : - test -d 'doc/API' || mkdir -p -- 'doc/API' -if HAVE_DOXYGEN - doxygen config/Doxyfile -else - @echo "** Doxygen not installed. Skipping generating API docs." -endif - - -distclean-local : - if test -d 'doc/API'; then rm -rf 'doc/API'; fi - -# ############################################################ -# -# source : libbackend.la -# -# ############################################################ - -# Program & library names -pkglib_LTLIBRARIES += src/backend/libbackend.la - -src_backend_libbackend_la_CPPFLAGS = \ - -I@top_srcdir@ \ - -I@top_srcdir@/src/backend \ - -DPOLDIR="\"$(policiesdir)\"" \ - -DPLUGDIR="\"$(plugindir)\"" \ - -DLOCALEDIR="\"$(localedir)\"" \ - $(GLIBMM_CFLAGS) -src_backend_libbackend_la_CXXFLAGS = \ - $(VISIB_HIDDEN) -src_backend_libbackend_la_LDFLAGS = \ - $(GLIBMM_LDFLAGS) \ - $(LT_LDFLAGS) \ - -version-info 1:0:0 \ - -export-dynamic -src_backend_libbackend_la_LIBADD = \ - $(GLIBMM_LIBS) - -# Please keep this in sorted order: -src_backend_libbackend_la_SOURCES = \ - src/backend/concrete_environment.cc \ - src/backend/concrete_history.cc \ - src/backend/concrete_process_statistics.cc \ - src/backend/concrete_simulation.cc \ - src/backend/concrete_simulation_statistics.cc \ - src/backend/concrete_statistics.cc \ - src/backend/concrete_thread_statistics.cc \ - src/backend/cpp_resource_policy_manager.cc \ - src/backend/cpu_policies_gatekeeper.cc \ - src/backend/cpu_policy.cc \ - src/backend/cpu_policy_exception.cc \ - src/backend/cpu_policy_manager.cc \ - src/backend/dynamic_process.cc \ - src/backend/dynamic_request.cc \ - src/backend/dynamic_resource.cc \ - src/backend/dynamic_schedulable.cc \ - src/backend/dynamic_sub_request.cc \ - src/backend/dynamic_thread.cc \ - src/backend/environment.cc \ - src/backend/global_preferences.cc \ - src/backend/history.cc \ - src/backend/history_observer.cc \ - src/backend/invalid_plugin_exception.cc \ - src/backend/key_file.cc \ - src/backend/malformed_policy_exception.cc \ - src/backend/module.cc \ - src/backend/null_policy_exception.cc \ - src/backend/plugin_manager.cc \ - src/backend/policy_parameters.cc \ - src/backend/process.cc \ - src/backend/process_statistics.cc \ - src/backend/ready_queue.cc \ - src/backend/request.cc \ - src/backend/resource.cc \ - src/backend/resource_policies_gatekeeper.cc \ - src/backend/resource_policy.cc \ - src/backend/resource_policy_fifo.cc \ - src/backend/resource_policy_lifo.cc \ - src/backend/resource_policy_manager.cc \ - src/backend/resource_policy_priority.cc \ - src/backend/resource_policy_priority_inheritance.cc \ - src/backend/schedulable.cc \ - src/backend/schedulable_statistics.cc \ - src/backend/scheduler.cc \ - src/backend/serialize_visitor.cc \ - src/backend/serializer.cc \ - src/backend/serializer_error.cc \ - src/backend/serializers_gatekeeper.cc \ - src/backend/simulation.cc \ - src/backend/simulation_observer.cc \ - src/backend/simulation_statistics.cc \ - src/backend/static_process.cc \ - src/backend/static_request.cc \ - src/backend/static_resource.cc \ - src/backend/static_schedulable.cc \ - src/backend/static_sub_request.cc \ - src/backend/static_thread.cc \ - src/backend/statistics.cc \ - src/backend/string_utils.cc \ - src/backend/sub_request.cc \ - src/backend/thread.cc \ - src/backend/thread_statistics.cc \ - src/backend/user_interrupt_exception.cc - -# Put here header files that will be installed for the user -# For headers used internally by the backend, see below. -# Please note that the first listed header is generated by -# configure. -pkginclude_HEADERS += \ - src/backend/sgpemv2/cpu_policies_gatekeeper.hh \ - src/backend/sgpemv2/cpu_policy.hh \ - src/backend/sgpemv2/cpu_policy_exception.hh \ - src/backend/sgpemv2/cpu_policy_manager.hh \ - src/backend/sgpemv2/environment.hh \ - src/backend/sgpemv2/global_preferences.hh \ - src/backend/sgpemv2/history.hh \ - src/backend/sgpemv2/history_observer.hh \ - src/backend/sgpemv2/invalid_plugin_exception.hh \ - src/backend/sgpemv2/key_file.hh \ - src/backend/sgpemv2/malformed_policy_exception.hh \ - src/backend/sgpemv2/module.hh \ - src/backend/sgpemv2/null_policy_exception.hh \ - src/backend/sgpemv2/policy_parameters.hh \ - src/backend/sgpemv2/plugin.hh \ - src/backend/sgpemv2/plugin_manager.hh \ - src/backend/sgpemv2/process_statistics.hh \ - src/backend/sgpemv2/ready_queue.hh \ - src/backend/sgpemv2/request.hh \ - src/backend/sgpemv2/resource.hh \ - src/backend/sgpemv2/resource_policies_gatekeeper.hh \ - src/backend/sgpemv2/resource_policy.hh \ - src/backend/sgpemv2/resource_policy_manager.hh \ - src/backend/sgpemv2/process.hh \ - src/backend/sgpemv2/schedulable.hh \ - src/backend/sgpemv2/schedulable_statistics.hh \ - src/backend/sgpemv2/scheduler.hh \ - src/backend/sgpemv2/serialize_visitor.hh \ - src/backend/sgpemv2/serializer.hh \ - src/backend/sgpemv2/serializer_error.hh \ - src/backend/sgpemv2/serializers_gatekeeper.hh \ - src/backend/sgpemv2/sgpemv2-visibility.hh \ - src/backend/sgpemv2/simulation.hh \ - src/backend/sgpemv2/simulation_observer.hh \ - src/backend/sgpemv2/simulation_statistics.hh \ - src/backend/sgpemv2/statistics.hh \ - src/backend/sgpemv2/string_utils.hh \ - src/backend/sgpemv2/sub_request.hh \ - src/backend/sgpemv2/thread.hh \ - src/backend/sgpemv2/thread_statistics.hh \ - src/backend/sgpemv2/user_interrupt_exception.hh - - -# Put here headers used internally by the backend -# They won't be installed for the end-user. -noinst_HEADERS += \ - src/backend/cpp_resource_policy_manager.hh \ - src/backend/concrete_environment.hh \ - src/backend/concrete_history.hh \ - src/backend/concrete_process_statistics.hh \ - src/backend/concrete_simulation.hh \ - src/backend/concrete_simulation_statistics.hh \ - src/backend/concrete_statistics.hh \ - src/backend/concrete_thread_statistics.hh \ - src/backend/dynamic_process.hh \ - src/backend/dynamic_request.hh \ - src/backend/dynamic_resource.hh \ - src/backend/dynamic_schedulable.hh \ - src/backend/dynamic_sub_request.hh \ - src/backend/dynamic_thread.hh \ - src/backend/resource_policy_fifo.hh \ - src/backend/resource_policy_lifo.hh \ - src/backend/resource_policy_priority.hh \ - src/backend/resource_policy_priority_inheritance.hh \ - src/backend/static_process.hh \ - src/backend/static_request.hh \ - src/backend/static_resource.hh \ - src/backend/static_schedulable.hh \ - src/backend/static_sub_request.hh \ - src/backend/static_thread.hh - - - -# ############################################################ -# -# source : main executable -# -# ############################################################ - -# Program & library names -bin_PROGRAMS += sgpemv2 - -sgpemv2_CPPFLAGS = \ - -I@top_srcdir@ \ - -I@top_srcdir@/src/backend \ - -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \ - -DEXAMPLESDIR="\"$(examplesdir)\"" \ - -DLOCALEDIR="\"$(localedir)\"" \ - -DSHAREDIR="\"$(sharedir)\"" \ - -DUIDIR="\"$(uidir)\"" \ - $(CAIROMM_CFLAGS) \ - $(GTKMM_CFLAGS) \ - $(LIBGLADEMM_CFLAGS) \ - $(GTHREAD_CFLAGS) -sgpemv2_CXXFLAGS = \ - $(VISIB_HIDDEN) -sgpemv2_LDFLAGS = \ - -Wl,-rpath -Wl,"$(pkglibdir)" -sgpemv2_LDADD = \ - src/backend/libbackend.la \ - $(CAIROMM_LIBS) \ - $(GTKMM_LIBS) \ - $(GTHREAD_LIBS) - -# Please keep this in sorted order: -sgpemv2_SOURCES = \ - src/add_request_dialog.cc \ - src/cairo_elements.cc \ - src/cairo_widget.cc \ - src/configure_policy_dialog.cc \ - src/graphical_preferences_editor.cc \ - src/gui_builder.cc \ - src/holt_container_window.cc \ - src/holt_widget.cc \ - src/jump_to_dialog.cc \ - src/main.cc \ - src/parse_opts.cc \ - src/ready_queue_widget.cc \ - src/resources_widget.cc \ - src/schedulables_statistics_widget.cc \ - src/schedulables_tree_widget.cc \ - src/simulation_controller.cc \ - src/simulation_statistics_widget.cc \ - src/simulation_widget.cc \ - src/statistics_container_window.cc \ - src/text_simulation.cc - -noinst_HEADERS += \ - src/add_request_dialog.hh \ - src/cairo_elements.hh \ - src/cairo_widget.hh \ - src/configure_policy_dialog.hh \ - src/graphical_preferences_editor.hh \ - src/gui_builder.hh \ - src/holt_container_window.hh \ - src/holt_widget.hh \ - src/jump_to_dialog.hh \ - src/main.hh \ - src/parse_opts.hh \ - src/ready_queue_widget.hh \ - src/resources_widget.hh \ - src/schedulables_statistics_widget.hh \ - src/schedulables_tree_widget.hh \ - src/schedulables_statistics_widget.hh \ - src/simulation_controller.hh \ - src/simulation_statistics_widget.hh \ - src/simulation_widget.hh \ - src/statistics_container_window.hh \ - src/text_simulation.hh - -# ---------- gtkbuilder xml files ----------- - -ui_DATA = \ - data/logo.png \ - ui/add-process-dialog.ui \ - ui/add-request-dialog.ui \ - ui/add-resource-dialog.ui \ - ui/add-thread-dialog.ui \ - ui/configure-dialog.ui \ - ui/jump-to-dialog.ui \ - ui/main-window.ui \ - ui/statistics-window.ui - -EXTRA_DIST += $(ui_DATA) - -# ############################################################ -# -# source : templates -# -# ############################################################ - -templates_HEADERS += \ - src/backend/sgpemv2/templates/deletor.tcc \ - src/backend/sgpemv2/templates/down_cast.tcc \ - src/backend/sgpemv2/templates/parameter.tcc \ - src/backend/sgpemv2/templates/sequences.tcc \ - src/backend/sgpemv2/templates/singleton.hh \ - src/backend/sgpemv2/templates/singleton.tcc \ - src/backend/sgpemv2/templates/smartp.hh \ - src/backend/sgpemv2/templates/smartp.tcc - -# ############################################################ -# -# check : testsuite -# -# ############################################################ - -if COND_TESTS - -# DEJATOOL = src/testsuite/example-test.exp - -noinst_PROGRAMS = \ - src/testsuite/test-cairo_widget \ - src/testsuite/test-history \ - src/testsuite/test-holt_widget \ - src/testsuite/test-key_file \ - src/testsuite/test-simulation_widget \ - src/testsuite/test-statistics -# disable : -# src/testsuite/test-global_preferences_serialization -# src/testsuite/test-parse_command -# src/testsuite/test-stepforward - -src_testsuite_test_history_CPPFLAGS = \ - -I@top_srcdir@/src/backend \ - $(GLIBMM_CFLAGS) -src_testsuite_test_history_LDFLAGS = \ - -Wl,-rpath -Wl,"$(pkglibdir)" \ - src/backend/libbackend.la \ - $(GLIBMM_LIBS) -src_testsuite_test_history_SOURCES = \ - src/backend/concrete_environment.cc \ - src/backend/concrete_history.cc \ - src/backend/dynamic_process.cc \ - src/backend/dynamic_request.cc \ - src/backend/dynamic_resource.cc \ - src/backend/dynamic_schedulable.cc \ - src/backend/dynamic_sub_request.cc \ - src/backend/dynamic_thread.cc \ - src/backend/static_process.cc \ - src/backend/static_request.cc \ - src/backend/static_resource.cc \ - src/backend/static_schedulable.cc \ - src/backend/static_sub_request.cc \ - src/backend/static_thread.cc \ - src/testsuite/test-history.cc - - -src_testsuite_test_statistics_CPPFLAGS = \ - -I@top_srcdir@/src/backend \ - $(GLIBMM_CFLAGS) $(GTHREAD_CFLAGS) -src_testsuite_test_statistics_LDFLAGS = \ - -Wl,-rpath -Wl,"$(pkglibdir)" \ - src/backend/libbackend.la \ - $(GLIBMM_LIBS) $(GTHREAD_LIBS) -src_testsuite_test_statistics_SOURCES = \ - src/backend/statistics.cc \ - src/backend/concrete_process_statistics.cc \ - src/backend/concrete_thread_statistics.cc \ - src/backend/concrete_simulation_statistics.cc \ - src/backend/concrete_statistics.cc \ - src/testsuite/test-statistics.cc - - - -#src_testsuite_test_global_preferences_serialization_CPPFLAGS = \ -# -I@top_srcdir@/src/backend \ -# $(GLIBMM_CFLAGS) -#src_testsuite_test_global_preferences_serialization_LDFLAGS = \ -# src/backend/libbackend.la \ -# -Wl,-rpath -Wl,"$(pkglibdir)" \ -# $(GLIBMM_LIBS) -#src_testsuite_test_global_preferences_serialization_SOURCES = \ -# src/testsuite/test-global_preferences_serialization.cc - -src_testsuite_test_key_file_CPPFLAGS = \ - -I@top_srcdir@/src/backend \ - $(GLIBMM_CFLAGS) -src_testsuite_test_key_file_LDFLAGS = \ - -Wl,-rpath -Wl,"$(pkglibdir)" \ - src/backend/libbackend.la \ - $(GLIBMM_LIBS) -src_testsuite_test_key_file_SOURCES = \ - src/testsuite/test-key_file.cc - -src_testsuite_test_cairo_widget_CPPFLAGS = \ - -I@top_srcdir@/src \ - -I@top_srcdir@/src/backend \ - $(CAIROMM_CFLAGS) \ - $(GTKMM_CFLAGS) \ - $(GLIBMM_CFLAGS) -src_testsuite_test_cairo_widget_LDFLAGS = \ - $(CAIROMM_LIBS) \ - $(GTKMM_LIBS) \ - $(GLIBMM_LIBS) -src_testsuite_test_cairo_widget_SOURCES = \ - src/cairo_elements.cc \ - src/cairo_widget.cc \ - src/testsuite/test-cairo_widget.cc - -src_testsuite_test_simulation_widget_CPPFLAGS = \ - -I@top_srcdir@/src \ - -I@top_srcdir@/src/backend \ - $(CAIROMM_CFLAGS) \ - $(GTKMM_CFLAGS) \ - $(GLIBMM_CFLAGS) \ - $(GTHREAD_CFLAGS) -src_testsuite_test_simulation_widget_LDFLAGS = \ - src/backend/libbackend.la \ - -Wl,-rpath -Wl,"$(pkglibdir)" \ - $(CAIROMM_LIBS) \ - $(GTKMM_LIBS) \ - $(GLIBMM_LIBS) \ - $(GTHREAD_LIBS) -src_testsuite_test_simulation_widget_SOURCES = \ - src/cairo_elements.cc \ - src/cairo_widget.cc \ - src/simulation_widget.cc \ - src/testsuite/test-simulation_widget.cc - -src_testsuite_test_holt_widget_CPPFLAGS = \ - -I@top_srcdir@/src \ - -I@top_srcdir@/src/backend \ - $(CAIROMM_CFLAGS) \ - $(GTKMM_CFLAGS) \ - $(GLIBMM_CFLAGS) \ - $(GTHREAD_CFLAGS) -src_testsuite_test_holt_widget_LDFLAGS = \ - src/backend/libbackend.la \ - -Wl,-rpath -Wl,"$(pkglibdir)" \ - $(CAIROMM_LIBS) \ - $(GTKMM_LIBS) \ - $(GLIBMM_LIBS) \ - $(GTHREAD_LIBS) -src_testsuite_test_holt_widget_SOURCES = \ - src/cairo_elements.cc \ - src/cairo_widget.cc \ - src/simulation_widget.cc \ - src/holt_container_window.cc \ - src/holt_widget.cc \ - src/testsuite/test-holt_widget.cc - -#src_testsuite_test_parse_command_CPPFLAGS = \ -# -I@top_srcdir@/src \ -# -I@top_srcdir@/src/templates \ -# $(GLIBMM_CFLAGS) -#src_testsuite_test_parse_command_LDFLAGS = \ -# src/backend/libbackend.la \ -# -Wl,-rpath -Wl,"$(pkglibdir)" \ -# $(GLIBMM_LIBS) -#src_testsuite_test_parse_command_SOURCES = \ -# src/testsuite/test-parse_command.cc - - -# advice: get dummy_policy from the somewhere in the repository, and compile it in. -#src_testsuite_test_stepforward_CPPFLAGS = \ -# -I@top_srcdir@/src \ -# -I@top_srcdir@/src/templates \ -# $(GLIBMM_CFLAGS) -#src_testsuite_test_stepforward_LDFLAGS = \ -# src/backend/libbackend.la \ -# -Wl,-rpath -Wl,"$(pkglibdir)" \ -# $(GLIBMM_LIBS) -#src_testsuite_test_stepforward_SOURCES = \ -# src/testsuite/stubs/history.cc \ -# src/testsuite/stubs/prrpolicy.cc \ -# src/testsuite/stubs/policy_manager.cc \ -# src/backend/scheduler.cc \ -# src/testsuite/test-stepforward.cc - - -# Workaround an automake bug that leaves behind some files -# while it's finishing the distcheck target -CLEANFILES += \ - src/testsuite/.libs/test-cairo_widget \ - src/testsuite/.libs/test-history \ - src/testsuite/.libs/test-holt_widget \ - src/testsuite/.libs/test-key_file \ - src/testsuite/.libs/test-simulation_widget \ - src/testsuite/.libs/test-statistics - -# disabled: -# src/testsuite/.libs/test-global_preferences_serialization - -endif #~ if COND_TESTS - -# ############################################################ -# -# extra files to distribute -# -# ############################################################ - -noinst_DATA += \ - src/testsuite/scheduling-wizards/wizard-deadlock-test \ - src/testsuite/scheduling-wizards/wizard-gap-fail \ - src/testsuite/scheduling-wizards/wizard-assert-fail \ - src/testsuite/scheduling-wizards/wizard-unblock-test \ - src/testsuite/scheduling-wizards/wizard-complex-test \ - src/testsuite/scheduling-wizards/wizard-priority-inversion-porno \ - src/testsuite/scheduling-wizards/wizard-priority-preemption-fail \ - src/testsuite/scheduling-wizards/wizard-block-fail - -examples_DATA = \ - src/testsuite/scheduling-wizards/environments/Colori_rr_prio_1_2.xgp \ - src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp \ - src/testsuite/scheduling-wizards/environments/Ducks_rr_2.xgp \ - src/testsuite/scheduling-wizards/environments/FruitsBasket_complex.xgp \ - src/testsuite/scheduling-wizards/environments/Fantozzi_lifo_requests.xgp \ - src/testsuite/scheduling-wizards/environments/Matteo_deadlock.xgp \ - src/testsuite/scheduling-wizards/environments/Matteo_preemption_fail.xgp \ - src/testsuite/scheduling-wizards/environments/Modernita_gap_terminated.xgp \ - src/testsuite/scheduling-wizards/environments/MyAutoDeadlock.xgp \ - src/testsuite/scheduling-wizards/environments/Pensieri_fcfs.xgp \ - src/testsuite/scheduling-wizards/environments/Porno_priority_inversion.xgp \ - src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_block_fail.xgp \ - src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_blocked.xgp \ - src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_assert_fail.xgp \ - src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_fail.xgp \ - src/testsuite/scheduling-wizards/environments/TheSecretOfMonkeyIsland.xgp - -EXTRA_DIST += $(noinst_DATA) $(examples_DATA) - diff --git a/README b/README index 2374b45..434333b 100644 --- a/README +++ b/README @@ -9,18 +9,14 @@ For convenience, here's a short glance at the build process (while the manual isn't finished): in the source package root directory, type: - mkdir =build && cd =build - ../configure --prefix=/path/to/installation/dir - make - su -c "make install" + mkdir build && cd build + cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/installation/dir + cmake --build . + sudo cmake --build . --target install -if you want to generate API documentation via Doxygen: +if you want to generate API documentation via Doxygen and makeinfo: - make apidox - -if you want PDFs of the user and developer manuals, - - make pdf + make doc As simple as that. diff --git a/TODO b/TODO deleted file mode 100644 index e69de29..0000000 diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index ae4285c..0000000 --- a/autogen.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Changelog from SVN (svn2cl) -if [ -d .svn ]; then - if [ "x$no_log" != "x1" ]; then - # only recreate if we're in svn repository - echo "*info* creating ChangeLog from SVN history" - sh ./config/svn2cl.sh - curdir=`pwd` - for i in plugins/*; do - echo "Entering also in directory: ${i}" - cd "${i}" && sh ../../config/svn2cl.sh - cd ${curdir} - done - fi -fi -touch ChangeLog - -# run autoreconf -autoreconf -i --warnings=all -B m4 -v diff --git a/config/Doxyfile.in b/config/Doxyfile.in deleted file mode 100644 index 06444a3..0000000 --- a/config/Doxyfile.in +++ /dev/null @@ -1,1237 +0,0 @@ -# Doxyfile 1.4.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "@PACKAGE_NAME@" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @PACKAGE_VERSION@ - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/API/ - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = YES - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = @abs_top_srcdir@/src @abs_top_srcdir@/plugins - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = *.hh *.h *.cc *.c *.tcc *.py - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = */testsuite/* - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = @HAVE_DOT@ - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/config/indenter b/config/indenter deleted file mode 100755 index abae3c0..0000000 --- a/config/indenter +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -#find . -name "*.cc" -or -name "*.hh" -or -name "*.tcc" | \ -# xargs indent -v -sc -psl -bls -bad -bap -bbb -nsob \ -# -bli0 -cli0 -cbi0 -npcs -cs -nsaf -nsai -nsaw \ -# -nprs -i2 -lp -ppi2 -l80 -nbbo -hnl -ss -di8 -nbc - - -find . -name "*.cc" -or -name "*.hh" -or -name "*.tcc" | \ - xargs astyle --style=ansi -s2 -b -N -L -p -O -V \ - --mode=c diff --git a/config/sgpemv2-uninstalled.pc.in b/config/sgpemv2-uninstalled.pc.in deleted file mode 100644 index d1a81e5..0000000 --- a/config/sgpemv2-uninstalled.pc.in +++ /dev/null @@ -1,18 +0,0 @@ -# pkg-config configuration file for sgpemv2 - UNINSTALLED version -prefix=@prefix@ -exec_prefix=${prefix} -libdir=@abs_top_builddir@ -includedir=@abs_top_srcdir@/src/backend - -datarootdir=@datarootdir@ -policies_dir=@datadir@/@PACKAGE@/policies -plugins_dir=@datadir@/@PACKAGE@/plugins - -Name: SGPEMv2 -Description: An educational simulator for process scheduling and management -Version: @PACKAGE_VERSION@ -URL: http://www.math.unipd.it/ -Requires: glibmm-2.4 >= 2.8 gthread-2.0 >= 2.8 -Libs: -L${libdir}/src/backend -lbackend -Libs.private: -lglibmm-2.4 -lgthread-2.0 -Cflags: -I${includedir} diff --git a/config/sgpemv2.pc.in b/config/sgpemv2.pc.in deleted file mode 100644 index ebf8127..0000000 --- a/config/sgpemv2.pc.in +++ /dev/null @@ -1,18 +0,0 @@ -# pkg-config configuration file for sgpemv2 -prefix=@prefix@ -exec_prefix=${prefix} -libdir=@libdir@/@PACKAGE@ -includedir=${prefix}/include - -datarootdir=@datarootdir@ -policies_dir=@datadir@/@PACKAGE@/policies -plugins_dir=@datadir@/@PACKAGE@/plugins - -Name: SGPEMv2 -Description: An educational simulator for process scheduling and management -Version: @PACKAGE_VERSION@ -URL: http://www.math.unipd.it/ -Requires: glibmm-2.4 >= 2.8 gthread-2.0 >= 2.8 -Libs: -L${libdir} -lbackend -Libs.private: -lglibmm-2.4 -lgthread-2.0 -Cflags: -I${includedir} diff --git a/config/svn2cl.sh b/config/svn2cl.sh deleted file mode 100755 index bf89bb0..0000000 --- a/config/svn2cl.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh - -# svn2cl.sh - front end shell script for svn2cl.xsl, calls xsltproc -# with the correct parameters -# -# Copyright (C) 2005 Arthur de Jong. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# exit on any failures -set -e - -# svn2cl version -VERSION="0.3" - -# set default parameters -STRIPPREFIX=`basename $(pwd)` -LINELEN=75 -GROUPBYDAY="no" -INCLUDEREV="no" -CHANGELOG="ChangeLog" - -# do command line checking -prog=`basename $0` -while [ -n "$1" ] -do - case "$1" in - --strip-prefix) - STRIPPREFIX="$2" - shift 2 - ;; - --linelen) - LINELEN="$2"; - shift 2 - ;; - --group-by-day) - GROUPBYDAY="yes"; - shift - ;; - -r|--include-rev) - INCLUDEREV="yes"; - shift - ;; - -o|--output) - CHANGELOG="$2" - shift 2 - ;; - --stdout) - CHANGELOG="-" - shift - ;; - -V|--version) - echo "$prog $VERSION"; - echo "Written by Arthur de Jong." - echo "" - echo "Copyright (C) 2005 Arthur de Jong." - echo "This is free software; see the source for copying conditions. There is NO" - echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit 0 - ;; - -h|--help) - echo "Usage: $prog [OPTION]..." - echo "Generate a ChangeLog from a checked out subversion repository." - echo "" - echo " --strip-prefix NAME prefix to strip from all entries, defaults" - echo " to the name of the current directory" - echo " --linelen NUM maximum length of an output line" - echo " --group-by-day group changelog entries by day" - echo " -r, --include-rev include revision numbers" - echo " -o, --output FILE output to FILE instead of ChangeLog" - echo " -f, --file FILE alias for -o, --output" - echo " --stdout output to stdout instead of ChangeLog" - echo " -h, --help display this help and exit" - echo " -V, --version output version information and exit" - exit 0 - ;; - *) - echo "$prog: invalid option -- $1" - echo "Try \`$prog --help' for more information." - exit 1 - ;; - esac -done - -# find the directory that this script resides in -prog="$0" -while [ -h "$prog" ] -do - prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"` -done -dir=`dirname $prog` -dir=`cd $dir && pwd` -XSL="$dir/svn2cl.xsl" - -# redirect stdout to the changelog file if needed -if [ "x$CHANGELOG" != "x-" ] -then - exec > "$CHANGELOG" -fi - -# actually run the command we need -svn --verbose --xml log | \ - xsltproc --stringparam strip-prefix "$STRIPPREFIX" \ - --stringparam linelen $LINELEN \ - --stringparam groupbyday $GROUPBYDAY \ - --stringparam include-rev $INCLUDEREV \ - "$XSL" - diff --git a/config/svn2cl.xsl b/config/svn2cl.xsl deleted file mode 100644 index f4226b5..0000000 --- a/config/svn2cl.xsl +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 80ddc82..0000000 --- a/configure.ac +++ /dev/null @@ -1,169 +0,0 @@ -# configure.ac - Copyright 2005, University -# of Padova, dept. of Pure and Applied -# Mathematics -# -# This file is part of SGPEMv2. -# -# This is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# SGPEMv2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - - -dnl ----------------- CONFIGURE --------------------- - -AC_INIT([sgpemv2],[1.1],[matteo@member.fsf.org]) - -if test -f "`pwd`/configure.ac"; then - AC_MSG_FAILURE([ - ** This seems to be the pkg root directory. - ** Compiling here your sources is considered - ** as unpolite as exploring your nose with - ** your pinky whilst attending a wedding party. - ** Please create a new dir as described in - ** the README file, and then run configure - ** into it. If you think you've got it right, - ** please inform the mantainer of this error! - ** He'll thoroughfully bash his head on the wall.], - -1 ) -fi - -AC_USE_SYSTEM_EXTENSIONS -AC_CONFIG_AUX_DIR([config]) -AC_CONFIG_MACRO_DIR([m4]) - -AC_CANONICAL_TARGET - -dnl starting automake -AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects]) -AM_SILENT_RULES([yes]) - -dnl HACK to avoid multiple definition of macros when -dnl including spgemv2-config.h (autoheader generated) -AH_TOP([#if not defined PACKAGE]) -AH_BOTTOM([#endif]) - -dnl gettext & libtool -LT_INIT -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.17]) - -dnl various requisites -SIGCPP_VERSION=2.2.9 -GLIBMM_VERSION=2.32.0 -GTHREAD_VERSION=2.32.0 -GTKMM_VERSION=3.4.0 -CAIROMM_VERSION=1.10.0 - -dnl c++ compiler and flags -AC_PROG_CXX -AC_CHECK_CXXFLAG([CXXFLAGS], [Wall]) -AC_CHECK_CXXFLAG([CXXFLAGS], [pedantic]) -AC_CHECK_CXXFLAG([CXXFLAGS], [Wextra]) -AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-long-long]) -AC_CHECK_CXXFLAG([CXXFLAGS], [Wno-strict-aliasing]) -AC_CHECK_LDFLAG([LDFLAGS], [--as-needed]) - -dnl test for deprecated Gtk+ features, since 3.0 is coming up the pipe -AC_CHECK_CXXFLAG([CXXFLAGS], [DGTK_DISABLE_DEPRECATED]) -AC_CHECK_CXXFLAG([CXXFLAGS], [DGSEAL_ENABLE]) - -dnl see if we've to enable debug flags -AC_ARG_ENABLE([debug], - AS_HELP_STRING([--enable-debug], - [turn on debug compiler flags. Disabled by default]), - [enable_debug="$enableval"], [enable_debug="no"]) - -if test "$enable_debug" = "yes"; then - AC_CHECK_CXXFLAG([CXXFLAGS], [O0]) - AC_CHECK_CXXFLAG([CXXFLAGS], [g3]) -else - AC_CHECK_CXXFLAG([CXXFLAGS], [DNDEBUG]) -fi - -dnl see if we have to enable visibility support -AC_ARG_ENABLE([visibility-support], - AS_HELP_STRING([--enable-visibility-support], - [enable the new GCC visibility support; requires GCC >= 4.0 to work.]), - [enable_gcc_visibility="$enableval"], - [enable_gcc_visibility="yes"]) -AC_MSG_CHECKING([whether to use new GCC visibility attributes]) -AC_MSG_RESULT([$enable_gcc_visibility]) -if test "x$enable_gcc_visibility" = "xno"; then - CPPFLAGS="${CPPFLAGS} -DDISABLE_VISIBILITY_SUPPORT" -else - AC_CHECK_CXXFLAG([CXXFLAGS], [fvisibility-inlines-hidden]) -fi - - -AC_PROG_INSTALL - -dnl make -AC_PROG_MAKE_SET - -dnl check for gtkmm & cairo -PKG_PROG_PKG_CONFIG([0.19]) -if test -z "$PKG_CONFIG"; then - AC_MSG_ERROR([You may need to update your pkg-config installation]) -fi - -PKG_CHECK_MODULES([CAIROMM], - [cairomm-1.0 >= $CAIROMM_VERSION], - :, AC_MSG_ERROR([$CAIROMM_PKG_ERRORS])) -PKG_CHECK_MODULES([GTHREAD], - [gthread-2.0 >= $GTHREAD_VERSION], - :, AC_MSG_ERROR([$GTHREAD_PKG_ERRORS])) -PKG_CHECK_MODULES([SIGCPP], - [sigc++-2.0 >= $SIGCPP_VERSION], - :, AC_MSG_ERROR([$SIGCPP_PKG_ERRORS])) -PKG_CHECK_MODULES([GLIBMM], - [glibmm-2.4 >= $GLIBMM_VERSION], - :, AC_MSG_ERROR([$GLIBMM_PKG_ERRORS])) -PKG_CHECK_MODULES([GTKMM], - [gtkmm-3.0 >= $GTKMM_VERSION], - :, AC_MSG_ERROR([$GTKMM_PKG_ERRORS])) - -dnl check for Doxygen -AC_CHECK_PROG([HAVE_DOXYGEN],[doxygen],[yes]) -AC_CHECK_PROG([HAVE_DOT],[dot], [yes]) -AM_CONDITIONAL([HAVE_DOXYGEN],[test x$HAVE_DOXYGEN = xyes]) - -dnl see if we've to compile tests -AC_MSG_CHECKING([whether tests have to be built]) -AC_ARG_ENABLE([tests], - AS_HELP_STRING([--disable-tests], - [don't compile the tests provided with sgpemv2]), - [compile_tests="$enableval"], - [compile_tests="yes"]) -AC_MSG_RESULT([$compile_tests]) -AM_CONDITIONAL([COND_TESTS], [test "$compile_tests" = "yes"]) - -dnl output files -AC_CONFIG_FILES([config/Doxyfile config/sgpemv2.pc \ - config/sgpemv2-uninstalled.pc data/sgpemv2.desktop]) -AC_CONFIG_HEADERS([config.h:config.h.in]) - -# force include of configuration header in every compilation unit -CPPFLAGS="${CPPFLAGS} -include config.h" - -dnl configure plugin directories -dnl TODO: make this conditional -AC_CONFIG_FILES([plugins/pyloader/config/sgpemv2-uninstalled.pc:config/sgpemv2-uninstalled.pc.in]) -AC_CONFIG_FILES([plugins/xmlsave/config/sgpemv2-uninstalled.pc:config/sgpemv2-uninstalled.pc.in]) - -AC_CONFIG_SUBDIRS([plugins/pyloader plugins/xmlsave]) - -# Now, output this very package Makefiles: -AC_CONFIG_FILES([ - Makefile - po/Makefile.in -]) -AC_OUTPUT diff --git a/distro/deb/build.sh b/distro/deb/build.sh deleted file mode 100755 index 45c9cc8..0000000 --- a/distro/deb/build.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -curdir="$(pwd)" - -if [ "${1}" = "" ]; then - echo "You need to pass the control file as the first parameter of this script." - echo "Usage: ./build.sh " - exit -1 -fi - -pkgname="$( awk '/^Package/ { print $2; }' "${1}" )" -version="$( awk '/^Version/ { print $2; }' "${1}" )" - -echo "Building debian package from ${1}." - -tarname="${pkgname}-${version}.tar.bz2" -if [ ! -f "${tarname}" ]; then - echo "Please put the source package ${tarname} in this directory and launch me again." - exit -1 -fi - -tar -xvjf "${tarname}" -cd "${pkgname}-${version}" - -mkdir =build -cd =build - -CXXFLAGS="-O3 -pipe" ../configure --disable-tests --disable-debug --disable-static --prefix=/usr -make -make pdf - -destdir="${curdir}/inst-root" - -make DESTDIR="${destdir}" install-strip - -docdir="${destdir}/usr/share/doc/${pkgname}-${version}" -mkdir -p "${docdir}" -cp doc/sgpem2uman.pdf doc/sgpem2dman.pdf "${docdir}" - -cd .. -for i in AUTHORS NEWS README COPYING ChangeLog; do - gzip -c "${i}" > "${docdir}/${i}.gz" -done - -cd ${curdir} - -pkg_size="$( du -sk "${curdir}" | awk '{ print $1; }' )" - -mkdir -p "${destdir}/DEBIAN" -sed "s|@SIZE@|${pkg_size}|g" "$1" > "${destdir}/DEBIAN/control" - -dpkg -b "${destdir}" . - -rm -rf "${pkgname}-${version}" -rm -rf "${destdir}" diff --git a/distro/deb/control-file-v1.0 b/distro/deb/control-file-v1.0 deleted file mode 100644 index 7001ccc..0000000 --- a/distro/deb/control-file-v1.0 +++ /dev/null @@ -1,22 +0,0 @@ -Package: sgpemv2 -Version: 1.0 -Section: misc -Priority: optional -Architecture: i386 -Pre-Depends: libstdc++6 -Depends: libgtkmm-2.4-1c2a, libglademm-2.4-1c2a, libxml2 (>= 2.6.10), libcairo, python (>= 2.3), python (<< 2.5) -Installed-Size: @SIZE@ -Maintainer: Marco Trevisan -Provides: sgpemv2 -Description: A graphical process management simulator with educational purposes. - . - SGPEM is an Italian acronym, standing for "Simulatore della Gestione - dei Processi in un Elaboratore Multiprogrammato" (in English, "Process - Management Simulator for a Multitasking Computer"). It was initially - developed for use inside the "Operating Systems" teaching, part of the - Computer Science course of the University of Padova, Italy. - . - The aim of SGPEM is to provide an easy-to-use environment for simulating - process scheduling policies, and for assigning resources in a multitasking - computer. SGPEMv2 is an educational software, and it can help students - to better understand the functionality of operating systems. diff --git a/distro/deb/control-file-v1.1 b/distro/deb/control-file-v1.1 deleted file mode 100644 index 852350a..0000000 --- a/distro/deb/control-file-v1.1 +++ /dev/null @@ -1,22 +0,0 @@ -Package: sgpemv2 -Version: 1.1 -Section: misc -Priority: optional -Architecture: i386 -Pre-Depends: libstdc++6 -Depends: libgtkmm-2.4-1c2a (>= 2.12.1), libxml2 (>= 2.6.10), libcairo, python (>= 2.5) -Installed-Size: @SIZE@ -Maintainer: Matteo Settenvini -Provides: sgpemv2 -Description: A graphical process management simulator with educational purposes. - . - SGPEM is an Italian acronym, standing for "Simulatore della Gestione - dei Processi in un Elaboratore Multiprogrammato" (in English, "Process - Management Simulator for a Multitasking Computer"). It was initially - developed for use inside the "Operating Systems" teaching, part of the - Computer Science course of the University of Padova, Italy. - . - The aim of SGPEM is to provide an easy-to-use environment for simulating - process scheduling policies, and for assigning resources in a multitasking - computer. SGPEMv2 is an educational software, and it can help students - to better understand the functionality of operating systems. diff --git a/distro/deb/readme.txt b/distro/deb/readme.txt deleted file mode 100644 index ab8b68a..0000000 --- a/distro/deb/readme.txt +++ /dev/null @@ -1,17 +0,0 @@ - .deb files creation - +++++++++++++++++++ - -To create a debian package from a control file: - - * launch the script in this directory "./build.sh", - with the control file as a parameter. - * wait a lot of time - * cross fingers - * wait some more time - * uncross fingers (before they decide to go and - find a new job as tip-tap dancers in Siberia) - * rejoice! you've a package. - -For doubts or envy, tell Matteo. - -*** TODO: add script in .deb that calls ldconfig during postinst diff --git a/distro/ebuild/sgpemv2-1.0.ebuild b/distro/ebuild/sgpemv2-1.0.ebuild deleted file mode 100644 index 92ce75b..0000000 --- a/distro/ebuild/sgpemv2-1.0.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -DESCRIPTION="A graphical process management simulator for a multitasking -computer, developed with educational aims for Operating Systems courses at -universities" -HOMEPAGE="http://www.smoking-gnu.net/xhtml/projects.php?sgpemv2" -SRC_URI="http://www.smoking-gnu.net/res/tar-pit/sgpemv2/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86" -IUSE="debug doc" - -DEPEND=" - >=dev-cpp/gtkmm-2.8 - >=dev-cpp/glibmm-2.8 - >=dev-cpp/libglademm-2.6 - >=dev-libs/libxml2-2.6.10 - >=x11-libs/cairo-1.0 - >=dev-lang/swig-1.3 - >=dev-lang/python-2.3 - - doc? ( - app-doc/doxygen - app-text/tetex - sys-apps/texinfo - )" - -src_compile() { - if use debug; then - conf_opts="--enable-debug" - else - conf_opts="--disable-tests" - fi - - conf_opts="${conf_opts} --enable-visibility-support" - - mkdir build && cd build - - ../configure --prefix=/usr \ - --host=${CHOST} \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --datadir=/usr/share \ - --sysconfdir=/etc \ - --localstatedir=/var/lib \ - ${EXTRA_ECONF} ${conf_opts} || die "configure failed" - - emake || die "make all failed" - - if use doc; then - make pdf - fi -} - -src_install() { - dodoc AUTHORS COPYING NEWS README ChangeLog - - cd build - make install DESTDIR="${D}" - if use doc; then - dohtml -r doc/API/html/* - docinto manuals - dodoc doc/sgpem2dman.pdf doc/sgpem2uman.pdf - fi -} diff --git a/distro/rpm/SPECS/sgpemv2-1.0.spec b/distro/rpm/SPECS/sgpemv2-1.0.spec deleted file mode 100644 index 236f6a5..0000000 --- a/distro/rpm/SPECS/sgpemv2-1.0.spec +++ /dev/null @@ -1,114 +0,0 @@ - -# initial defines - -%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0) -%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0) -%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0) - -%define dist redhat -%define disttag rh - -%if %is_mandrake -%define dist mandrake -%define disttag mdk -%endif -%if %is_suse -%define dist suse -%define disttag suse -%endif -%if %is_fedora -%define dist fedora -%define disttag rhfc -%endif - -%define distver %(release="`rpm -q --queryformat='%{VERSION}' %{dist}-release 2> /dev/null | tr . : | sed s/://g`" ; if test $? != 0 ; then release="" ; fi ; echo "$release") - -# Please keep this file up-to-date for each release. -# See: http://www.rpm.org/max-rpm/p5208.html for an explanation. - -Summary: A graphical process management simulator for a multitasking computer -Name: sgpemv2 -Version: 1.0 -Release: 1.%{disttag} -Copyright: GPL-2 -Group: Applications/Engineering -Source0: http://www.smoking-gnu.net/res/tar-pit/sgpemv2/%{name}-%{version}.tar.bz2 -URL: http://www.smoking-gnu.net/xhtml/projects.php?sgpemv2 -Packager: Paolo Santi - -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%define _topdir %(curdir="`pwd`"; echo "$curdir") - -%description -SGPEM is an Italian acronym, standing for "Simulatore della Gestione -dei Processi in un Elaboratore Multiprogrammato" (in English, "Process -Management Simulator for a Multitasking Computer"). It was initially -developed for use inside the "Operating Systems" teaching, part of the -Computer Science course of the University of Padova, Italy. The aim of -SGPEM is to provide an easy-to-use environment for simulating process -scheduling policies, and for assigning resources in a multitasking -computer. SGPEMv2 is an educational software, and it can help students -to better understand the functionality of operating systems. - -%prep -%setup - -%build -cd ${RPM_BUILD_DIR}/${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} -mkdir build && cd build - -CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ -CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ -FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \ - ../configure --host=%{_host} --build=%{_build} \ - --target=%{_target_platform} \ - --program-prefix=%{?_program_prefix} \ - --prefix=%{_prefix} \ - --exec-prefix=%{_exec_prefix} \ - --bindir=%{_bindir} \ - --sbindir=%{_sbindir} \ - --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} \ - --includedir=%{_includedir} \ - --libdir=%{_libdir} \ - --libexecdir=%{_libexecdir} \ - --localstatedir=%{_localstatedir} \ - --sharedstatedir=%{_sharedstatedir} \ - --mandir=%{_mandir} \ - --infodir=%{_infodir} \ - --disable-tests \ - --disable-debug \ - --disable-rpath \ - --disable-static \ - --disable-visibility-support -make -make pdf - -%install -# create docdir: -documents="$RPM_BUILD_ROOT%{_docdir}/%{name}" -mkdir -p "${documents}" - -# install standard documentation: -cd ${RPM_BUILD_DIR}/${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} -cp AUTHORS COPYING NEWS ChangeLog "${documents}" - -# install everything else -cd build -make DESTDIR="${RPM_BUILD_ROOT}/${_prefix}" install-strip - -# install also pdf manuals -cp doc/sgpem2uman.pdf doc/sgpem2dman.pdf "${documents}" - -%files -%defattr(-,root,root) -# This works correctly because we're using a build root: -/ - -%clean -[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf "${RPM_BUILD_ROOT}" - -%changelog -* Tue Sep 14 2006 - matteo (at) member.fsf.org -- Prepare first release of SGPEMv2 and build rpm - diff --git a/distro/rpm/readme.txt b/distro/rpm/readme.txt deleted file mode 100644 index 696289a..0000000 --- a/distro/rpm/readme.txt +++ /dev/null @@ -1,12 +0,0 @@ - Building RPMs ------------------ - -Launch the build process like: - - rpmbuild -bb SPECS/sgpemv2-$(version).spec - -where $(version) is the version you want to build -a spec for. You'll need to put the source tbz2 into SOURCES. - -**** TODO: **** - - Explicitly list runtime dependencies diff --git a/distro/win32/_sgpem.vcproj b/distro/win32/_sgpem.vcproj deleted file mode 100644 index 616bdcb..0000000 --- a/distro/win32/_sgpem.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distro/win32/backend.vcproj b/distro/win32/backend.vcproj deleted file mode 100644 index 32f523a..0000000 --- a/distro/win32/backend.vcproj +++ /dev/null @@ -1,721 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distro/win32/config/config.h b/distro/win32/config/config.h deleted file mode 100644 index dc24c93..0000000 --- a/distro/win32/config/config.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SG_DLLEXPORT - #define SG_DLLEXPORT __declspec(dllexport) -#endif - -#ifndef SG_DLLLOCAL - #define SG_DLLLOCAL -#endif - -#ifndef PLUGDIR - #define PLUGDIR ".\\plugins" -#endif - -#ifndef POLDIR - #define POLDIR ".\\policies" -#endif - -#ifndef GLADEDIR - #define GLADEDIR ".\\glade" -#endif - -#ifndef SHAREDIR - #define SHAREDIR "\\plugins\\extras\\pyloader" -#endif \ No newline at end of file diff --git a/distro/win32/install.txt b/distro/win32/install.txt deleted file mode 100644 index a272e4e..0000000 --- a/distro/win32/install.txt +++ /dev/null @@ -1,11 +0,0 @@ -PREREQUISITES: -- gtk+-2.8.18 or later (development): http://gladewin32.sourceforge.net/modules/news/ -- gtkmm-2.8.8 or later (development): http://www.pcpm.ucl.ac.be/~gustin/win32_ports/binaries/gtkmm-devel-2.8.8-2.exe -- python-2.4: http://www.python.org/download/ -- SWIG: www.swig.org - -PROCEDURE: -- Be sure that environment variables are updated by the gtk+ and gtkmm installers -- Create a PYTHON_BASEPATH environment variable which points to the python installation directory -- Build. I've never been able to build with a Debug configuration because python doesn't ship -with a debug dll, but in debug it forces you to link against it. \ No newline at end of file diff --git a/distro/win32/pyloader.vcproj b/distro/win32/pyloader.vcproj deleted file mode 100644 index c249ac8..0000000 --- a/distro/win32/pyloader.vcproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distro/win32/sgpemv2.sln b/distro/win32/sgpemv2.sln deleted file mode 100644 index 00d59b9..0000000 --- a/distro/win32/sgpemv2.sln +++ /dev/null @@ -1,56 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "backend", "backend.vcproj", "{4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyloader", "pyloader.vcproj", "{4054CAB1-7F6D-4FC7-884D-9B823F996679}" - ProjectSection(ProjectDependencies) = postProject - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} = {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlsave", "xmlsave.vcproj", "{7B477FAB-6E10-4347-9244-AC15D3A36670}" - ProjectSection(ProjectDependencies) = postProject - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} = {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sgpemv2", "sgpemv2.vcproj", "{C0BAA36E-0699-4885-8123-9906CC7845E5}" - ProjectSection(ProjectDependencies) = postProject - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} = {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_sgpem", "_sgpem.vcproj", "{8B810FB6-B138-45B0-AB81-228076316780}" - ProjectSection(ProjectDependencies) = postProject - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} = {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.ActiveCfg = Debug|Win32 - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Debug|Win32.Build.0 = Debug|Win32 - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.ActiveCfg = Release|Win32 - {4183D2B3-B54F-4C91-AEFD-F68BB9B86C08}.Release|Win32.Build.0 = Release|Win32 - {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.ActiveCfg = Debug|Win32 - {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Debug|Win32.Build.0 = Debug|Win32 - {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.ActiveCfg = Release|Win32 - {4054CAB1-7F6D-4FC7-884D-9B823F996679}.Release|Win32.Build.0 = Release|Win32 - {7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.ActiveCfg = Debug|Win32 - {7B477FAB-6E10-4347-9244-AC15D3A36670}.Debug|Win32.Build.0 = Debug|Win32 - {7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.ActiveCfg = Release|Win32 - {7B477FAB-6E10-4347-9244-AC15D3A36670}.Release|Win32.Build.0 = Release|Win32 - {C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.ActiveCfg = Debug|Win32 - {C0BAA36E-0699-4885-8123-9906CC7845E5}.Debug|Win32.Build.0 = Debug|Win32 - {C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.ActiveCfg = Release|Win32 - {C0BAA36E-0699-4885-8123-9906CC7845E5}.Release|Win32.Build.0 = Release|Win32 - {8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.ActiveCfg = Debug|Win32 - {8B810FB6-B138-45B0-AB81-228076316780}.Debug|Win32.Build.0 = Debug|Win32 - {8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.ActiveCfg = Release|Win32 - {8B810FB6-B138-45B0-AB81-228076316780}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/distro/win32/sgpemv2.vcproj b/distro/win32/sgpemv2.vcproj deleted file mode 100644 index 6e30749..0000000 --- a/distro/win32/sgpemv2.vcproj +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distro/win32/xmlsave.vcproj b/distro/win32/xmlsave.vcproj deleted file mode 100644 index 762692a..0000000 --- a/distro/win32/xmlsave.vcproj +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/m4/compilerflags.m4 b/m4/compilerflags.m4 deleted file mode 100644 index a843dc6..0000000 --- a/m4/compilerflags.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl ************************************************** -dnl Copyright (C) 2004 Matteo Settenvini -dnl ************************************************** - -dnl ---------- AC_CHECK_CXXFLAG --------------------- -dnl This macro checks if a particular flag for the -dnl C++ compiler works. If it is so, it puts the flag -dnl into the first macro parameter. -dnl Example of usage : AC_CHECK_CXXFLAG([CXXFLAGS],[Wall]) -dnl ------------------------------------------------- -AC_DEFUN([AC_CHECK_CXXFLAG], -[ if test -z "$1" -o -z "$2"; then - AC_MSG_FAILURE([Wrong parameters passed to the m4 macro. -Please contact the package mantainer.]) - fi - AC_REQUIRE([AC_PROG_CXX])dnl - AC_MSG_CHECKING([whether $CXX supports the -$2 flag]) - ac_check_cxxflags=$CXXFLAGS - CXXFLAGS="-$2" - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([], [return 0;]), - [AC_MSG_RESULT([yes]) - CXXFLAGS="$ac_check_cxxflags" - $1="-$2 $[$1]" ], - [AC_MSG_RESULT([no]) - CXXFLAGS=$ac_check_cxxflags ] - ) - AC_LANG_POP -])dnl ------- AC_CHECK_CXXFLAG ---------------------- - - - -dnl ---------- AC_CHECK_CFLAG --------------------- -dnl This macro checks if a particular flag for the -dnl C compiler works. If it is so, it adds the flag -dnl into the first macro parameter. -dnl Example of usage : AC_CHECK_CFLAG([CFLAGS],[Wall]) -dnl ------------------------------------------------- -AC_DEFUN([AC_CHECK_CFLAG], -[ if test -z "$1" -o -z "$2"; then - AC_MSG_FAILURE([Wrong parameters passed to the m4 macro. -Please contact the package mantainer.]) - fi - AC_REQUIRE([AC_PROG_CC])dnl - AC_MSG_CHECKING([whether $CC supports the -$2 flag]) - ac_check_cflags=$CFLAGS - CFLAGS="-$2" - AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([], [return 0;]), - [AC_MSG_RESULT([yes]) - CFLAGS="$ac_check_cflags" - $1="-$2 $[$1]" ], - [AC_MSG_RESULT([no]) - CFLAGS=$ac_check_cflags ] - ) - AC_LANG_POP -])dnl ------- AC_CHECK_CFLAG ---------------------- - diff --git a/m4/linkingflags.m4 b/m4/linkingflags.m4 deleted file mode 100644 index 802cbe8..0000000 --- a/m4/linkingflags.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl ************************************************** -dnl Copyright (C) 2004 Matteo Settenvini -dnl ************************************************** - -dnl ---------- AX_CHECK_LDFLAG --------------------- -dnl This macro checks if a particular flag for the -dnl C++ compiler works. If it is so, it adds the flag -dnl to the end of the first parameter. -dnl Example of usage : AC_CHECK_LDFLAG([LDFLAGS],[--as-needed]) -dnl ------------------------------------------------- -AC_DEFUN([AC_CHECK_LDFLAG], -[ if test -z "$1" -o -z "$2"; then - AC_MSG_FAILURE([Wrong parameters passed to the m4 macro. -Please contact the package mantainer.]) - fi - AC_REQUIRE([AC_PROG_CC])dnl - AC_MSG_CHECKING([whether the linker supports the $2 flag]) - ac_check_ldflags=$LDFLAGS - LDFLAGS="-Wl,$2" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE( - AC_LANG_PROGRAM([], [return 0;]), - [AC_MSG_RESULT([yes]) - LDFLAGS=$ac_check_ldflags - $1="-Wl,$2 $[$1]" ], - [AC_MSG_RESULT([no]) - LDFLAGS=$ac_check_ldflags ] - ) - AC_LANG_POP -])dnl ------- AC_CHECK_LDFLAG ---------------------- - diff --git a/m4/sgpemv2-dirs.m4 b/m4/sgpemv2-dirs.m4 deleted file mode 100644 index 7495fc5..0000000 --- a/m4/sgpemv2-dirs.m4 +++ /dev/null @@ -1,81 +0,0 @@ -dnl m4/sgpemv2-dirs.m4 - Copyright 2005, 2006, University -dnl of Padova, dept. of Pure and Applied -dnl Mathematics -dnl -dnl This file is part of SGPEMv2. -dnl -dnl This is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3 of the License, or -dnl (at your option) any later version. -dnl -dnl SGPEMv2 is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - - -dnl ---------- AC_PROG_SGPEMV2 --------------------- -dnl -dnl Synopsis: AC_PROG_SGPEMV2([min_version]) -dnl -dnl This macro checks if sgpemv2 is installed, and -dnl AC_SUBSTs the following variables: -dnl -dnl SGPEMV2_CFLAGS -> necessary includes for compiling -dnl plugins -dnl SGPEMV2_LIBS -> libraries to link against when -dnl building a loadable plugin -dnl SGPEMV2_POLICIES_DIR -> global policies directory -dnl SGPEMV2_PLUGINS_DIR -> global plugins directory -dnl -dnl This is particularly useful for plugin installation. -dnl It takes a parameter which is the minimal version -dnl installed of sgpemv2 this macro checks for. -dnl The parameter is mandatory. -dnl -dnl Example of usage: AC_PROG_SGPEMV2([0.1]) -dnl ------------------------------------------------ -AC_DEFUN([AC_PROG_SGPEMV2], -[ - PKG_PROG_PKG_CONFIG([0.20]) - - if test "x$1" = "x"; then - AC_MSG_FAILURE([Wrong number of parameters passed to macro AC@&t@_PROG_SGPEMV2. Please contact this package mantainer.]) - fi - - _pkg_sgpemv2_module="sgpemv2 >= $1" - - PKG_CHECK_MODULES([SGPEMV2], [$_pkg_sgpemv2_module], - :, AC_MSG_ERROR([$SGPEMV2_PKG_ERRORS])) - - AC_MSG_CHECKING([for sgpemv2 compiler flags]) - AC_MSG_RESULT([$SGPEMV2_CFLAGS]) - - AC_MSG_CHECKING([for sgpemv2 linking flags]) - AC_MSG_RESULT([$SGPEMV2_LIBS]) - - AC_MSG_CHECKING([for sgpemv2 policies default installation directory]) - SGPEMV2_POLICIES_DIR=`$PKG_CONFIG --variable=policies_dir "$_pkg_sgpemv2_module" 2>/dev/null` - if test "x$SGPEMV2_POLICIES_DIR" = "x"; then - AC_MSG_ERROR([Unable to retrieve value]) - else - AC_MSG_RESULT([$SGPEMV2_POLICIES_DIR]) - fi - - AC_MSG_CHECKING([for sgpemv2 plugins default installation directory]) - SGPEMV2_PLUGINS_DIR=`$PKG_CONFIG --variable=plugins_dir "$_pkg_sgpemv2_module" 2>/dev/null` - if test "x$SGPEMV2_PLUGINS_DIR" = "x"; then - AC_MSG_ERROR([Unable to retrieve value]) - else - AC_MSG_RESULT([$SGPEMV2_PLUGINS_DIR]) - fi - - AC_SUBST([SGPEMV2_POLICIES_DIR]) - AC_SUBST([SGPEMV2_PLUGINS_DIR]) - -])dnl ------- AC_PROG_SGPEMV2 ---------------------- - diff --git a/m4/visibility.m4 b/m4/visibility.m4 deleted file mode 100644 index 2ff6330..0000000 --- a/m4/visibility.m4 +++ /dev/null @@ -1,52 +0,0 @@ -# visibility.m4 serial 1 (gettext-0.15) -dnl Copyright (C) 2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl Tests whether the compiler supports the command-line option -dnl -fvisibility=hidden and the function and variable attributes -dnl __attribute__((__visibility__("hidden"))) and -dnl __attribute__((__visibility__("default"))). -dnl Does *not* test for __visibility__("protected") - which has tricky -dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on -dnl MacOS X. -dnl Does *not* test for __visibility__("internal") - which has processor -dnl dependent semantics. -dnl Does *not* test for #pragma GCC visibility push(hidden) - which is -dnl "really only recommended for legacy code". -dnl Set the variable CFLAG_VISIBILITY. -dnl Defines and sets the variable HAVE_VISIBILITY. - -AC_DEFUN([gl_VISIBILITY], -[ - AC_REQUIRE([AC_PROG_CC]) - CFLAG_VISIBILITY= - HAVE_VISIBILITY=0 - if test -n "$GCC"; then - AC_MSG_CHECKING([for simple visibility declarations]) - AC_CACHE_VAL(gl_cv_cc_visibility, [ - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" - AC_TRY_COMPILE( - [extern __attribute__((__visibility__("hidden"))) int hiddenvar; - extern __attribute__((__visibility__("default"))) int exportedvar; - extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); - extern __attribute__((__visibility__("default"))) int exportedfunc (void);], - [], - gl_cv_cc_visibility=yes, - gl_cv_cc_visibility=no) - CFLAGS="$gl_save_CFLAGS"]) - AC_MSG_RESULT([$gl_cv_cc_visibility]) - if test $gl_cv_cc_visibility = yes; then - CFLAG_VISIBILITY="-fvisibility=hidden" - HAVE_VISIBILITY=1 - fi - fi - AC_SUBST([CFLAG_VISIBILITY]) - AC_SUBST([HAVE_VISIBILITY]) - AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], - [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) -]) diff --git a/plugins/pyloader/src/plugin.cc b/plugins/pyloader/src/plugin.cc index 830749a..f40abfb 100644 --- a/plugins/pyloader/src/plugin.cc +++ b/plugins/pyloader/src/plugin.cc @@ -26,12 +26,12 @@ using namespace sgpem; // Is this OK? If not, we must use a function with a local static variable... -PythonCPUPolicyManager* _policy_manager = NULL; +PythonCPUPolicyManager* _policy_manager = nullptr; void sgpem__Plugin__on_init() { - if (_policy_manager == NULL) + if (_policy_manager == nullptr) _policy_manager = new sgpem::PythonCPUPolicyManager(); } @@ -39,7 +39,7 @@ void sgpem__Plugin__on_exit() { delete _policy_manager; - _policy_manager = NULL; + _policy_manager = nullptr; } const char* diff --git a/plugins/pyloader/src/python_cpu_policy.cc b/plugins/pyloader/src/python_cpu_policy.cc index 072e07f..662c204 100644 --- a/plugins/pyloader/src/python_cpu_policy.cc +++ b/plugins/pyloader/src/python_cpu_policy.cc @@ -63,14 +63,14 @@ namespace sgpem // WARNING : this class needs extensive and above all // *strong* exception checking / handling! -PythonCPUPolicy::PythonCPUPolicy(const char* name) throw(MalformedPolicyException) +PythonCPUPolicy::PythonCPUPolicy(const char* name) : _upolicy_dict(NULL), _adapter(NULL), _name(name), _description() { PyObject* pLoadmeStr = PyUnicode_FromString (name); PyObject* pUserCPUPolicyModule = PyImport_Import(pLoadmeStr); Py_DECREF(pLoadmeStr); - if (pUserCPUPolicyModule == NULL) + if (pUserCPUPolicyModule == nullptr) throw MalformedPolicyException(get_exception_information()); // Dictionary with defined ``symbols'' for .pyc file @@ -87,7 +87,7 @@ PythonCPUPolicy::PythonCPUPolicy(const char* name) throw(MalformedPolicyExceptio // Now takes the user-defined policy class from pUserCPUPolicyDict PyObject* pCPUPolicyClass = PyDict_GetItemString(_upolicy_dict, name); - if (pCPUPolicyClass == NULL) + if (pCPUPolicyClass == nullptr) throw new MalformedPolicyException (Glib::ustring::compose ( _("Cannot find a class named %1 into the corresponding .py file."), name)); @@ -109,7 +109,7 @@ PythonCPUPolicy::PythonCPUPolicy(const char* name) throw(MalformedPolicyExceptio Py_DECREF(pScriptAdapterModule); - if (_adapter == NULL) + if (_adapter == nullptr) throw MalformedPolicyException(get_exception_information()); // And now, who's your daddy, huh? @@ -127,7 +127,7 @@ PythonCPUPolicy::~PythonCPUPolicy() } void -PythonCPUPolicy::activate() throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::activate() { Glib::RecMutex::Lock lock(_mtx);; set_callback_policy(const_cast(this)); @@ -157,12 +157,12 @@ PythonCPUPolicy::deactivate() void -PythonCPUPolicy::configure() throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::configure() { Glib::RecMutex::Lock lock(_mtx);; set_callback_policy(const_cast(this)); - PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_configure"), NULL); + PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_configure"), nullptr); Py_DECREF(retval); wait_unlock(); @@ -172,12 +172,12 @@ PythonCPUPolicy::configure() throw(UserInterruptException, MalformedPolicyExcept void -PythonCPUPolicy::sort_queue() const throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::sort_queue() const { Glib::RecMutex::Lock lock(_mtx);; set_callback_policy(const_cast(this)); - PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_sort_queue"), NULL); + PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_sort_queue"), nullptr); // Do minimal debugging if (!retval) PyErr_Print(); @@ -203,18 +203,18 @@ PythonCPUPolicy::get_name() const } bool -PythonCPUPolicy::is_pre_emptive() const throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::is_pre_emptive() const { Glib::RecMutex::Lock lock(_mtx);; set_callback_policy(const_cast(this)); - PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_is_preemptive"), NULL); + PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_is_preemptive"), nullptr); Py_DECREF(retval); wait_unlock(); // Parse return value stored in global Python object - retval = PyObject_CallMethod(_adapter, const_cast("get_return_value"), NULL); + retval = PyObject_CallMethod(_adapter, const_cast("get_return_value"), nullptr); assert(retval); bool ret = PyObject_IsTrue(retval); Py_DECREF(retval); @@ -225,12 +225,12 @@ PythonCPUPolicy::is_pre_emptive() const throw(UserInterruptException, MalformedP int -PythonCPUPolicy::get_time_slice() const throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::get_time_slice() const { Glib::RecMutex::Lock lock(_mtx);; set_callback_policy(const_cast(this)); - PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_get_time_slice"), NULL); + PyObject* retval = PyObject_CallMethod(_adapter, const_cast("async_get_time_slice"), nullptr); // Do minimal debugging if (!retval) PyErr_Print(); @@ -239,7 +239,7 @@ PythonCPUPolicy::get_time_slice() const throw(UserInterruptException, MalformedP wait_unlock(); // Parse return value stored in global Python object - retval = PyObject_CallMethod(_adapter, const_cast("get_return_value"), NULL); + retval = PyObject_CallMethod(_adapter, const_cast("get_return_value"), nullptr); assert(retval); long tmp = PyLong_AsLong(retval); Py_DECREF(retval); @@ -250,7 +250,7 @@ PythonCPUPolicy::get_time_slice() const throw(UserInterruptException, MalformedP void -PythonCPUPolicy::wait_unlock() const throw(UserInterruptException, MalformedPolicyException) +PythonCPUPolicy::wait_unlock() const { // Polling time static const int wait_for = 150000; @@ -266,7 +266,7 @@ PythonCPUPolicy::wait_unlock() const throw(UserInterruptException, MalformedPoli Glib::usleep(wait_for); // hack'a'ton! magggggiccc nummmbeeerrrrrs!! Py_BLOCK_THREADS; - PyObject* retval = PyObject_CallMethod(_adapter, const_cast("mutex_test_lock"), NULL); + PyObject* retval = PyObject_CallMethod(_adapter, const_cast("mutex_test_lock"), nullptr); assert(retval); still_locked = PyObject_IsTrue(retval); Py_DECREF(retval); @@ -279,7 +279,7 @@ PythonCPUPolicy::wait_unlock() const throw(UserInterruptException, MalformedPoli Py_UNBLOCK_THREADS; PyEval_RestoreThread(_save); - if(PyErr_Occurred() != NULL) + if(PyErr_Occurred() != nullptr) abort(); throw UserInterruptException(_("User-defined policy is " @@ -290,9 +290,9 @@ PythonCPUPolicy::wait_unlock() const throw(UserInterruptException, MalformedPoli // check if there were unhandled exception in the user-defined code - PyObject* pException = PyObject_CallMethod(_adapter, const_cast("get_last_exception"), NULL); + PyObject* pException = PyObject_CallMethod(_adapter, const_cast("get_last_exception"), nullptr); - if(pException != NULL) + if(pException != nullptr) { if(pException != Py_None) { @@ -326,18 +326,18 @@ PythonCPUPolicy::wait_unlock() const throw(UserInterruptException, MalformedPoli string PythonCPUPolicy::get_exception_information() { - if (PyErr_Occurred() == NULL) + if (PyErr_Occurred() == nullptr) return _("no error"); - PyObject* pType = NULL; - PyObject* pValue = NULL; - PyObject* pTraceback = NULL; + PyObject* pType = nullptr; + PyObject* pValue = nullptr; + PyObject* pTraceback = nullptr; PyErr_Fetch(&pType, &pValue, &pTraceback); string msg; - if (pValue != NULL) + if (pValue != nullptr) { msg = sgpem::PyString_AsString(pValue) + "\n"; PyErr_PrintEx (false); @@ -345,9 +345,9 @@ PythonCPUPolicy::get_exception_information() else msg = string(_("no available information for this error")); - if (pType != NULL) { Py_DECREF(pType); } - if (pValue != NULL) { Py_DECREF(pValue); } - if (pTraceback != NULL) { Py_DECREF(pTraceback); } + if (pType != nullptr) { Py_DECREF(pType); } + if (pValue != nullptr) { Py_DECREF(pValue); } + if (pTraceback != nullptr) { Py_DECREF(pTraceback); } PyErr_Clear(); diff --git a/plugins/pyloader/src/python_cpu_policy.hh b/plugins/pyloader/src/python_cpu_policy.hh index 8b9c3a6..fd1734d 100644 --- a/plugins/pyloader/src/python_cpu_policy.hh +++ b/plugins/pyloader/src/python_cpu_policy.hh @@ -71,7 +71,7 @@ namespace sgpem /// @see activate(). /// @throw an exception when the policy is malformed and therefore not usable. /// @param name the name of the policy - PythonCPUPolicy(const char* name) throw(MalformedPolicyException); + PythonCPUPolicy(const char* name); /// \brief Standard virtual destructor /// @@ -89,7 +89,7 @@ namespace sgpem /// @throw an exception when the policy is malformed and therefore not usable, /// or when the policy is taking too long to terminate its work. /// @see ::CPUPolicy::configure(). - void configure() throw(UserInterruptException, MalformedPolicyException); + void configure(); /// \brief Sorts the queue, asynchronously. /// @@ -97,7 +97,7 @@ namespace sgpem /// @throw an exception when the policy is malformed and therefore not usable, /// or when the policy is taking too long to terminate its work. /// @see ::CPUPolicy::sort_queue(). - void sort_queue() const throw(UserInterruptException, MalformedPolicyException); + void sort_queue() const; /// \brief Returns a textual description of the policy. /// @@ -126,7 +126,7 @@ namespace sgpem /// @return \c TRUE if the policy is preemptive. /// @return \c FALSE if the policy is not preemptive. /// @see ::CPUPolicy::is_pre_emptive(). - bool is_pre_emptive() const throw(UserInterruptException, MalformedPolicyException); + bool is_pre_emptive() const; /// \brief Returns the lenght of the time slice, asynchronously. /// @@ -136,7 +136,7 @@ namespace sgpem /// or when the policy is taking too long to terminate its work. /// @return the lenght of the time slice. /// @see ::CPUPolicy::get_time_slice(). - int get_time_slice() const throw(UserInterruptException, MalformedPolicyException); + int get_time_slice() const; /// \brief Load the corresponding Python module and initialize a new Policy object (in Python). /// @@ -144,7 +144,7 @@ namespace sgpem /// @throw an exception when the policy is malformed and therefore not usable, /// or when the policy is taking too long to terminate its work. /// @see ::CPUPolicy::activate(). - void activate() throw(UserInterruptException, MalformedPolicyException); + void activate(); /// \brief Activates the policy. /// @@ -168,7 +168,7 @@ namespace sgpem /// the lock is taken again, and we check if the thread has finished via /// the mutex present in ::ScriptAdapter. If so, wait_unlock() terminates /// successfully. Else it stays in its main loop. - void wait_unlock() const throw(UserInterruptException, MalformedPolicyException); + void wait_unlock() const; /// \brief Returns a brief description of a thrown exception. /// Returns the description of the exception occurred. diff --git a/plugins/pyloader/src/python_cpu_policy_manager.cc b/plugins/pyloader/src/python_cpu_policy_manager.cc index 309efef..8b72466 100644 --- a/plugins/pyloader/src/python_cpu_policy_manager.cc +++ b/plugins/pyloader/src/python_cpu_policy_manager.cc @@ -22,8 +22,6 @@ #include #include -#include - #include #include #include @@ -104,7 +102,7 @@ PythonCPUPolicyManager::PythonCPUPolicyManager() PythonCPUPolicyManager::~PythonCPUPolicyManager() { - for_each(_policies.begin(), _policies.end(), memory::deletor()); + for_each(_policies.begin(), _policies.end(), [] (auto *p) { delete p; }); } @@ -124,7 +122,7 @@ PythonCPUPolicyManager::collect_policies() for (; dir_it != dir_end; ++dir_it) { Glib::Dir dir(*dir_it); - + #ifndef NDEBUG std::clog << "Opening directory " << *dir_it << " looking for python policies..." << endl; #endif @@ -137,7 +135,7 @@ PythonCPUPolicyManager::collect_policies() if (dot_py.match(*file_it)) { #ifndef NDEBUG - std::clog << *file_it << " appears to be a Python script. Attempting to load..." << std::endl; + std::clog << *file_it << " appears to be a Python script. Attempting to load..." << std::endl; #endif //strip extension std::string policy_name = (*file_it).substr(0, (*file_it).size() - 3); diff --git a/plugins/pyloader/src/sgpem.i b/plugins/pyloader/src/sgpem.i index 5f6b8ef..d344b39 100644 --- a/plugins/pyloader/src/sgpem.i +++ b/plugins/pyloader/src/sgpem.i @@ -86,7 +86,7 @@ namespace sgpem { virtual ~CPUPolicy() = 0; sgpem::PolicyParameters& get_parameters(); - static CPUPolicy* callback_get_policy() throw(std::runtime_error); + static CPUPolicy* callback_get_policy(); }; // -------------------------------------------- @@ -237,8 +237,8 @@ namespace sgpem { sgpem::Thread& get_item_at(position index); - void swap(position a, position b) throw(std::out_of_range); - void bubble_to_front(position x) throw(std::out_of_range); + void swap(position a, position b); + void bubble_to_front(position x); private: // Avoid instantiation and copy diff --git a/plugins/pyloader/src/testsuite/test-python_loader.cc b/plugins/pyloader/src/testsuite/test-python_loader.cc index 0fe90e6..991f656 100644 --- a/plugins/pyloader/src/testsuite/test-python_loader.cc +++ b/plugins/pyloader/src/testsuite/test-python_loader.cc @@ -49,7 +49,7 @@ find_pol_by_name(const vector& pols, const Glib::ustring& name) for ( ; it != pols.end(); it++) if ((*it)->get_name() == name) return *it; - return NULL; + return nullptr; } @@ -89,7 +89,7 @@ main(int argc, char** argv) try { CPUPolicy* pol = find_pol_by_name(policies, "python_loader_configure"); - assert(pol != NULL); + assert(pol != nullptr); // activate_policy will also configure the policy pgk.activate_policy(&his, pol); @@ -104,7 +104,7 @@ main(int argc, char** argv) try { CPUPolicy* pol = find_pol_by_name(policies, "python_loader_is_preemptive"); - assert(pol != NULL); + assert(pol != nullptr); pgk.activate_policy(&his, pol); pol->is_pre_emptive(); } @@ -118,7 +118,7 @@ main(int argc, char** argv) try { CPUPolicy* pol = find_pol_by_name(policies, "python_loader_get_time_slice"); - assert(pol != NULL); + assert(pol != nullptr); pgk.activate_policy(&his, pol); pol->get_time_slice(); } @@ -133,7 +133,7 @@ main(int argc, char** argv) try { CPUPolicy* pol = find_pol_by_name(policies, "python_loader_get_time_slice"); - assert(pol != NULL); + assert(pol != nullptr); pgk.activate_policy(&his, pol); pol->sort_queue(); } diff --git a/plugins/xmlsave/src/plugin.cc b/plugins/xmlsave/src/plugin.cc index d2aac46..57da9c6 100644 --- a/plugins/xmlsave/src/plugin.cc +++ b/plugins/xmlsave/src/plugin.cc @@ -26,12 +26,12 @@ using namespace sgpem; -sgpem::XMLSerializer* _serializer = NULL; +sgpem::XMLSerializer* _serializer = nullptr; void sgpem__Plugin__on_init() { - if (_serializer == NULL) + if (_serializer == nullptr) _serializer = new sgpem::XMLSerializer(); } @@ -39,7 +39,7 @@ void sgpem__Plugin__on_exit() { delete _serializer; - _serializer = NULL; + _serializer = nullptr; } const char* diff --git a/plugins/xmlsave/src/xml_serializer.cc b/plugins/xmlsave/src/xml_serializer.cc index 75ee6fc..ca9ce09 100644 --- a/plugins/xmlsave/src/xml_serializer.cc +++ b/plugins/xmlsave/src/xml_serializer.cc @@ -38,7 +38,7 @@ XMLSerializer::XMLSerializer() -void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& hist) throw(SerializerError) +void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& hist) { /* COMPAT: Do not genrate nodes for formatting spaces */ LIBXML_TEST_VERSION @@ -46,7 +46,7 @@ void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& xmlDocPtr doc; doc = xmlNewDoc((const xmlChar *)"1.0"); - if (doc != NULL) + if (doc != nullptr) { fill_doc(doc, hist); int nwritten = xmlSaveFormatFile (filename.c_str(), doc, 1); @@ -64,7 +64,7 @@ void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& xmlCleanupParser(); } -void XMLSerializer::restore_snapshot(const Glib::ustring& filename, History& hist) throw(SerializerError) +void XMLSerializer::restore_snapshot(const Glib::ustring& filename, History& hist) { // TODO - all to do!! // DEBUG - remove me when finished @@ -82,7 +82,7 @@ void XMLSerializer::restore_snapshot(const Glib::ustring& filename, History& his * build an XML tree from a the file; */ doc = xmlParseFile(filename.c_str()); - if (doc == NULL) + if (doc == nullptr) { xmlCleanupParser(); throw SerializerError("Parsing Error: doc is invalid."); @@ -127,7 +127,7 @@ const Glib::ustring XMLSerializer::get_filename_description() void XMLSerializer::fill_doc(xmlDocPtr doc, const History& hist) { - xmlNodePtr root_node = NULL;/* node pointers */ + xmlNodePtr root_node = nullptr;/* node pointers */ /* * Creates a new document, a node and set it as a root node */ @@ -137,7 +137,7 @@ void XMLSerializer::fill_doc(xmlDocPtr doc, const History& hist) /* * Creates a DTD declaration. Isn't mandatory. */ - /* xmlDtdPtr dtd = */ xmlCreateIntSubset(doc, (const xmlChar *) "sgpem", NULL, (const xmlChar *) "sgpem.dtd"); + /* xmlDtdPtr dtd = */ xmlCreateIntSubset(doc, (const xmlChar *) "sgpem", nullptr, (const xmlChar *) "sgpem.dtd"); //TODO: check for DTD compliance?? @@ -146,14 +146,14 @@ void XMLSerializer::fill_doc(xmlDocPtr doc, const History& hist) } -void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(SerializerError) +void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) { /* * Check the document is of the right kind */ xmlNodePtr root; root = xmlDocGetRootElement(doc); - if (root == NULL) + if (root == nullptr) { xmlFreeDoc(doc); xmlCleanupParser(); @@ -162,7 +162,7 @@ void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(Se xmlNodePtr cur; cur = root->children; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring name((const char *)cur->name); if (name == "resources") @@ -179,17 +179,17 @@ void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(Se XMLSerializerFactory::Parameters* read_properties(xmlAttrPtr prop) { - if (prop == NULL) - return NULL; + if (prop == nullptr) + return nullptr; XMLSerializerFactory::Parameters* par = new XMLSerializerFactory::Parameters(); - while (prop != NULL) + while (prop != nullptr) { if (prop->children && xmlNodeIsText(prop->children)) { xmlChar *key = xmlNodeGetContent (prop->children); // xmlChar *key = xmlNodeListGetString(doc, prop->children, 1); - if (key != NULL) + if (key != nullptr) { std::pair key_value(Glib::ustring((const char *)prop->name), Glib::ustring((const char *)key)); par->insert(key_value); @@ -205,14 +205,14 @@ void XMLSerializer::read_resources(xmlNodePtr resources_node, XMLSerializerFacto { xmlNodePtr cur; cur = resources_node->children; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring node_name((const char *)cur->name); if (node_name == "resource") { xmlAttrPtr prop = cur->properties; XMLSerializerFactory::Parameters* par = read_properties(prop); - if (par != NULL) + if (par != nullptr) { fact.factory_method(Glib::ustring("Resource"), *par); } @@ -224,19 +224,19 @@ void XMLSerializer::read_resources(xmlNodePtr resources_node, XMLSerializerFacto } void XMLSerializer::read_schedulables(xmlNodePtr schedulables_node, XMLSerializerFactory& fact) { - if (schedulables_node == NULL) + if (schedulables_node == nullptr) return; xmlNodePtr cur; cur = schedulables_node->children; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring node_name((const char *)cur->name); if (node_name == "process") { xmlAttrPtr prop = cur->properties; XMLSerializerFactory::Parameters* par = read_properties(prop); - if (par != NULL) + if (par != nullptr) { fact.factory_method(Glib::ustring("Process"), *par); } @@ -250,19 +250,19 @@ void XMLSerializer::read_schedulables(xmlNodePtr schedulables_node, XMLSerialize void XMLSerializer::read_threads(xmlNodePtr threads_node, XMLSerializerFactory& fact) { - if (threads_node == NULL) + if (threads_node == nullptr) return; xmlNodePtr cur; cur = threads_node->children; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring node_name((const char *)cur->name); if (node_name == "thread") { xmlAttrPtr prop = cur->properties; XMLSerializerFactory::Parameters* par = read_properties(prop); - if (par != NULL) + if (par != nullptr) { fact.factory_method(Glib::ustring("Thread"), *par); } @@ -276,21 +276,21 @@ void XMLSerializer::read_threads(xmlNodePtr threads_node, XMLSerializerFactory& void XMLSerializer::read_requests(xmlNodePtr requests_node, XMLSerializerFactory& fact) { - if (requests_node == NULL) + if (requests_node == nullptr) { return; } xmlNodePtr cur; cur = requests_node->children; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring node_name((const char *)cur->name); if (node_name == "request") { xmlAttrPtr prop = cur->properties; XMLSerializerFactory::Parameters* par = read_properties(prop); - if (par != NULL) + if (par != nullptr) { fact.factory_method(Glib::ustring("Request"), *par); } @@ -304,21 +304,21 @@ void XMLSerializer::read_requests(xmlNodePtr requests_node, XMLSerializerFactory void XMLSerializer::read_subrequests(xmlNodePtr subrequest_node, XMLSerializerFactory& fact) { - if (subrequest_node == NULL) + if (subrequest_node == nullptr) { return; } xmlNodePtr cur; cur = subrequest_node; - while (cur != NULL) + while (cur != nullptr) { Glib::ustring node_name((const char *)cur->name); if (node_name == "subrequest") { xmlAttrPtr prop = cur->properties; XMLSerializerFactory::Parameters* par = read_properties(prop); - if (par != NULL) + if (par != nullptr) { fact.factory_method(Glib::ustring("SubRequest"), *par); } diff --git a/plugins/xmlsave/src/xml_serializer.hh b/plugins/xmlsave/src/xml_serializer.hh index 91128df..c1b74f5 100644 --- a/plugins/xmlsave/src/xml_serializer.hh +++ b/plugins/xmlsave/src/xml_serializer.hh @@ -61,7 +61,7 @@ namespace sgpem \throws backend::SerializerError on error */ - virtual void save_snapshot(const Glib::ustring& filename, const History& hist) throw(SerializerError); + virtual void save_snapshot(const Glib::ustring& filename, const History& hist); /** \brief Re-initialize system status from a saved XML snapshot @@ -72,7 +72,7 @@ namespace sgpem \throws backend::SerializerError */ - virtual void restore_snapshot(const Glib::ustring& filename, History& hist) throw(SerializerError); + virtual void restore_snapshot(const Glib::ustring& filename, History& hist); /** \return Constant string "xsgp" @@ -99,7 +99,7 @@ namespace sgpem Traverse the passed (previously readed) xml document and rebuild the correct image using the XMLSerializerFactory object. */ - void read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(SerializerError); + void read_doc(xmlDocPtr doc, XMLSerializerFactory& fact); /** \brief Restore all the resources from the passed xml node diff --git a/plugins/xmlsave/src/xml_serializer_factory.cc b/plugins/xmlsave/src/xml_serializer_factory.cc index bb3be89..338e540 100644 --- a/plugins/xmlsave/src/xml_serializer_factory.cc +++ b/plugins/xmlsave/src/xml_serializer_factory.cc @@ -47,7 +47,7 @@ History* XMLSerializerFactory::get_history() } void -XMLSerializerFactory::factory_method(const Glib::ustring& class_name, Parameters& parameters) throw(SerializerError) +XMLSerializerFactory::factory_method(const Glib::ustring& class_name, Parameters& parameters) { if (class_name == "Resource") { diff --git a/plugins/xmlsave/src/xml_serializer_factory.hh b/plugins/xmlsave/src/xml_serializer_factory.hh index e573791..d9d19e5 100644 --- a/plugins/xmlsave/src/xml_serializer_factory.hh +++ b/plugins/xmlsave/src/xml_serializer_factory.hh @@ -77,7 +77,7 @@ namespace sgpem \throw SerializerError If not all necessary parameters for an object creation are provided */ - void factory_method(const Glib::ustring& class_name, Parameters& parameters) throw(SerializerError); + void factory_method(const Glib::ustring& class_name, Parameters& parameters); protected: private: typedef Environment::resource_key_t resource_key_t; diff --git a/plugins/xmlsave/src/xml_visitor.cc b/plugins/xmlsave/src/xml_visitor.cc index d8baca3..a6f0b4c 100644 --- a/plugins/xmlsave/src/xml_visitor.cc +++ b/plugins/xmlsave/src/xml_visitor.cc @@ -44,7 +44,7 @@ XMLVisitor::~XMLVisitor() { } -void XMLVisitor::from_resource(const Resource& /*obj*/) throw(SerializerError) +void XMLVisitor::from_resource(const Resource& /*obj*/) { throw SerializerError( _("XMLVisitor: unsupported method from_resource(const Resource& obj)") @@ -52,50 +52,50 @@ void XMLVisitor::from_resource(const Resource& /*obj*/) throw(SerializerError) } -void XMLVisitor::from_history(const History& obj) throw(SerializerError) +void XMLVisitor::from_history(const History& obj) { from_history(_current, obj); } -void XMLVisitor::from_environment(const Environment& obj) throw(SerializerError) +void XMLVisitor::from_environment(const Environment& obj) { from_environment(_current, obj); } -void XMLVisitor::from_process(const Process& obj) throw(SerializerError) +void XMLVisitor::from_process(const Process& obj) { from_process(_current, obj); } -void XMLVisitor::from_thread(const Thread& obj) throw(SerializerError) +void XMLVisitor::from_thread(const Thread& obj) { from_thread(_current, obj); } -void XMLVisitor::from_request(const Request& obj) throw(SerializerError) +void XMLVisitor::from_request(const Request& obj) { from_request(_current, obj); } -void XMLVisitor::from_subrequest(const SubRequest& obj) throw(SerializerError) +void XMLVisitor::from_subrequest(const SubRequest& obj) { from_subrequest(_current, obj); } -void XMLVisitor::from_resource(const Resource& obj, const Glib::ustring& key) throw(SerializerError) +void XMLVisitor::from_resource(const Resource& obj, const Glib::ustring& key) { from_resource(_current, obj, key); } -void XMLVisitor::from_history(xmlNodePtr parent, const History& hist) throw(SerializerError) +void XMLVisitor::from_history(xmlNodePtr parent, const History& hist) { - if (parent != NULL) + if (parent != nullptr) { from_environment(parent, hist.get_last_environment()); } @@ -106,9 +106,9 @@ void XMLVisitor::from_history(xmlNodePtr parent, const History& hist) throw(Seri } -void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) throw(SerializerError) +void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) { - if (parent == NULL) + if (parent == nullptr) { throw SerializerError(_("Error trying to add data to empty XML node.")); } @@ -116,7 +116,7 @@ void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) thr //Enclosing block - save resources // { - xmlNodePtr resources_node = xmlNewChild(parent, NULL, (const xmlChar *) "resources", NULL); + xmlNodePtr resources_node = xmlNewChild(parent, nullptr, (const xmlChar *) "resources", nullptr); const Environment::Resources& rvect = env.get_resources(); typedef Environment::Resources::const_iterator res_iterator; @@ -136,7 +136,7 @@ void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) thr //Enclosing block - save schedulables // { - xmlNodePtr schedulables_node = xmlNewChild(parent, NULL, (const xmlChar *) "schedulables", NULL); + xmlNodePtr schedulables_node = xmlNewChild(parent, nullptr, (const xmlChar *) "schedulables", nullptr); const Environment::Processes& pvect = env.get_processes(); typedef std::vector::const_iterator proc_iterator; @@ -153,9 +153,9 @@ void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) thr } -void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key) throw(SerializerError) +void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key) { - if (parent != NULL) + if (parent != nullptr) { Glib::ustring id = "reskey" + key; Glib::ustring strPreemptible("false"); // fixed?? @@ -163,7 +163,7 @@ void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Gli Glib::ustring strPlaces; to_string(static_cast(obj.get_places()), strPlaces); - xmlNodePtr process_node = xmlNewChild(parent, NULL, (const xmlChar *) "resource", NULL); + xmlNodePtr process_node = xmlNewChild(parent, nullptr, (const xmlChar *) "resource", nullptr); xmlNewProp(process_node, (const xmlChar *) "name", (const xmlChar *) obj.get_name().c_str()); xmlNewProp(process_node, (const xmlChar *) "id", (const xmlChar *) id.c_str()); xmlNewProp(process_node, (const xmlChar *) "arrival-time", (const xmlChar *) strArrivalTime.c_str()); @@ -177,22 +177,22 @@ void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Gli } -void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj) throw(SerializerError) +void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj) { - if (parent != NULL) + if (parent != nullptr) { Glib::ustring strPriority; Glib::ustring strArrivalTime; to_string(obj.get_base_priority(), strPriority); to_string(obj.get_arrival_time(), strArrivalTime); - xmlNodePtr process_node = xmlNewChild(parent, NULL, (const xmlChar *) "process", NULL); + xmlNodePtr process_node = xmlNewChild(parent, nullptr, (const xmlChar *) "process", nullptr); xmlNewProp(process_node, (const xmlChar *) "name", (const xmlChar *) obj.get_name().c_str()); xmlNewProp(process_node, (const xmlChar *) "priority", (const xmlChar *) strPriority.c_str()); xmlNewProp(process_node, (const xmlChar *) "arrival-time", (const xmlChar *) strArrivalTime.c_str()); // make a threads subnode - xmlNodePtr threads_node = xmlNewChild(process_node, NULL, (const xmlChar *) "threads", NULL); + xmlNodePtr threads_node = xmlNewChild(process_node, nullptr, (const xmlChar *) "threads", nullptr); // iterate on threads typedef std::vector Threads; @@ -214,9 +214,9 @@ void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj) throw(Seria } -void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) throw(SerializerError) +void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) { - if (parent != NULL) + if (parent != nullptr) { Glib::ustring strPriority; @@ -226,14 +226,14 @@ void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) throw(Seriali to_string(obj.get_arrival_time(), strArrivalTime); to_string(obj.get_total_cpu_time(), strLastsTime); - xmlNodePtr thread_node = xmlNewChild(parent, NULL, (const xmlChar *) "thread", NULL); + xmlNodePtr thread_node = xmlNewChild(parent, nullptr, (const xmlChar *) "thread", nullptr); xmlNewProp(thread_node, (const xmlChar *) "name", (const xmlChar *) obj.get_name().c_str()); xmlNewProp(thread_node, (const xmlChar *) "priority", (const xmlChar *) strPriority.c_str()); xmlNewProp(thread_node, (const xmlChar *) "arrival-delta", (const xmlChar *) strArrivalTime.c_str()); xmlNewProp(thread_node, (const xmlChar *) "lasts-for", (const xmlChar *) strLastsTime.c_str()); // make a requests subnode - xmlNodePtr requests_node = xmlNewChild(thread_node, NULL, (const xmlChar *) "requests", NULL); + xmlNodePtr requests_node = xmlNewChild(thread_node, nullptr, (const xmlChar *) "requests", nullptr); // iterate on requests typedef std::vector Requests; typedef std::vector::const_iterator req_iterator; @@ -254,19 +254,19 @@ void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) throw(Seriali } -void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj) throw(SerializerError) +void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj) { - if (parent != NULL) + if (parent != nullptr) { Glib::ustring strArrivalTime; to_string(obj.get_instant(), strArrivalTime); - xmlNodePtr request_node = xmlNewChild(parent, NULL, (const xmlChar *) "request", NULL); + xmlNodePtr request_node = xmlNewChild(parent, nullptr, (const xmlChar *) "request", nullptr); xmlNewProp(request_node, (const xmlChar *) "arrival-time", (const xmlChar *) strArrivalTime.c_str()); // make a requests subnode - // xmlNodePtr subrequests_node = xmlNewChild(thread_node, NULL, (const xmlChar *) "requests", NULL); + // xmlNodePtr subrequests_node = xmlNewChild(thread_node, nullptr, (const xmlChar *) "requests", nullptr); // iterate on subrequests typedef std::vector SubRequests; typedef std::vector::const_iterator subreq_iterator; @@ -287,9 +287,9 @@ void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj) throw(Seria } -void XMLVisitor::from_subrequest(xmlNodePtr parent, const SubRequest& obj) throw(SerializerError) +void XMLVisitor::from_subrequest(xmlNodePtr parent, const SubRequest& obj) { - if (parent != NULL) + if (parent != nullptr) { Glib::ustring strResource; @@ -297,7 +297,7 @@ void XMLVisitor::from_subrequest(xmlNodePtr parent, const SubRequest& obj) throw to_string(obj.get_resource_key(), strResource); to_string(obj.get_length(), strLastsFor); - xmlNodePtr subrequest_node = xmlNewChild(parent, NULL, (const xmlChar *) "subrequest", NULL); + xmlNodePtr subrequest_node = xmlNewChild(parent, nullptr, (const xmlChar *) "subrequest", nullptr); xmlNewProp(subrequest_node, (const xmlChar *) "resource", (const xmlChar *) strResource.c_str()); xmlNewProp(subrequest_node, (const xmlChar *) "lasts-for", (const xmlChar *) strLastsFor.c_str()); } diff --git a/plugins/xmlsave/src/xml_visitor.hh b/plugins/xmlsave/src/xml_visitor.hh index 46b1c79..b4c76be 100644 --- a/plugins/xmlsave/src/xml_visitor.hh +++ b/plugins/xmlsave/src/xml_visitor.hh @@ -69,61 +69,61 @@ namespace sgpem \brief Add output to the serializer taking data from history Wrapper method: call from_history(xmlNodePtr parent, const History& obj); */ - virtual void from_history(const History& obj) throw(SerializerError); + virtual void from_history(const History& obj); /** \brief Add output to the serializer taking data from environment Wrapper method: call from_environment(xmlNodePtr parent, const Environment& obj); */ - virtual void from_environment(const Environment& obj) throw(SerializerError); + virtual void from_environment(const Environment& obj); /** \brief Add output to the serializer taking data from resource BUG: a resource must be saved with her own associated key. Throw an exception. */ - virtual void from_resource(const Resource& obj) throw(SerializerError); + virtual void from_resource(const Resource& obj); /** \brief Add output to the serializer taking data from resource and key BUG FIXED: This save a resource with her own associated key. Wrapper method: call from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key); */ - virtual void from_resource(const Resource& obj, const Glib::ustring& key) throw(SerializerError); + virtual void from_resource(const Resource& obj, const Glib::ustring& key); /** \brief Add output to the serializer taking data from process Wrapper method: call from_process(xmlNodePtr parent, const Process& obj); */ - virtual void from_process(const Process& obj) throw(SerializerError); + virtual void from_process(const Process& obj); /** \brief Add output to the serializer taking data from thread Wrapper method: call from_thread(xmlNodePtr parent, const Thread& obj); */ - virtual void from_thread(const Thread& obj) throw(SerializerError); + virtual void from_thread(const Thread& obj); /** \brief Add output to the serializer taking data from request Wrapper method: call from_request(xmlNodePtr parent, const Request& obj); */ - virtual void from_request(const Request& obj) throw(SerializerError); + virtual void from_request(const Request& obj); /** \brief Add output to the serializer taking data from subrequest Wrapper method: call from_subrequest(xmlNodePtr parent, const SubRequest& obj); */ - virtual void from_subrequest(const SubRequest& obj) throw(SerializerError); + virtual void from_subrequest(const SubRequest& obj); private: - void from_history(xmlNodePtr parent, const History& obj) throw(SerializerError); - void from_environment(xmlNodePtr parent, const Environment& obj) throw(SerializerError); - void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key) throw(SerializerError); - void from_process(xmlNodePtr parent, const Process& obj) throw(SerializerError); - void from_thread(xmlNodePtr parent, const Thread& obj) throw(SerializerError); - void from_request(xmlNodePtr parent, const Request& obj) throw(SerializerError); - void from_subrequest(xmlNodePtr parent, const SubRequest& obj) throw(SerializerError); + void from_history(xmlNodePtr parent, const History& obj); + void from_environment(xmlNodePtr parent, const Environment& obj); + void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key); + void from_process(xmlNodePtr parent, const Process& obj); + void from_thread(xmlNodePtr parent, const Thread& obj); + void from_request(xmlNodePtr parent, const Request& obj); + void from_subrequest(xmlNodePtr parent, const SubRequest& obj); xmlNodePtr _current; }; diff --git a/src/add_request_dialog.cc b/src/add_request_dialog.cc index 4c57db1..f2380b8 100644 --- a/src/add_request_dialog.cc +++ b/src/add_request_dialog.cc @@ -104,7 +104,7 @@ AddRequestDialog::run_add(sgpem::Thread& owner) { update_combo(); - Request* r = NULL; + Request* r = nullptr; // reset the dialog data // _list_model->clear(); diff --git a/src/add_request_dialog.hh b/src/add_request_dialog.hh index 5c45853..f1cd54a 100644 --- a/src/add_request_dialog.hh +++ b/src/add_request_dialog.hh @@ -52,7 +52,7 @@ namespace sgpem /** \brief Attemts to show the dialog, and constructs a new request * if response is OK * \param owner The thread which will own the request - * \return A pointer to the created request, or NULL if the request + * \return A pointer to the created request, or nullptr if the request * wasn't created */ Request* run_add(Thread& owner); diff --git a/src/backend/concrete_environment.cc b/src/backend/concrete_environment.cc index fdab77b..6704859 100644 --- a/src/backend/concrete_environment.cc +++ b/src/backend/concrete_environment.cc @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -200,7 +199,7 @@ ConcreteEnvironment::~ConcreteEnvironment() // This call will invoke the DynamicProcess virtual destructor // Which will delete on cascade all DynamicThreads and so on. for_each(_processes.begin(), _processes.end(), - memory::deletor()); + [] (auto *p) { delete p; }); // We do the same with Resources. for (Resources::iterator it = _resources.begin(); it != _resources.end(); it++) diff --git a/src/backend/concrete_history.cc b/src/backend/concrete_history.cc index 4a510d5..1b54d4e 100644 --- a/src/backend/concrete_history.cc +++ b/src/backend/concrete_history.cc @@ -37,12 +37,11 @@ #include #include -#include -#include #include #include #include +#include #ifndef NDEBUG #include @@ -50,9 +49,6 @@ using namespace sgpem; using namespace std; -using memory::smart_ptr; -using memory::deletor; - // --------------- // For all you evil-doers on Earth, this is your mighty punishment! @@ -83,7 +79,7 @@ static T* deep_find(const std::vector& v, const T& obj) { return *it; } - return NULL; + return nullptr; } @@ -99,7 +95,7 @@ ConcreteHistory::ConcreteHistory() ConcreteHistory::~ConcreteHistory() { for_each(_snapshots.begin(), _snapshots.end(), - deletor()); + [] (auto *p) { delete p; }); } ConcreteHistory::ConcreteHistory(const ConcreteHistory& h) : @@ -136,7 +132,6 @@ ConcreteHistory::get_last_environment() const const ConcreteEnvironment& ConcreteHistory::get_environment_at(position index) const -throw(std::out_of_range) { return *_snapshots.at(index); } @@ -226,7 +221,7 @@ ConcreteHistory::remove(Thread& thread) Process* found = deep_find(processes, dyn_thr.get_process()); - if (found == NULL) + if (found == nullptr) return; // not found, just return. DynamicProcess& dynamic_found = down_cast(*found); @@ -250,10 +245,10 @@ ConcreteHistory::remove(Request& request) Process* proc_ref = deep_find(processes, dyn_proc); DynamicProcess* dyn_proc_ref = down_cast(proc_ref); - if (dyn_proc_ref == NULL) + if (dyn_proc_ref == nullptr) return; // not found, just return. DynamicThread* thr_ref = deep_find(dyn_proc_ref->get_dynamic_threads(), dyn_thr); - if (thr_ref == NULL) + if (thr_ref == nullptr) return; // not found, just return. bool removed = deep_remove(thr_ref->get_dynamic_requests(), dyn_req); @@ -280,13 +275,13 @@ ConcreteHistory::remove(SubRequest& subrequest) Process* proc_ref = deep_find(processes, dyn_proc); DynamicProcess* dyn_proc_ref = down_cast(proc_ref); - if (dyn_proc_ref == NULL) + if (dyn_proc_ref == nullptr) return; // not found, just return. DynamicThread* thr_ref = deep_find(dyn_proc_ref->get_dynamic_threads(), dyn_thr); - if (thr_ref == NULL) + if (thr_ref == nullptr) return; // not found, just return. DynamicRequest* req_ref = deep_find(thr_ref->get_dynamic_requests(), dyn_req); - if (req_ref == NULL) + if (req_ref == nullptr) return; // not found, just return. bool removed = deep_remove(req_ref->get_dynamic_subrequests(), dyn_sub); @@ -400,7 +395,7 @@ ConcreteHistory::add_thread(const Glib::ustring& name, ConcreteEnvironment::Processes& processes = _snapshots.front()->get_processes(); Process* p = deep_find(processes, parent); if(!p) throw std::runtime_error(_("History::add_thread() : Parent process not part of this History")); - + DynamicProcess& parent_process = down_cast(*p); StaticProcess& parent_core = parent_process.get_core(); StaticThread* core = new StaticThread(name, parent_core, cpu_time, arrival_time, base_priority); @@ -468,7 +463,7 @@ ConcreteHistory::add_subrequest(Request& request, time_t duration) { ConcreteEnvironment::Processes& processes = _snapshots.front()->get_processes(); - + Process* p = deep_find(processes, request.get_thread().get_process()); if(!p) throw std::runtime_error(_("History::add_subrequest() : Parent process not part of this History")); Thread* t = deep_find(p->get_threads(), request.get_thread()); @@ -505,11 +500,15 @@ ConcreteHistory::set_front(position p) { position old_front = _front; if (p > _snapshots.size() - 1) + { _front = _snapshots.size() - 1; - else + } + else + { _front = p; + } - if(old_front != _front) + if(old_front != _front) notify_change(); } @@ -526,7 +525,7 @@ ConcreteHistory::reset() Snapshots::iterator it = _snapshots.begin(); it++; // Skip first environment that we saved - for_each(it, _snapshots.end(), deletor()); + for_each(it, _snapshots.end(), [] (auto *p) { delete p; }); _snapshots.resize(1); // Truncate to keep only our "model" _front = 0; _sealed = false; diff --git a/src/backend/concrete_history.hh b/src/backend/concrete_history.hh index 4e773bd..b2310cb 100644 --- a/src/backend/concrete_history.hh +++ b/src/backend/concrete_history.hh @@ -54,7 +54,7 @@ namespace sgpem virtual void append_new_environment(ConcreteEnvironment* environment); virtual size_t get_size() const; virtual const ConcreteEnvironment& get_last_environment() const; - virtual const ConcreteEnvironment& get_environment_at(position index) const throw(std::out_of_range); + virtual const ConcreteEnvironment& get_environment_at(position index) const; virtual void remove(resource_key_t resource_key); virtual void remove(Process& process); diff --git a/src/backend/concrete_simulation.cc b/src/backend/concrete_simulation.cc index 7cb2635..10a4771 100644 --- a/src/backend/concrete_simulation.cc +++ b/src/backend/concrete_simulation.cc @@ -27,8 +27,6 @@ #include -#include - #include #include #include @@ -36,10 +34,9 @@ #include using namespace sgpem; -using namespace memory; ConcreteSimulation::ConcreteSimulation() : - Simulation(), _state(state_stopped), + Simulation(), _state(state_stopped), _mode(mode_continuous), _policy(NULL), _resource_policy(NULL) { } @@ -57,13 +54,13 @@ ConcreteSimulation::get_mode() const } void -ConcreteSimulation::jump_to(History::position p) throw(UserInterruptException, NullPolicyException, MalformedPolicyException) +ConcreteSimulation::jump_to(History::position p) { switch (_state) { case state_running: // pauses the simulation (done below) - break; + break; case state_stopped: _history.set_front(0); break; @@ -71,23 +68,23 @@ ConcreteSimulation::jump_to(History::position p) throw(UserInterruptException, N break; } - // Disable momentarily updates for registered observers on + // Disable momentarily updates for registered observers on // sgpem::Simulation and sgpem::History. History::LockNotify h_lock(_history); Simulation::LockNotify s_lock(*this); - pause(); + pause(); - bool yet_to_finish = true; + bool yet_to_finish = true; History::position increment = 0; - while (yet_to_finish && p > _history.get_front() + increment) + while (yet_to_finish && p > _history.get_front() + increment) { yet_to_finish = step(); increment++; } get_history().set_front(std::min(p, _history.get_size())); - if (!yet_to_finish) - stop(); + if (!yet_to_finish) + stop(); } @@ -112,7 +109,7 @@ ConcreteSimulation::stop() } void -ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException, MalformedPolicyException) +ConcreteSimulation::run() { switch (_state) { @@ -131,14 +128,14 @@ ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException, Mal if (yet_to_finish) { - if(_mode == mode_step_by_step) + if(_mode == mode_step_by_step) pause(); else // We remain in running state, and we notify everybody! // This is non-trivial, and we must do so since we // put the state to running inconditionally. Don't - // touch this if you don't provide another way to tell - // a SimulationObserver that the simulation advanced + // touch this if you don't provide another way to tell + // a SimulationObserver that the simulation advanced // and *yet* it is in running state! notify_change(); } @@ -149,20 +146,19 @@ ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException, Mal bool ConcreteSimulation::step() - throw(UserInterruptException, NullPolicyException, MalformedPolicyException) { - if (get_policy() == NULL) + if (get_policy() == nullptr) { stop(); throw NullPolicyException("no CPU policy selected"); } - if (get_resource_policy() == NULL) + if (get_resource_policy() == nullptr) { stop(); throw NullPolicyException("no resource policy selected"); } - + try { // step forward @@ -171,7 +167,7 @@ ConcreteSimulation::step() { if(!_history.is_sealed()) yet_to_finish = Scheduler::get_instance().step_forward(_history, *get_policy(), *get_resource_policy()); - else + else yet_to_finish = false; } @@ -183,8 +179,8 @@ ConcreteSimulation::step() // we have to make this horrible thing if (_history.get_front() == _history.get_size() - 2 && _history.is_sealed()) yet_to_finish = false; - - return yet_to_finish; + + return yet_to_finish; } catch (const CPUPolicyException& e) { @@ -214,7 +210,7 @@ ConcreteSimulation::get_history() const void -ConcreteSimulation::set_policy(CPUPolicy* p) throw(CPUPolicyException) +ConcreteSimulation::set_policy(CPUPolicy* p) { stop(); @@ -227,12 +223,12 @@ ConcreteSimulation::set_policy(CPUPolicy* p) throw(CPUPolicyException) { try { - // this is a no-op if _policy is NULL + // this is a no-op if _policy is nullptr CPUPoliciesGatekeeper::get_instance().activate_policy(&_history, _policy); } catch(const CPUPolicyException& e2) { - _policy = NULL; + _policy = nullptr; std::string msg = _("unable to change policy and to restore the previous: "); msg += e2.what(); @@ -242,7 +238,7 @@ ConcreteSimulation::set_policy(CPUPolicy* p) throw(CPUPolicyException) std::string msg = _("unable to change policy: "); msg+= e1.what(); - + throw CPUPolicyException(msg); } } diff --git a/src/backend/concrete_simulation.hh b/src/backend/concrete_simulation.hh index 0df21ab..be4738d 100644 --- a/src/backend/concrete_simulation.hh +++ b/src/backend/concrete_simulation.hh @@ -45,7 +45,7 @@ namespace sgpem * Advances the simulation by one or more steps, depending on the * actual state and on the value set with set_mode(). */ - void run() throw(UserInterruptException, NullPolicyException, MalformedPolicyException); + void run(); /** \brief Pauses a running simulation. @@ -62,7 +62,7 @@ namespace sgpem Pauses the simulation and jumps to the specified instant \throw UserInterruptException, NullPolicyException, MalformedPolicyException */ - void jump_to(History::position p) throw(UserInterruptException, NullPolicyException, MalformedPolicyException); + void jump_to(History::position p); /** \brief Stops the simulation. @@ -98,7 +98,7 @@ namespace sgpem /** \throw An instance of CPUPolicyException, \b not a derived class!!! */ - void set_policy(CPUPolicy*) throw(CPUPolicyException); + void set_policy(CPUPolicy*); /** \brief Setup the resource policy to be used by the system. @@ -133,7 +133,7 @@ namespace sgpem CPUPolicy* _policy; ResourcePolicy* _resource_policy; - bool step() throw(UserInterruptException, NullPolicyException, MalformedPolicyException); + bool step(); }; } diff --git a/src/backend/cpu_policies_gatekeeper.cc b/src/backend/cpu_policies_gatekeeper.cc index d29fa9c..6f92f6f 100644 --- a/src/backend/cpu_policies_gatekeeper.cc +++ b/src/backend/cpu_policies_gatekeeper.cc @@ -41,7 +41,7 @@ using std::runtime_error; using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; typedef vector::iterator ManagerIterator; typedef map::iterator ActiveIterator; @@ -55,7 +55,7 @@ CPUPoliciesGatekeeper::get_registered() const void CPUPoliciesGatekeeper::register_manager(CPUPolicyManager* manager) { - assert(manager != NULL); + assert(manager != nullptr); ManagerIterator end = _registered.end(); @@ -66,7 +66,7 @@ CPUPoliciesGatekeeper::register_manager(CPUPolicyManager* manager) void CPUPoliciesGatekeeper::unregister_manager(CPUPolicyManager* manager) { - assert(manager != NULL); + assert(manager != nullptr); ManagerIterator end = _registered.end(); ManagerIterator pos = find(_registered.begin(), end, manager); @@ -79,9 +79,9 @@ CPUPoliciesGatekeeper::unregister_manager(CPUPolicyManager* manager) } CPUPolicy* -CPUPoliciesGatekeeper::get_current_policy(History* history) throw(runtime_error) +CPUPoliciesGatekeeper::get_current_policy(History* history) { - assert(history != NULL); + assert(history != nullptr); ActiveIterator policy = _active_policies.find(history); @@ -93,9 +93,9 @@ CPUPoliciesGatekeeper::get_current_policy(History* history) throw(runtime_error) } void -CPUPoliciesGatekeeper::activate_policy(History *history, CPUPolicy* policy) throw(UserInterruptException, MalformedPolicyException) +CPUPoliciesGatekeeper::activate_policy(History *history, CPUPolicy* policy) { - assert(history != NULL); + assert(history != nullptr); ActiveIterator end = _active_policies.end(); ActiveIterator pos = _active_policies.find(history); @@ -109,16 +109,16 @@ CPUPoliciesGatekeeper::activate_policy(History *history, CPUPolicy* policy) thro pos->second->deactivate(); } - - // if policy is NULL, simply erase the entry and return, since we are sure the policy is + + // if policy is nullptr, simply erase the entry and return, since we are sure the policy is // not active due to the previous lines - if(policy == NULL) + if(policy == nullptr) { // this is a no-op if history is not a key used in the map _active_policies.erase(history); return; } - + try { policy->activate(); @@ -127,11 +127,11 @@ CPUPoliciesGatekeeper::activate_policy(History *history, CPUPolicy* policy) thro down_cast(history)->reset(); } catch(const CPUPolicyException& e) - { + { // the caller need to know if it failed throw; } - + } CPUPoliciesGatekeeper::CPUPoliciesGatekeeper() @@ -156,10 +156,10 @@ CPUPoliciesGatekeeper::deactivate_policies(CPUPolicyManager* manager) if (act_it->second == *avail_it) { act_it->second->deactivate(); - // Please note the postfix increment - // (operating on the old, now invalidated by - // erase, iterator object): - _active_policies.erase(act_it++); + // Please note the postfix increment + // (operating on the old, now invalidated by + // erase, iterator object): + _active_policies.erase(act_it++); } else ++act_it; diff --git a/src/backend/cpu_policy.cc b/src/backend/cpu_policy.cc index 8e91c9e..05f3ea9 100644 --- a/src/backend/cpu_policy.cc +++ b/src/backend/cpu_policy.cc @@ -24,7 +24,7 @@ using namespace sgpem; // Static member data -CPUPolicy* CPUPolicy::_callback_policy = NULL; +CPUPolicy* CPUPolicy::_callback_policy = nullptr; CPUPolicy::~CPUPolicy() @@ -40,10 +40,10 @@ CPUPolicy::get_parameters() CPUPolicy* -CPUPolicy::callback_get_policy() throw(std::runtime_error) +CPUPolicy::callback_get_policy() { - if(_callback_policy == NULL) - throw std::runtime_error("CPUPolicy::callback_get_policy() not used as a callback method. NULL ptr returned."); + if(_callback_policy == nullptr) + throw std::runtime_error("CPUPolicy::callback_get_policy() not used as a callback method. nullptr ptr returned."); return _callback_policy; } diff --git a/src/backend/dynamic_process.cc b/src/backend/dynamic_process.cc index 6a77f4c..88f9d0b 100644 --- a/src/backend/dynamic_process.cc +++ b/src/backend/dynamic_process.cc @@ -23,7 +23,6 @@ #include "dynamic_thread.hh" #include -#include #include #include @@ -41,22 +40,22 @@ typedef std::vector::iterator ThreadIt; DynamicProcess::DynamicProcess(StaticProcess* core) : DynamicSchedulable(), _core(core) { - assert(core != NULL); + assert(core != nullptr); } DynamicProcess::DynamicProcess(const DynamicProcess &other) : Schedulable(), DynamicSchedulable(other), Process(), _core(other._core) -{ +{ for (Iseq seq = iseq(other._dynamic_threads); seq; ++seq) new DynamicThread(*(*seq), this); } DynamicProcess::~DynamicProcess() { - for_each(_dynamic_threads.begin(), + for_each(_dynamic_threads.begin(), _dynamic_threads.end(), - memory::deletor()); + [] (auto *p) { delete p; }); } std::vector @@ -82,7 +81,7 @@ DynamicProcess::get_state() const // This is the logic behind the code: // If there is at least one running thread, the result is // running. If not, it may be either blocked, ready, future or terminated. - + // We have these cases (a state takes precedence over some other one): // (a) if a thread is running, return immediately state_running // (b) if a thread is ready, puts unconditionally result as state_ready, @@ -97,7 +96,7 @@ DynamicProcess::get_state() const // (e) else (if all threads are state_terminated) put result as // state_terminated. - + for(Iseq seq = iseq(_dynamic_threads); seq; ++seq) { const state thread_state = (*seq)->get_state(); @@ -134,7 +133,7 @@ DynamicProcess::get_state() const // the next thread to start, e.g. the one with the least arrival_time, // has start time greater than the current process elapsed time, then // pass from state_future to state_terminated: - if (result == state_future && + if (result == state_future && next_thread_starts_at > static_cast(get_elapsed_time())) return state_terminated; diff --git a/src/backend/dynamic_process.hh b/src/backend/dynamic_process.hh index e133466..c1838e9 100644 --- a/src/backend/dynamic_process.hh +++ b/src/backend/dynamic_process.hh @@ -28,9 +28,9 @@ #include "dynamic_schedulable.hh" #include "static_process.hh" -#include - #include + +#include #include namespace sgpem @@ -65,7 +65,7 @@ namespace sgpem std::vector& get_dynamic_threads(); private: - memory::smart_ptr _core; + std::shared_ptr _core; std::vector _dynamic_threads; }; diff --git a/src/backend/dynamic_request.cc b/src/backend/dynamic_request.cc index a2ddbad..5f73966 100644 --- a/src/backend/dynamic_request.cc +++ b/src/backend/dynamic_request.cc @@ -24,9 +24,7 @@ #include "dynamic_thread.hh" #include -#include #include -#include #include #include @@ -39,8 +37,8 @@ DynamicRequest::DynamicRequest(StaticRequest *core, DynamicThread* owner) : _static_request(core), _dynamic_thread(owner) { - assert(core != NULL); - assert(owner != NULL); + assert(core != nullptr); + assert(owner != nullptr); // Leave this line: it helps us with a compiler warning if // the get_dynamic* method signature changes: std::vector& siblings = owner->get_dynamic_requests(); @@ -52,7 +50,7 @@ DynamicRequest::DynamicRequest(const DynamicRequest& other, DynamicThread* owner { typedef vector SubReqVec; - assert(owner != NULL); + assert(owner != nullptr); const SubReqVec& other_subs = other._dynamic_subrequests; @@ -72,7 +70,7 @@ DynamicRequest::DynamicRequest(const DynamicRequest& other, DynamicThread* owner DynamicRequest::~DynamicRequest() { for_each(_dynamic_subrequests.begin(), _dynamic_subrequests.end(), - memory::deletor()); + [] (auto *p) { delete p; }); } diff --git a/src/backend/dynamic_request.hh b/src/backend/dynamic_request.hh index 624a3cf..f82710d 100644 --- a/src/backend/dynamic_request.hh +++ b/src/backend/dynamic_request.hh @@ -33,15 +33,15 @@ namespace sgpem #include "dynamic_thread.hh" #include -#include +#include #include namespace sgpem { /** \brief A "dynamic" request, which represents the state * of a request at a particular temporal instant - */ + */ class SG_DLLLOCAL DynamicRequest : public Request { public: @@ -73,7 +73,7 @@ namespace sgpem // Undefined DynamicRequest(const DynamicRequest& other); - memory::smart_ptr _static_request; + std::shared_ptr _static_request; DynamicThread* _dynamic_thread; std::vector _dynamic_subrequests; }; diff --git a/src/backend/dynamic_resource.cc b/src/backend/dynamic_resource.cc index 6e4ac44..0be4c3c 100644 --- a/src/backend/dynamic_resource.cc +++ b/src/backend/dynamic_resource.cc @@ -24,7 +24,6 @@ #include #include -#include #include diff --git a/src/backend/dynamic_resource.hh b/src/backend/dynamic_resource.hh index b32acc4..8607800 100644 --- a/src/backend/dynamic_resource.hh +++ b/src/backend/dynamic_resource.hh @@ -21,14 +21,13 @@ #ifndef DYNAMIC_RESOURCE_HH #define DYNAMIC_RESOURCE_HH 1 - #include "glibmm/ustring.h" -#include - #include #include "static_resource.hh" +#include + namespace sgpem { @@ -36,18 +35,18 @@ namespace sgpem /// \brief Desribes the state of a resource entity in a particular moment /// of the simulation. /// - /// Contains part of the information used by the scheduling policies to + /// Contains part of the information used by the scheduling policies to /// perform scheduling. /// DynamicResource objects may be created by the system - /// via the Scheduler.step_forward() method (which then inserts them into a + /// via the Scheduler.step_forward() method (which then inserts them into a /// ::ConcreteEnvironment), or by the user on a resetted ::History by creating /// one of them anew. - /// + /// /// Actually this class does not provide any information to the system, nor it /// does play any particular role. It is here for the puropose of extensibility /// and beauty in general. - /// - /// These objects may be destroyed only by resetting an ::History, or via one + /// + /// These objects may be destroyed only by resetting an ::History, or via one /// of its methods. class DynamicResource; class SerializeVisitor; @@ -73,24 +72,24 @@ namespace sgpem /// \brief Serializes this object via the provided translator. - /// + /// /// Calls translator->from_resource(this). void serialize(SerializeVisitor& translator) const; /// \brief Returns a reference to the static resource object. - /// + /// /// This function returns a reference to the actual schedable object /// represented, along with its status, by this instance. StaticResource& get_core(); /// \brief Returns a constant reference to the static schedulable object. - /// + /// /// This function returns a constant reference to the actual schedable object /// represented, along with its status, by this instance. const StaticResource& get_core() const; private: - memory::smart_ptr _static_resource; + std::shared_ptr _static_resource; }; } diff --git a/src/backend/dynamic_schedulable.cc b/src/backend/dynamic_schedulable.cc index 40f322c..ac9d9f9 100644 --- a/src/backend/dynamic_schedulable.cc +++ b/src/backend/dynamic_schedulable.cc @@ -21,7 +21,6 @@ #include "dynamic_schedulable.hh" #include -#include #include diff --git a/src/backend/dynamic_sub_request.cc b/src/backend/dynamic_sub_request.cc index a249bc4..130a1dc 100644 --- a/src/backend/dynamic_sub_request.cc +++ b/src/backend/dynamic_sub_request.cc @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -36,9 +35,9 @@ DynamicSubRequest::DynamicSubRequest(StaticSubRequest* core, _static_subrequest(core), _owner(owner), _queue_position(-1), _ran_for(0), _state(Request::state_future) { - assert(core != NULL); - assert(owner != NULL); - + assert(core != nullptr); + assert(owner != nullptr); + // Leave this line: it helps us with a compiler warning if // the get_dynamic* method signature changes: std::vector& siblings = owner->get_dynamic_subrequests(); @@ -51,7 +50,7 @@ DynamicSubRequest::DynamicSubRequest(const DynamicSubRequest& other, _queue_position(other._queue_position), _ran_for(other._ran_for), _state(other._state) { - assert(owner != NULL); + assert(owner != nullptr); // Leave this line: it helps us with a compiler warning if // the get_dynamic* method signature changes: @@ -65,7 +64,7 @@ DynamicSubRequest::~DynamicSubRequest() bool DynamicSubRequest::operator==(const SubRequest& op2) const { - return _static_subrequest == + return _static_subrequest == down_cast(op2)._static_subrequest; } @@ -129,7 +128,7 @@ unsigned int DynamicSubRequest::decrease_remaining_time() { assert(_state == Request::state_allocated); - + unsigned int temp = get_remaining_time(); if (temp > 0) _ran_for++; diff --git a/src/backend/dynamic_sub_request.hh b/src/backend/dynamic_sub_request.hh index ab6c299..14e4dfa 100644 --- a/src/backend/dynamic_sub_request.hh +++ b/src/backend/dynamic_sub_request.hh @@ -35,7 +35,8 @@ namespace sgpem #include #include -#include + +#include namespace sgpem { @@ -63,14 +64,14 @@ namespace sgpem * \return false Otherwise */ virtual bool operator==(const SubRequest& op2) const; - + /** \brief Returns the key to the DynamicResource that was requested * - * The correct ::Resource object can be obtained via + * The correct ::Resource object can be obtained via * Environment.get_resources(), using the returned value as a key */ resource_key_t get_resource_key() const; - + /** \brief Returns the time the resource is needed * * This time is meant relative to a process executed time. @@ -100,7 +101,7 @@ namespace sgpem // Undefined DynamicSubRequest(const DynamicSubRequest&); - memory::smart_ptr _static_subrequest; + std::shared_ptr _static_subrequest; DynamicRequest* _owner; int _queue_position; unsigned int _ran_for; diff --git a/src/backend/dynamic_thread.cc b/src/backend/dynamic_thread.cc index 8fb7593..63d6749 100644 --- a/src/backend/dynamic_thread.cc +++ b/src/backend/dynamic_thread.cc @@ -27,17 +27,14 @@ #include #include -#include -#include - using namespace sgpem; DynamicThread::DynamicThread(StaticThread* core, DynamicProcess* parent) : DynamicSchedulable(), _core(core), _state(state_future), _parent(parent), _ran_for(0), _last_acquisition(-1), _last_release(-1) { - assert(core != NULL); - assert(parent != NULL); + assert(core != nullptr); + assert(parent != nullptr); // Leave this line: it helps us with a compiler warning if // the get_dynamic* method signature changes: @@ -51,9 +48,9 @@ DynamicThread::DynamicThread(const DynamicThread &other, DynamicProcess* parent) _ran_for(other._ran_for), _last_acquisition(other._last_acquisition), _last_release(other._last_release) { - typedef std::vector::const_iterator ReqIt; + typedef std::vector::const_iterator ReqIt; - assert(parent != NULL); + assert(parent != nullptr); const std::vector& other_req = other._dynamic_requests; @@ -69,7 +66,7 @@ DynamicThread::DynamicThread(const DynamicThread &other, DynamicProcess* parent) DynamicThread::~DynamicThread() { for_each(_dynamic_requests.begin(), _dynamic_requests.end(), - memory::deletor()); + [] (auto *p) { delete p; }); } @@ -97,7 +94,7 @@ DynamicThread::set_state(state new_state) std::vector DynamicThread::get_requests() { - return std::vector(_dynamic_requests.begin(), _dynamic_requests.end()); + return std::vector(_dynamic_requests.begin(), _dynamic_requests.end()); } void diff --git a/src/backend/dynamic_thread.hh b/src/backend/dynamic_thread.hh index 05edb64..83160b2 100644 --- a/src/backend/dynamic_thread.hh +++ b/src/backend/dynamic_thread.hh @@ -30,7 +30,7 @@ #include "dynamic_process.hh" #include "dynamic_schedulable.hh" -#include +#include namespace sgpem { @@ -84,11 +84,11 @@ namespace sgpem /** \brief Gets the last istant this schedulable has been put in a Running state. - + \return Current value of last_acquisition. */ int get_last_acquisition() const; - + /** \brief Sets/gets the last istant this schedulable has been put in a Running state. @@ -177,7 +177,7 @@ namespace sgpem /** \brief Pointer to static counterpart of this object. */ - memory::smart_ptr _core; + std::shared_ptr _core; /** \brief The current state of this thread. diff --git a/gettext.h b/src/backend/gettext.h similarity index 100% rename from gettext.h rename to src/backend/gettext.h diff --git a/src/backend/global_preferences.cc b/src/backend/global_preferences.cc index 0ee8bad..a2687d6 100644 --- a/src/backend/global_preferences.cc +++ b/src/backend/global_preferences.cc @@ -18,12 +18,12 @@ // along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - #include "gettext.h" #include #include +#include #include #include #include @@ -40,7 +40,7 @@ using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; GlobalPreferences::GlobalPreferences() : _mod_dirs(1, PLUGDIR), _pol_dirs(1, POLDIR), _speed(1000) @@ -48,20 +48,20 @@ GlobalPreferences::GlobalPreferences() Glib::ustring -GlobalPreferences::get_preferences_dir() const throw(Glib::FileError) +GlobalPreferences::get_preferences_dir() const { using namespace Glib; // windows-specific part, i don't use ifdef WIN32 since I'm not sure how // it will behave on MinGW/Cygwin... #ifdef _MSC_VER TCHAR raw_path[MAX_PATH]; - - if(SUCCEEDED(SHGetFolderPath(NULL, - CSIDL_APPDATA, - NULL, - SHGFP_TYPE_CURRENT, + + if(SUCCEEDED(SHGetFolderPath(NULL, + CSIDL_APPDATA, + nullptr, + SHGFP_TYPE_CURRENT, raw_path))) - { + { // if UNICODE, characters are 16bit, otherwise plain bytes # ifdef UNICODE std::wstring path(raw_path); @@ -70,26 +70,26 @@ GlobalPreferences::get_preferences_dir() const throw(Glib::FileError) # endif path += TEXT("\\sgpemv2"); - + // Create "Application Data\sgpemv2". if not present, // otherwise it is a no-op - CreateDirectory(path.c_str(), NULL); - + CreateDirectory(path.c_str(), nullptr); + // if UNICODE, we need to convert to utf-8 // I'm not sure if this part is OK, anyway... # ifdef UNICODE char raw_path_utf[MAX_PATH]; - - WideCharToMultiByte(CP_UTF8, 0, path.c_str(), -1, raw_path_utf, MAX_PATH, NULL, NULL); - + + WideCharToMultiByte(CP_UTF8, 0, path.c_str(), -1, raw_path_utf, MAX_PATH, nullptr, nullptr); + return Glib::ustring(raw_path_utf); # else - // no UNICODE, simply return plain string + // no UNICODE, simply return plain string return path; # endif //~UNICODE - } - else - throw FileError(FileError::FAILED, _("Unable to obtain Application Data directory")); + } + else + throw FileError(FileError::FAILED, _("Unable to obtain Application Data directory")); #else @@ -107,7 +107,7 @@ GlobalPreferences::get_preferences_dir() const throw(Glib::FileError) Glib::ustring -GlobalPreferences::get_config_filename() const throw(Glib::FileError) +GlobalPreferences::get_config_filename() const { const Glib::ustring filename = get_preferences_dir() + G_DIR_SEPARATOR_S + Glib::ustring("sgpemrc"); return filename; @@ -139,7 +139,7 @@ GlobalPreferences::set_speed(int new_speed) return old_speed; } -const Glib::ustring +const Glib::ustring GlobalPreferences::get_schedulable_color(Schedulable::state st) const { switch(st) @@ -159,7 +159,7 @@ GlobalPreferences::get_schedulable_color(Schedulable::state st) const } } -const Glib::ustring +const Glib::ustring GlobalPreferences::get_request_color(Request::state st) const { switch(st) @@ -178,9 +178,9 @@ GlobalPreferences::get_request_color(Request::state st) const return "black"; } } - + void -GlobalPreferences::write_configrc() throw(Glib::FileError) +GlobalPreferences::write_configrc() { KeyFile kf; @@ -189,7 +189,7 @@ GlobalPreferences::write_configrc() throw(Glib::FileError) } void -GlobalPreferences::load_configrc() throw(Glib::FileError) +GlobalPreferences::load_configrc() { KeyFile kf; diff --git a/src/backend/module.cc b/src/backend/module.cc index 49772f3..a05f8cc 100644 --- a/src/backend/module.cc +++ b/src/backend/module.cc @@ -21,7 +21,7 @@ using namespace sgpem; -Module::Module(const Glib::ustring& identifier) throw(InvalidPluginException) : +Module::Module(const Glib::ustring& identifier) : Glib::Module(identifier), _enabled(false), _id(identifier), diff --git a/src/backend/plugin_manager.cc b/src/backend/plugin_manager.cc index 1d19d8c..4c62f87 100644 --- a/src/backend/plugin_manager.cc +++ b/src/backend/plugin_manager.cc @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -35,7 +34,7 @@ using namespace sgpem; -template class Singleton; +template class sgpem::Singleton; std::vector @@ -47,10 +46,10 @@ PluginManager::get_module_list() const void PluginManager::rescan_dirs() { - Module* module = NULL; + Module* module = nullptr; for_each(_modules.begin(), _modules.end(), - memory::deletor()); + [] (auto *p) { delete p; }); _modules.clear(); GlobalPreferences& prefs = GlobalPreferences::get_instance(); @@ -79,7 +78,7 @@ PluginManager::rescan_dirs() _modules.push_back(module); std::cerr << "\tSuccess" << std::endl; } - catch (InvalidPluginException e) + catch (InvalidPluginException& e) { std::cerr << "\tFailed, invalid plugin: " << e.what() << std::endl; } diff --git a/src/backend/policy_parameters.cc b/src/backend/policy_parameters.cc index e91343f..fcea4d4 100644 --- a/src/backend/policy_parameters.cc +++ b/src/backend/policy_parameters.cc @@ -214,7 +214,7 @@ PolicyParameters::set_string(ustring name, const ustring& value) \throws A PolicyParametersException if the parameter has not been found. */ int -PolicyParameters::get_int(ustring name) const throw(PolicyParametersException) +PolicyParameters::get_int(ustring name) const { map >::const_iterator i = int_map.find(name); if (i == int_map.end()) @@ -230,7 +230,7 @@ PolicyParameters::get_int(ustring name) const throw(PolicyParametersException) \throws A PolicyParametersException if the parameter has not been found. */ float -PolicyParameters::get_float(ustring name) const throw(PolicyParametersException) +PolicyParameters::get_float(ustring name) const { map >::const_iterator i = float_map.find(name); if (i == float_map.end()) @@ -246,7 +246,7 @@ PolicyParameters::get_float(ustring name) const throw(PolicyParametersException) \throws A PolicyParametersException if the parameter has not been found. */ ustring -PolicyParameters::get_string(ustring name) const throw(PolicyParametersException) +PolicyParameters::get_string(ustring name) const { map >::const_iterator i = string_map.find(name); if (i == string_map.end()) diff --git a/src/backend/ready_queue.cc b/src/backend/ready_queue.cc index b8d4c0f..8f1f41a 100644 --- a/src/backend/ready_queue.cc +++ b/src/backend/ready_queue.cc @@ -25,7 +25,7 @@ using sgpem::Thread; void ReadyQueue::swap(position a, position b) - throw (std::out_of_range) + { if (a == b) return; @@ -49,7 +49,7 @@ ReadyQueue::size() const sgpem::Thread& ReadyQueue::get_item_at(position index) - throw (std::out_of_range) + { // Checks index access return *_scheds.at(index); @@ -57,7 +57,7 @@ ReadyQueue::get_item_at(position index) const sgpem::Thread& ReadyQueue::get_item_at(position index) const - throw (std::out_of_range) + { // Checks index access return *_scheds.at(index); @@ -72,7 +72,7 @@ ReadyQueue::append(Thread& thread) void ReadyQueue::bubble_to_front(position x) - throw(std::out_of_range) + { while(x > 0) { diff --git a/src/backend/resource_policies_gatekeeper.cc b/src/backend/resource_policies_gatekeeper.cc index d68a697..95c7f21 100644 --- a/src/backend/resource_policies_gatekeeper.cc +++ b/src/backend/resource_policies_gatekeeper.cc @@ -40,7 +40,7 @@ using std::runtime_error; using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; typedef vector::iterator ManagerIterator; typedef map::iterator PolicyIterator; @@ -54,7 +54,7 @@ ResourcePoliciesGatekeeper::get_registered() const void ResourcePoliciesGatekeeper::register_manager(ResourcePolicyManager* manager) { - assert(manager != NULL); + assert(manager != nullptr); ManagerIterator end = _registered.end(); @@ -65,7 +65,7 @@ ResourcePoliciesGatekeeper::register_manager(ResourcePolicyManager* manager) void ResourcePoliciesGatekeeper::unregister_manager(ResourcePolicyManager* manager) { - assert(manager != NULL); + assert(manager != nullptr); ManagerIterator end = _registered.end(); ManagerIterator pos = find(_registered.begin(), end, manager); @@ -78,9 +78,9 @@ ResourcePoliciesGatekeeper::unregister_manager(ResourcePolicyManager* manager) } ResourcePolicy& -ResourcePoliciesGatekeeper::get_current_policy(History* history) throw(runtime_error) +ResourcePoliciesGatekeeper::get_current_policy(History* history) { - assert(history != NULL); + assert(history != nullptr); PolicyIterator policy = _active_policies.find(history); @@ -94,7 +94,7 @@ ResourcePoliciesGatekeeper::get_current_policy(History* history) throw(runtime_e void ResourcePoliciesGatekeeper::activate_policy(History *history, ResourcePolicy* policy) { - assert(history != NULL && policy != NULL); + assert(history != nullptr && policy != nullptr); _active_policies[history] = policy; // the content of history (if any) is not vaild any more. @@ -116,7 +116,7 @@ ResourcePoliciesGatekeeper::deactivate_policies(const ResourcePolicyManager& man for (PolicyIterator it = _active_policies.begin(); it != _active_policies.end();) if (it->second == *avail_it) // Please note the postfix increment (operating - // on the old iterator, now invalidated by erase) + // on the old iterator, now invalidated by erase) _active_policies.erase(it++); else ++it; diff --git a/src/backend/resource_policy_fifo.cc b/src/backend/resource_policy_fifo.cc index 4892300..5b4a536 100644 --- a/src/backend/resource_policy_fifo.cc +++ b/src/backend/resource_policy_fifo.cc @@ -30,13 +30,13 @@ ResourcePolicyFiFo::~ResourcePolicyFiFo() void ResourcePolicyFiFo::configure() - throw(UserInterruptException) + { } void ResourcePolicyFiFo::enforce(Environment& /*environment*/, Environment::SubRequestQueue& queue, SubRequest& sr) - throw(UserInterruptException) + { typedef Environment::SubRequestQueue SubRequestQueue; diff --git a/src/backend/resource_policy_fifo.hh b/src/backend/resource_policy_fifo.hh index bf68b76..fe1d2a2 100644 --- a/src/backend/resource_policy_fifo.hh +++ b/src/backend/resource_policy_fifo.hh @@ -47,7 +47,7 @@ namespace sgpem Because it's a pure virtual method, must be re-implemented in concrete derived classes. */ - virtual void configure() throw(UserInterruptException); + virtual void configure(); /** Mixes the queues. @@ -55,7 +55,7 @@ namespace sgpem Because it's a pure virtual method, must be re-implemented in concrete derived classes. */ - virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr) throw(UserInterruptException); + virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr); /** Gets a string description of the policy. diff --git a/src/backend/resource_policy_lifo.cc b/src/backend/resource_policy_lifo.cc index 6f3dd5f..d0dee7d 100644 --- a/src/backend/resource_policy_lifo.cc +++ b/src/backend/resource_policy_lifo.cc @@ -29,13 +29,13 @@ ResourcePolicyLiFo::~ResourcePolicyLiFo() void ResourcePolicyLiFo::configure() - throw(UserInterruptException) + { } void ResourcePolicyLiFo::enforce(Environment& /*environment*/, Environment::SubRequestQueue& queue, SubRequest& sr) - throw(UserInterruptException) + { typedef Environment::SubRequestQueue SubRequestQueue; diff --git a/src/backend/resource_policy_lifo.hh b/src/backend/resource_policy_lifo.hh index dd82a36..dad4b42 100644 --- a/src/backend/resource_policy_lifo.hh +++ b/src/backend/resource_policy_lifo.hh @@ -47,14 +47,14 @@ namespace sgpem * Because it's a pure virtual method, must be re-implemented * in concrete derived classes. */ - virtual void configure() throw(UserInterruptException); + virtual void configure(); /** \brief Mixes the queues. * * Because it's a pure virtual method, must be re-implemented * in concrete derived classes. */ - virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr) throw(UserInterruptException); + virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr); /** \brief Gets a string description of the policy. * diff --git a/src/backend/resource_policy_priority.cc b/src/backend/resource_policy_priority.cc index ae4bc6f..fa0dbbf 100644 --- a/src/backend/resource_policy_priority.cc +++ b/src/backend/resource_policy_priority.cc @@ -31,13 +31,13 @@ ResourcePolicyPriority::~ResourcePolicyPriority() void ResourcePolicyPriority::configure() - throw(UserInterruptException) + { } void ResourcePolicyPriority::enforce(Environment& /*environment*/, Environment::SubRequestQueue& queue, SubRequest& sr) - throw(UserInterruptException) + { typedef Environment::SubRequestQueue SubRequestQueue; diff --git a/src/backend/resource_policy_priority.hh b/src/backend/resource_policy_priority.hh index 16f9cf5..1e8946a 100644 --- a/src/backend/resource_policy_priority.hh +++ b/src/backend/resource_policy_priority.hh @@ -52,7 +52,7 @@ namespace sgpem /// \brief Initializes the inner components of the policy. /// /// Does nothing. - virtual void configure() throw(UserInterruptException); + virtual void configure(); /// \brief Sorts the subrequest queue letting higher priority threads to be the first ones /// to get the resources. @@ -63,7 +63,7 @@ namespace sgpem /// \param environment the environment on which the policy applies. /// \param queue the queue where a subrequest has just been added. /// \param sr the subrequest which has just been added. - virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr) throw(UserInterruptException); + virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr); /// \brief Returns a description of the policy. /// diff --git a/src/backend/resource_policy_priority_inheritance.cc b/src/backend/resource_policy_priority_inheritance.cc index 9915664..f979525 100644 --- a/src/backend/resource_policy_priority_inheritance.cc +++ b/src/backend/resource_policy_priority_inheritance.cc @@ -30,13 +30,13 @@ ResourcePolicyPriorityInheritance::~ResourcePolicyPriorityInheritance() void ResourcePolicyPriorityInheritance::configure() - throw(UserInterruptException) + { } void ResourcePolicyPriorityInheritance::enforce(Environment& /*environment*/, Environment::SubRequestQueue& queue, SubRequest& sr) - throw(UserInterruptException) + { typedef Environment::SubRequestQueue SubRequestQueue; diff --git a/src/backend/resource_policy_priority_inheritance.hh b/src/backend/resource_policy_priority_inheritance.hh index 7d803a1..ba873d7 100644 --- a/src/backend/resource_policy_priority_inheritance.hh +++ b/src/backend/resource_policy_priority_inheritance.hh @@ -49,7 +49,7 @@ namespace sgpem Because it's a pure virtual method, must be re-implemented in concrete derived classes. */ - virtual void configure() throw(UserInterruptException); + virtual void configure(); /** \brief Mixes the queues. @@ -59,7 +59,7 @@ namespace sgpem */ virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, - SubRequest& sr) throw(UserInterruptException); + SubRequest& sr); /** \brief Gets a string description of the policy. diff --git a/src/backend/scheduler.cc b/src/backend/scheduler.cc index a6e68e4..0275c2e 100644 --- a/src/backend/scheduler.cc +++ b/src/backend/scheduler.cc @@ -49,7 +49,7 @@ using namespace std; using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; typedef std::vector Processes; @@ -78,7 +78,7 @@ static void determine_subr_allocable_status(const Resource& res, const SubReques bool is_running(const Thread* running_thread) { - return running_thread != NULL && running_thread->get_state() == Schedulable::state_running; + return running_thread != nullptr && running_thread->get_state() == Schedulable::state_running; } @@ -96,7 +96,7 @@ collect_threads(const std::vector& procs, } -void +void prepare_ready_queue(ConcreteEnvironment& snapshot, const Threads& all_threads) { @@ -113,7 +113,7 @@ prepare_ready_queue(ConcreteEnvironment& snapshot, // When a thread terminates, unconditionally kill all its requests void -terminate_all_requests_of(DynamicThread& thread, +terminate_all_requests_of(DynamicThread& thread, ConcreteEnvironment& environment) { Requests& reqs = thread.get_dynamic_requests(); @@ -134,8 +134,8 @@ terminate_all_requests_of(DynamicThread& thread, // For the current thread, see if there are requests that are exhausted void -update_allocated_requests(DynamicThread& running_thread, - ConcreteEnvironment& environment) +update_allocated_requests(DynamicThread& running_thread, + ConcreteEnvironment& environment) { // Go for all dynamic requests of this thread Requests& reqs = running_thread.get_dynamic_requests(); @@ -162,9 +162,9 @@ update_allocated_requests(DynamicThread& running_thread, } -// This function main role is to raise the requests of a thread which is trying to run. -// After finding those future requests that should not be future any more, each of their -// subrequests is added to the queue of a resource. Once put in the queue, their state +// This function main role is to raise the requests of a thread which is trying to run. +// After finding those future requests that should not be future any more, each of their +// subrequests is added to the queue of a resource. Once put in the queue, their state // is either ALLOCABLE or UNALLOCABLE. // Remember that a thread may run only if all of its requests are either FUTURE, // ALLOCATED or EXHAUSTED. @@ -179,7 +179,7 @@ raise_new_requests(DynamicThread& running_thread, ConcreteEnvironment& environme SubRequests& subreqs = (*req_it)->get_dynamic_subrequests(); // Add to the queue only requests passing from future to another state: - if(cur_req.get_state() == Request::state_future && + if(cur_req.get_state() == Request::state_future && cur_req.get_instant() == running_thread.get_elapsed_time()) { for (Iseq subr_it = iseq(subreqs); subr_it; ++subr_it) @@ -189,15 +189,15 @@ raise_new_requests(DynamicThread& running_thread, ConcreteEnvironment& environme Environment::resource_key_t rkey = cur_subr.get_resource_key(); SubRequestQueue& queue = environment.get_request_queue(rkey); queue.push_back(&cur_subr); - - /// TODO: right here, right now we should call the resource policy to - /// update the queue. Updates the state of the subrequest depending + + /// TODO: right here, right now we should call the resource policy to + /// update the queue. Updates the state of the subrequest depending /// on the position in the queue, as explained before. - resource_policy.enforce(environment, queue, cur_subr); + resource_policy.enforce(environment, queue, cur_subr); // Get the number of places for the corresponding resource Resource& resource = *environment.get_resources().find(rkey)->second; - + // WARNING: adding a new request may require updating the status of ALL other // requests in the queue @@ -209,18 +209,18 @@ raise_new_requests(DynamicThread& running_thread, ConcreteEnvironment& environme // determine_subr_allocable_status(cur_req, cur_subr, resource, queue); - } //~ for(over subrequests) + } //~ for(over subrequests) } //~ if(request is future and is time to allocate it) // A request may be ALLOCATED only when it is ALLOCABLE, i.e. when all its subrequests // are ALLOCABLE. A request is allocated when all its subrequests are either TERMINATED - // or ALLOCATED, but at least one is ALLOCATED. - // Now, since the thread is willing to run, we must allocate the request if possible. - - // All requests we treat are at the moment non-preemptable, so it is not permitted to temporarily - // preempt a resource to a thread to free a place and potentially allow one other thread - // to use that place. This is why we need to allocate requests (which means allocating + // or ALLOCATED, but at least one is ALLOCATED. + // Now, since the thread is willing to run, we must allocate the request if possible. + + // All requests we treat are at the moment non-preemptable, so it is not permitted to temporarily + // preempt a resource to a thread to free a place and potentially allow one other thread + // to use that place. This is why we need to allocate requests (which means allocating // resources to threads). // If it is actually allocable, allocate it @@ -231,12 +231,12 @@ raise_new_requests(DynamicThread& running_thread, ConcreteEnvironment& environme const SubRequests& const_subreqs = subreqs; for(Iseq it_dsrs = iseq(const_subreqs); it_dsrs; ++it_dsrs) { - + DynamicSubRequest& subreq = **it_dsrs; assert(subreq.get_state() == Request::state_allocable); /* // Move this request up the queue, to the back of the allocated - // subrequests. This is mainly for display. :-) + // subrequests. This is mainly for display. :-) // The rest of the queue sorting business is up to the resource policy. Environment::resource_key_t rkey = subreq.get_resource_key(); SubRequestQueue& queue = environment.get_request_queue(rkey); @@ -261,7 +261,7 @@ raise_new_requests(DynamicThread& running_thread, ConcreteEnvironment& environme default: break; }//~ switch(request state) - + } //~ for(over requests) } @@ -273,7 +273,7 @@ determine_subr_allocable_status(const Resource& res, const SubRequestQueue& queu { unsigned int total_places = res.get_places(); unsigned int position_in_queue = 0; - for(Iseq queue_it = iseq(queue); + for(Iseq queue_it = iseq(queue); queue_it; queue_it++, position_in_queue++) { DynamicSubRequest& sr = (DynamicSubRequest&) **queue_it; @@ -346,10 +346,10 @@ look_for_mutant_request_states(ConcreteEnvironment& environment, alive_threads++; thread.set_state(Schedulable::state_ready); } - + } //~ for(over subrequests in the queue) } //~ for(over resources) - + } @@ -380,7 +380,7 @@ Scheduler::get_policy() bool Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& resource_policy) - throw(UserInterruptException, MalformedPolicyException) + { // This very method should be exclusive: no concurrent behaviour, from when we // store a readyqueue and policy pointer for the user-policy to retrieve, to when @@ -396,34 +396,34 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& ConcreteHistory& concrete_history = static_cast(history); // Use an auto_ptr since we've some exceptions in the coming... - auto_ptr new_snapshot(new ConcreteEnvironment(concrete_history.get_environment_at(current_instant))); + unique_ptr new_snapshot(new ConcreteEnvironment(concrete_history.get_environment_at(current_instant))); Threads all_threads; - DynamicThread* running_thread = NULL; + DynamicThread* running_thread = nullptr; collect_threads(new_snapshot->get_processes(), all_threads); - // The first thing we've to do is to update the state of the old + // The first thing we've to do is to update the state of the old // running thread, if there's one. for (Iseq it = iseq(all_threads); it; ++it) - { + { DynamicThread& current = **it; - + // Save the current running thread for future usage, if it hasn't ended // its allotted time if (current.get_state() == Schedulable::state_running) { running_thread = ¤t; // Even if we can change its state to terminate - + // increasing the time elapsed of the running thread + process // should be done here as the first thing, instead than // directly after selecting them if (current.get_total_cpu_time() - current.get_elapsed_time() > 0) current.decrease_remaining_time(); - + // 4a. Look for exhausted requests for the running thread update_allocated_requests(current, *new_snapshot); - + // 2. mark threads that used all their allotted time as terminated, // and put their requests as exhausted if (current.get_total_cpu_time() - current.get_elapsed_time() == 0) @@ -431,7 +431,7 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& current.set_state(Schedulable::state_terminated); current.set_last_release(current_instant); terminate_all_requests_of(current, *new_snapshot); - running_thread = NULL; + running_thread = nullptr; } // if we found the running thread, there isn't another one, @@ -442,10 +442,10 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& } //~ for over all threads - // When a new instant cames, we could have to update the state of future - // threads to make them ready. We also keep a count of alive threads + // When a new instant cames, we could have to update the state of future + // threads to make them ready. We also keep a count of alive threads for (Iseq it = iseq(all_threads); it; ++it) - { + { DynamicThread& current = **it; // 1. mark future threads as ready, if appropriate @@ -456,7 +456,7 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& parent.get_elapsed_time() == current.get_arrival_time()) current.set_state(Schedulable::state_ready); } - + // 3. check for simulation termination (we can directly use threads // for this check, since processes' state is based upon threads' one) Schedulable::state cur_state = current.get_state(); @@ -467,13 +467,13 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& } } //~ for over all_threads - + // ?. Time to see if some unallocable request became allocable, so // the thread can pass from blocked to ready state, or the other way // round look_for_mutant_request_states(*new_snapshot, alive_threads); - // Now if the simulation ended we append the newly + // Now if the simulation ended we append the newly // created environment and return false if (alive_threads == 0) goto final_cleanup; @@ -493,7 +493,7 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& // ?. See if old running_thread has to be put to ready state // This happens when a time slice ends - if (is_running(running_thread) && time_slice > 0 && + if (is_running(running_thread) && time_slice > 0 && // A process can be preempted every n-th time-slice, so we use the modulo operator: (current_instant - running_thread->get_last_acquisition()) % time_slice == 0) { @@ -504,13 +504,13 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& prepare_ready_queue(*new_snapshot, all_threads); - // If the policy is preemptible, and we still have a running thread, + // If the policy is preemptible, and we still have a running thread, // add it to the queue. if(preemptive_policy && is_running(running_thread)) _ready_queue->append(*running_thread); // ?. Ask the policy to sort the queue. If we must select - // a new thread and it can't run for some reason (it goes blocked, or + // a new thread and it can't run for some reason (it goes blocked, or // terminates), then we remove it from the built ReadyQueue and // check if the next one can run (see while loop further below). if(_ready_queue->size() > 0) cpu_policy.sort_queue(); @@ -521,36 +521,36 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& // since the queue is already sorted // * else we've to select another running thread, so we continue down in the method if( // Non-preemptive policy, not ended time-slice: - (!preemptive_policy && is_running(running_thread)) || - // Pre-emptive policy, running thread still the first of the queue. + (!preemptive_policy && is_running(running_thread)) || + // Pre-emptive policy, running thread still the first of the queue. // Note: if is_running(running_thread) == true, then _ready_queue->size() > 0 (preemptive_policy && is_running(running_thread) && &_ready_queue->get_item_at(0) == running_thread) ) { - raise_new_requests(*running_thread, *new_snapshot, resource_policy); + raise_new_requests(*running_thread, *new_snapshot, resource_policy); if(running_thread->get_state() != Schedulable::state_blocked) goto final_cleanup; else { running_thread->set_last_release(current_instant); _ready_queue->erase_first(); - running_thread = NULL; + running_thread = nullptr; alive_threads--; // Proceed to select a new running thread, below } } - + bool we_ve_got_a_winner = false; while(_ready_queue->size() > 0 && !we_ve_got_a_winner) // No sense in trying to schedule something that isn't there - { - // Else, it's time to see if the first candidate can run + { + // Else, it's time to see if the first candidate can run DynamicThread& candidate = (DynamicThread&) _ready_queue->get_item_at(0); - + // If a thread has been created with duration "0" (silly, but possible); // if you think it's safe, you can change this condition with an assert // and delete the body of the ``if''. if(candidate.get_total_cpu_time() - candidate.get_elapsed_time() == 0) { - candidate.set_last_acquisition(current_instant); + candidate.set_last_acquisition(current_instant); candidate.set_last_release(current_instant); candidate.set_state(Schedulable::state_terminated); // Put every request of this thread to state_exhausted @@ -568,12 +568,12 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& we_ve_got_a_winner /*!hurrah!*/ = true; else // if blocked, we've to remove it from the ready queue { - _ready_queue->erase_first(); + _ready_queue->erase_first(); alive_threads--; } - } + } - // ?. Finally select the new thread (if appropriate); now we're sure + // ?. Finally select the new thread (if appropriate); now we're sure // the one we have can run if (we_ve_got_a_winner) { @@ -587,7 +587,7 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& // new runner. if(&new_running != running_thread) { - if(running_thread != NULL) + if(running_thread != nullptr) { running_thread->set_state(Schedulable::state_ready); running_thread->set_last_release(current_instant); @@ -600,8 +600,8 @@ Scheduler::step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& catch (const CPUPolicyException& e) { // Reset values that the policy doesn't need anymore - _policy = NULL; - _ready_queue = NULL; + _policy = nullptr; + _ready_queue = nullptr; // Do we need to update/reset something else? @@ -618,8 +618,8 @@ final_cleanup: concrete_history.append_new_environment(new_snapshot.release()); // Reset values that the policy doesn't need anymore - _policy = NULL; - _ready_queue = NULL; + _policy = nullptr; + _ready_queue = nullptr; // If we got there, a step has been performed. // Return if we can perform another step. diff --git a/src/backend/serializers_gatekeeper.cc b/src/backend/serializers_gatekeeper.cc index adc14b1..e180724 100644 --- a/src/backend/serializers_gatekeeper.cc +++ b/src/backend/serializers_gatekeeper.cc @@ -35,7 +35,7 @@ using std::runtime_error; using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; typedef vector::iterator SerializerIterator; @@ -48,7 +48,7 @@ SerializersGatekeeper::get_registered() const void SerializersGatekeeper::register_serializer(Serializer* serializer) { - assert(serializer != NULL); + assert(serializer != nullptr); SerializerIterator end = _registered.end(); @@ -59,7 +59,7 @@ SerializersGatekeeper::register_serializer(Serializer* serializer) void SerializersGatekeeper::unregister_serializer(Serializer* serializer) { - assert(serializer != NULL); + assert(serializer != nullptr); SerializerIterator end = _registered.end(); SerializerIterator pos = find(_registered.begin(), end, serializer); diff --git a/src/backend/sgpemv2/config.h.in b/src/backend/sgpemv2/config.h.in new file mode 100644 index 0000000..853552f --- /dev/null +++ b/src/backend/sgpemv2/config.h.in @@ -0,0 +1,7 @@ +#define PACKAGE "@PROJECT_NAME@" + +#define LOCALEDIR "@localedir@" +#define UIDIR "@uidir@" +#define POLDIR "@policiesdir@" +#define PLUGDIR "@plugindir@" + diff --git a/src/backend/sgpemv2/cpu_policies_gatekeeper.hh b/src/backend/sgpemv2/cpu_policies_gatekeeper.hh index 55a1f73..1f70f3f 100644 --- a/src/backend/sgpemv2/cpu_policies_gatekeeper.hh +++ b/src/backend/sgpemv2/cpu_policies_gatekeeper.hh @@ -80,13 +80,13 @@ namespace sgpem * If no policy was previously activated for the attached * ::History, throw an appropriate exception. */ - CPUPolicy* get_current_policy(History* history) throw(std::runtime_error); + CPUPolicy* get_current_policy(History* history); /** \brief Associates a policy with history. * If an exception is thrown, the current associated *policy with this history * (if there are any), is \b no more active, \b nor associated */ - void activate_policy(History* history, CPUPolicy* policy) throw(UserInterruptException, MalformedPolicyException); + void activate_policy(History* history, CPUPolicy* policy); private: diff --git a/src/backend/sgpemv2/cpu_policy.hh b/src/backend/sgpemv2/cpu_policy.hh index 372adf1..4b5a5bf 100644 --- a/src/backend/sgpemv2/cpu_policy.hh +++ b/src/backend/sgpemv2/cpu_policy.hh @@ -53,7 +53,7 @@ namespace sgpem Because it's a pure virtual method, must be re-implemented in concrete derived classes. */ - virtual void configure() throw(UserInterruptException, MalformedPolicyException) = 0; + virtual void configure() = 0; /** Sort the \ref ReadyQueue object that contain all the Schedulable objects @@ -62,7 +62,7 @@ namespace sgpem Because it's a pure virtual method, must be re-implemented in concrete derived classes. */ - virtual void sort_queue() const throw(UserInterruptException, MalformedPolicyException) = 0; + virtual void sort_queue() const = 0; /** Gets a string description of the policy. @@ -82,7 +82,7 @@ namespace sgpem in concrete derived classes. \return True if this policy is preemptible. */ - virtual bool is_pre_emptive() const throw(UserInterruptException, MalformedPolicyException) = 0; + virtual bool is_pre_emptive() const = 0; /** Gets the time quantum for the policy. @@ -91,9 +91,9 @@ namespace sgpem in concrete derived classes. \return Time quantum for the policy. */ - virtual int get_time_slice() const throw(UserInterruptException, MalformedPolicyException) = 0; + virtual int get_time_slice() const = 0; - virtual void activate() throw(UserInterruptException, MalformedPolicyException) = 0; + virtual void activate() = 0; virtual void deactivate() = 0; @@ -105,12 +105,12 @@ namespace sgpem PolicyParameters& get_parameters(); /** This method is used only as a callback by scripting languages */ - static CPUPolicy* callback_get_policy() throw(std::runtime_error); + static CPUPolicy* callback_get_policy(); protected: PolicyParameters _parameters; - static void set_callback_policy(CPUPolicy* ptr = NULL); + static void set_callback_policy(CPUPolicy* ptr = nullptr); private: // Used by callback_get_policy: diff --git a/src/backend/sgpemv2/global_preferences.hh b/src/backend/sgpemv2/global_preferences.hh index 93ca15a..d63b62d 100644 --- a/src/backend/sgpemv2/global_preferences.hh +++ b/src/backend/sgpemv2/global_preferences.hh @@ -57,7 +57,7 @@ namespace sgpem /** \return GlobalPreferences configuration filename */ - Glib::ustring get_config_filename() const throw(Glib::FileError); + Glib::ustring get_config_filename() const; /** \brief Returns configured Policy directories @@ -110,7 +110,7 @@ namespace sgpem We advice using a key=value text format. #- Close the configuration file. */ - void write_configrc() throw(Glib::FileError); + void write_configrc(); /** \brief Load global preferences from disk @@ -119,7 +119,7 @@ namespace sgpem \throw std::io_error */ - void load_configrc() throw(Glib::FileError); + void load_configrc(); /** \brief Prepare directory to read/write preferences to disk * @@ -128,7 +128,7 @@ namespace sgpem * %ApplicationData%/sgpemv2, on *nix systems $HOME/.sgpemv2. * If it doesn't exist, attempt to create it. */ - Glib::ustring get_preferences_dir() const throw(Glib::FileError); + Glib::ustring get_preferences_dir() const; private: GlobalPreferences(); diff --git a/src/backend/sgpemv2/history.hh b/src/backend/sgpemv2/history.hh index a17ca05..e061ddc 100644 --- a/src/backend/sgpemv2/history.hh +++ b/src/backend/sgpemv2/history.hh @@ -73,7 +73,7 @@ namespace sgpem virtual size_t get_size() const = 0; virtual const Environment& get_last_environment() const = 0; - virtual const Environment& get_environment_at(position index) const throw(std::out_of_range) = 0; + virtual const Environment& get_environment_at(position index) const = 0; /** \brief Removes a Resource from the whole History. @@ -280,10 +280,10 @@ namespace sgpem virtual void attach(HistoryObserver& observer); /** - \brief Detach an observer object for this History. + \brief Detach an observer object for this History. */ virtual void detach(const HistoryObserver& observer); - + /** \brief Brings History to initial state. */ @@ -299,13 +299,13 @@ namespace sgpem */ void notify_change(); - position _front; + position _front; private: /** \brief Enable/disable notifications to registered observers * * This is quite useful to disable momentarily notification while you - * do a bunch of insertions and/or deletions in one go, in order to + * do a bunch of insertions and/or deletions in one go, in order to * speed up things. * * \return The old value diff --git a/src/backend/sgpemv2/module.hh b/src/backend/sgpemv2/module.hh index d1edcb9..92e2a26 100644 --- a/src/backend/sgpemv2/module.hh +++ b/src/backend/sgpemv2/module.hh @@ -51,7 +51,7 @@ namespace sgpem /// doesn't export a valid SGPEMv2 backend::Plugin interface. /// \param identifier A string with the DSO name without any file-extension /// suffix. This is retrieved by PluginManager::rescan_dirs(). - Module(const Glib::ustring& identifier) throw(InvalidPluginException); + Module(const Glib::ustring& identifier); /// \brief Enables or disables a plugin /// diff --git a/src/backend/sgpemv2/null_policy_exception.hh b/src/backend/sgpemv2/null_policy_exception.hh index 3c18834..d5d75b9 100644 --- a/src/backend/sgpemv2/null_policy_exception.hh +++ b/src/backend/sgpemv2/null_policy_exception.hh @@ -22,8 +22,8 @@ // It could be necessary to do dynamic type-checking when // catching it (with typeinfo). -#ifndef NULL_POLICY_EXCEPTION -#define NULL_POLICY_EXCEPTION 1 +#ifndef nullptr_POLICY_EXCEPTION +#define nullptr_POLICY_EXCEPTION 1 #include diff --git a/src/backend/sgpemv2/policy_parameters.hh b/src/backend/sgpemv2/policy_parameters.hh index 9e663d4..ad8affa 100644 --- a/src/backend/sgpemv2/policy_parameters.hh +++ b/src/backend/sgpemv2/policy_parameters.hh @@ -230,19 +230,19 @@ namespace sgpem \returns the INTEGER value of the parameter named \e name \throws PolicyParametersException if the parameter named \e name has not been registered */ - int get_int(Glib::ustring name) const throw(PolicyParametersException); + int get_int(Glib::ustring name) const; /** \brief Returns the value of an FLOAT parameter \returns the FLOAT value of the parameter named \e name \throws PolicyParametersException if the parameter named \e name has not been registered */ - float get_float(Glib::ustring name) const throw(PolicyParametersException); + float get_float(Glib::ustring name) const; /** \brief Returns the value of an STRING parameter \returns the STRING value of the parameter named \e name \throws PolicyParametersException if the parameter named \e name has not been registered */ - Glib::ustring get_string(Glib::ustring name) const throw(PolicyParametersException); + Glib::ustring get_string(Glib::ustring name) const; diff --git a/src/backend/sgpemv2/ready_queue.hh b/src/backend/sgpemv2/ready_queue.hh index a576f05..7f4017e 100644 --- a/src/backend/sgpemv2/ready_queue.hh +++ b/src/backend/sgpemv2/ready_queue.hh @@ -43,7 +43,7 @@ namespace sgpem * \param a first object position * \param b second object position */ - void swap(position a, position b) throw (std::out_of_range); + void swap(position a, position b); /** * \brief Return the size of the queue. @@ -60,7 +60,7 @@ namespace sgpem * \return The item at positon \a index. * \throw std::out_of_range if position is < 1 or > size()-1. */ - Thread& get_item_at(position index) throw (std::out_of_range); + Thread& get_item_at(position index); /** @@ -71,7 +71,7 @@ namespace sgpem * \return A constant reference to the item at positon \a index. * \throw std::out_of_range if position is < 1 or > size()-1 */ - const Thread& get_item_at(position index) const throw (std::out_of_range); + const Thread& get_item_at(position index) const; /** * \brief Add a new ::Thread at the end of the queue. @@ -83,7 +83,7 @@ namespace sgpem /** * \brief Bubble element x to the front of the queue */ - void bubble_to_front(position x) throw(std::out_of_range); + void bubble_to_front(position x); /** * \brief Remove the first item from the threads vector. diff --git a/src/backend/sgpemv2/resource_policies_gatekeeper.hh b/src/backend/sgpemv2/resource_policies_gatekeeper.hh index 1dd2399..a6d6428 100644 --- a/src/backend/sgpemv2/resource_policies_gatekeeper.hh +++ b/src/backend/sgpemv2/resource_policies_gatekeeper.hh @@ -83,7 +83,7 @@ namespace sgpem * * \return The current policy. */ - ResourcePolicy& get_current_policy(History* history) throw(std::runtime_error); + ResourcePolicy& get_current_policy(History* history); /** \brief Given a policy, sets it as the history current one. Also deactivates the old policy if present, and then activates diff --git a/src/backend/sgpemv2/resource_policy.hh b/src/backend/sgpemv2/resource_policy.hh index fbdee42..f65900a 100644 --- a/src/backend/sgpemv2/resource_policy.hh +++ b/src/backend/sgpemv2/resource_policy.hh @@ -57,7 +57,7 @@ namespace sgpem /// /// Because it's a pure virtual method, must be re-implemented /// in concrete derived classes. - virtual void configure() throw(UserInterruptException) = 0; + virtual void configure() = 0; /// \brief Sorts the subrequest queue. /// @@ -67,7 +67,7 @@ namespace sgpem /// \param environment the environment on which the policy applies. /// \param queue the queue where a subrequest has just been added. /// \param sr the subrequest which has just been added. - virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr) throw(UserInterruptException) = 0; + virtual void enforce(Environment& environment, Environment::SubRequestQueue& queue, SubRequest& sr) = 0; /// \brief Returns a description of the policy. /// diff --git a/src/backend/sgpemv2/scheduler.hh b/src/backend/sgpemv2/scheduler.hh index baf7532..e1422d9 100644 --- a/src/backend/sgpemv2/scheduler.hh +++ b/src/backend/sgpemv2/scheduler.hh @@ -68,14 +68,14 @@ namespace sgpem \return false If the simulation has ended, true otherwise */ - bool step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& resource_policy) throw(UserInterruptException, MalformedPolicyException); + bool step_forward(History& history, CPUPolicy& cpu_policy, ResourcePolicy& resource_policy); /** \brief Returns the policy that will be used to generate the simulation at the next instant. \warning This is a callback method: it can only be used in methods of CPUPolicy called - by step_forward(). Else, a NULL pointer will be returned. - \return A pointer to the active policy, or NULL if not inside step_forward() + by step_forward(). Else, a nullptr pointer will be returned. + \return A pointer to the active policy, or nullptr if not inside step_forward() */ CPUPolicy* get_policy(); @@ -84,8 +84,8 @@ namespace sgpem schedulable objects (for the policy to sort it). \warning This is a callback method: it can only be used in methods of CPUPolicy called - by step_forward(). Else, a NULL pointer will be returned. - \return A pointer to the queue, or NULL if not inside step_forward() + by step_forward(). Else, a nullptr pointer will be returned. + \return A pointer to the queue, or nullptr if not inside step_forward() */ ReadyQueue* get_ready_queue(); diff --git a/src/backend/sgpemv2/serialize_visitor.hh b/src/backend/sgpemv2/serialize_visitor.hh index 479288a..62e80e1 100644 --- a/src/backend/sgpemv2/serialize_visitor.hh +++ b/src/backend/sgpemv2/serialize_visitor.hh @@ -56,45 +56,45 @@ namespace sgpem /** \brief Add output to the serializer taking data from history */ - virtual void from_history(const History& obj) throw(SerializerError) = 0; + virtual void from_history(const History& obj) = 0; /** \brief Add output to the serializer taking data from environment */ - virtual void from_environment(const Environment& obj) throw(SerializerError) = 0; + virtual void from_environment(const Environment& obj) = 0; /** \brief Add output to the serializer taking data from resource BUG: a resource must be saved with her own associated key. */ - virtual void from_resource(const Resource& obj) throw(SerializerError) = 0; + virtual void from_resource(const Resource& obj) = 0; /** \brief Add output to the serializer taking data from resource and key BUG FIXED: This save a resource with her own associated key. */ - virtual void from_resource(const Resource& obj, const Glib::ustring& key) throw(SerializerError) = 0; + virtual void from_resource(const Resource& obj, const Glib::ustring& key) = 0; /** \brief Add output to the serializer taking data from process */ - virtual void from_process(const Process& obj) throw(SerializerError) = 0; + virtual void from_process(const Process& obj) = 0; /** \brief Add output to the serializer taking data from thread */ - virtual void from_thread(const Thread& obj) throw(SerializerError) = 0; + virtual void from_thread(const Thread& obj) = 0; /** \brief Add output to the serializer taking data from request */ - virtual void from_request(const Request& obj) throw(SerializerError) = 0; + virtual void from_request(const Request& obj) = 0; /** \brief Add output to the serializer taking data from subrequest */ - virtual void from_subrequest(const SubRequest& obj) throw(SerializerError) = 0; + virtual void from_subrequest(const SubRequest& obj) = 0; }; } diff --git a/src/backend/sgpemv2/serializer.hh b/src/backend/sgpemv2/serializer.hh index 21da766..ed4a706 100644 --- a/src/backend/sgpemv2/serializer.hh +++ b/src/backend/sgpemv2/serializer.hh @@ -37,8 +37,8 @@ namespace sgpem Serializer(); virtual ~Serializer() = 0; - virtual void save_snapshot(const Glib::ustring& filename, const History& hist) throw(SerializerError) = 0; - virtual void restore_snapshot(const Glib::ustring& filename, History& hist) throw(SerializerError) = 0; + virtual void save_snapshot(const Glib::ustring& filename, const History& hist) = 0; + virtual void restore_snapshot(const Glib::ustring& filename, History& hist) = 0; virtual const Glib::ustring get_filename_extension() = 0; virtual const Glib::ustring get_filename_description() = 0; protected: diff --git a/src/backend/sgpemv2/serializers_gatekeeper.hh b/src/backend/sgpemv2/serializers_gatekeeper.hh index c5e4701..6bde874 100644 --- a/src/backend/sgpemv2/serializers_gatekeeper.hh +++ b/src/backend/sgpemv2/serializers_gatekeeper.hh @@ -49,12 +49,12 @@ namespace sgpem std::vector get_registered() const; /** \brief Registers a serializer - * \param serializer The serializer, cannot be NULL + * \param serializer The serializer, cannot be nullptr */ void register_serializer(Serializer* serializer); /** \brief Unregisters a serializer - * \param serializer The serializer, cannot be NULL. If the serializer + * \param serializer The serializer, cannot be nullptr. If the serializer * wasn't previously registered, this method is a no-op. */ void unregister_serializer(Serializer* serializer); diff --git a/src/backend/sgpemv2/simulation.hh b/src/backend/sgpemv2/simulation.hh index 3aec2f5..9d1e34a 100644 --- a/src/backend/sgpemv2/simulation.hh +++ b/src/backend/sgpemv2/simulation.hh @@ -91,7 +91,7 @@ namespace sgpem Advances the simulation by one or more steps, depending on the actual state and on the value set with set_mode(). */ - virtual void run() throw(UserInterruptException, NullPolicyException, MalformedPolicyException) = 0; + virtual void run() = 0; /** \brief Pauses a running simulation. @@ -117,7 +117,7 @@ namespace sgpem Pauses the simulation and jumps to the specified instant */ - virtual void jump_to(History::position p) throw(UserInterruptException, NullPolicyException, MalformedPolicyException) = 0; + virtual void jump_to(History::position p) = 0; /** @@ -146,7 +146,7 @@ namespace sgpem /** \brief Setup the CPU policy to be used by the system. */ - virtual void set_policy(CPUPolicy*) throw(CPUPolicyException) = 0; + virtual void set_policy(CPUPolicy*) = 0; /** \brief Setup the resource policy to be used by the system. diff --git a/src/backend/sgpemv2/statistics.hh b/src/backend/sgpemv2/statistics.hh index ecb6197..e32778d 100644 --- a/src/backend/sgpemv2/statistics.hh +++ b/src/backend/sgpemv2/statistics.hh @@ -62,7 +62,7 @@ namespace sgpem Returns a copy of all statistics calculated with calculateStatisticsAt() referred to all processes of the environment. If calculateStatisticsAt() has never been - called before this call then NULL will be returned. + called before this call then nullptr will be returned. \returns a vector filled with copies of the ProcessStatistics calculated by calculateStatisticsAt() @@ -74,11 +74,11 @@ namespace sgpem Returns a pointer to the statistics of the simulation referred to the instant specified with "calculateStatisticsAt()". If calculateStatisticsAt() has never been called before this call - then the NULL pointer will be returned. + then the nullptr pointer will be returned. \attention Don't delete() the returned pointer: this will bring to memory corruption! \returns a pointer to the internal SimulationStatistics object updated by calculateStatisticsAt() - \returns the NULL pointer if calculateStatisticsAt() has never been called + \returns the nullptr pointer if calculateStatisticsAt() has never been called */ virtual const SimulationStatistics* get_simulation_statistics() const = 0; diff --git a/src/backend/sgpemv2/string_utils.hh b/src/backend/sgpemv2/string_utils.hh index bd4ba1f..6434902 100644 --- a/src/backend/sgpemv2/string_utils.hh +++ b/src/backend/sgpemv2/string_utils.hh @@ -33,7 +33,7 @@ namespace sgpem typedef std::vector Tokens; template - T SG_DLLEXPORT string_to(const Glib::ustring&) throw(std::domain_error); + T SG_DLLEXPORT string_to(const Glib::ustring&); /**\brief This function converts a value into a string, if possible. diff --git a/src/backend/sgpemv2/templates/deletor.tcc b/src/backend/sgpemv2/templates/deletor.tcc deleted file mode 100644 index cb80af6..0000000 --- a/src/backend/sgpemv2/templates/deletor.tcc +++ /dev/null @@ -1,39 +0,0 @@ -// src/templates/deletor.tcc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - - - -#ifndef DELETOR_TCC -#define DELETOR_TCC 1 - -#include - -namespace memory -{ - - template - struct deletor : public std::unary_function - { - inline void operator()(T* o) { delete o; } - }; - -} //~ namespace memory - -#endif - diff --git a/src/backend/sgpemv2/templates/down_cast.tcc b/src/backend/sgpemv2/templates/down_cast.tcc index 4aa2c92..c2877c1 100644 --- a/src/backend/sgpemv2/templates/down_cast.tcc +++ b/src/backend/sgpemv2/templates/down_cast.tcc @@ -117,7 +117,7 @@ namespace sgpem { #if !defined(NDEBUG) && !defined(_MSC_VER) To* check_ptr = dynamic_cast(obj); - if(check_ptr == NULL) + if(check_ptr == nullptr) { pid_t me = getpid(); std::clog << "DEBUG: dynamic_cast<> returned null pointer. " diff --git a/src/backend/sgpemv2/templates/singleton.tcc b/src/backend/sgpemv2/templates/singleton.tcc index 446689b..c7dd5f1 100644 --- a/src/backend/sgpemv2/templates/singleton.tcc +++ b/src/backend/sgpemv2/templates/singleton.tcc @@ -23,7 +23,7 @@ template Instantiated_class* -sgpem::Singleton::_instance = NULL; +sgpem::Singleton::_instance = nullptr; template Glib::RecMutex @@ -35,7 +35,7 @@ Instantiated_class& sgpem::Singleton::get_instance() { Glib::RecMutex::Lock lock (_mutex); - if (_instance == NULL) + if (_instance == nullptr) _instance = new Instantiated_class(); return *_instance; } diff --git a/src/backend/sgpemv2/templates/smartp.hh b/src/backend/sgpemv2/templates/smartp.hh deleted file mode 100644 index f74971f..0000000 --- a/src/backend/sgpemv2/templates/smartp.hh +++ /dev/null @@ -1,172 +0,0 @@ -// src/backend/sgpemv2/templates/smartp.hh - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef SMARTP_HH -#define SMARTP_HH 1 - -#include -#include - -namespace memory -{ - - /** \brief A simple reference counted smart pointer - * - * \author Matteo Settenvini - * - * \version \c 1.1, March 7th, 2006 - Add support for dynamic casting - * \version \c 1.0, October 10th, 2006 - Initial stable release - * - * This template is a smart pointer which uses - * a simple mechanism of reference count to - * keep track of when and if a stored object - * should be destroyed. - * - * \param T The type of the object to store - * \param isArray a boolean value telling if we're - * storing an array or a single object (the default) - * - * \warning This class hasn't virtual methods - * to ensure greater speed. Don't inherit - * from it: its destructor isn't virtual, either. - */ - template - class smart_ptr - { - - template - friend class smart_ptr; - - public: - - /** \brief An alias for the smart_ptr which contains null - * - * When you've to compare some smart pointer with another - * to see if it points to nowhere, you can use this - * const object. - * */ - static const smart_ptr null; - - /** \brief Constructor, defaults to null pointer. - * - * Call this constructor only the first time. Whenever - * you'll need to keep other references to the same pointer, - * use the cctor, or we won't be able to keep updated the - * reference count. This class requires some effort from - * the user to abid to some rules. It's meant to be - * an help, not a painkiller. - * - * A good usage of this ctor is: - * \code - * class C; - * smart_ptr c_ptr(new C()); - * \endcode - * So you don't keep a potentially dangerous reference - * around. */ - smart_ptr(T* ptr = 0) throw(std::bad_alloc); - - /** \brief Copy constructor. - * - * Always use this to obtain another reference - * to a stored pointer. */ - smart_ptr(const smart_ptr& sptr) throw(); - ~smart_ptr() throw(); - - smart_ptr& operator=(const smart_ptr& sptr) throw(); - - bool operator==(const smart_ptr& sptr) const throw(); - bool operator!=(const smart_ptr& sptr) const throw(); - - /** \brief Access to stored object's members - * - * Use this operator to access object - * methods and data. */ - T* operator->() throw(); - - /** \brief Access to stored object's members - * - * Const version of the above operator. */ - const T* operator->() const throw(); - - /** \brief Access to stored object - * - * \warning Use with care */ - T& operator*() throw(); - - /** \brief Access to stored object - * - * \warning Use with care */ - const T& operator*() const throw(); - - /** \brief Convenience operator for use in predicates - * - * \return true if the stored pointer is valid, - * false otherwise. */ - operator bool() const throw(); - - /** \brief Returns the number of alive references to - * the stored object - * - * \return The number of references */ - unsigned int alive_refs() const throw(); - - /** \brief Dynamic cast the stored pointer - * to another type, returning a smart_ptr - * - * This functions tries to cast the stored - * object to the given type. - * - * \param U The type to cast the stored pointer to - * \return A smart_ptr of the wanted type - * \exception bad_alloc Raise this exception if - * the cast isn't successful or doable - */ - template - smart_ptr cast_to() throw(std::bad_cast); - - /** \brief Dynamic cast the stored pointer - * to another type, returning a smart_ptr - * - * This functions tries to cast the stored - * object to the given type. - * - * \param U The type to cast the stored pointer to - * \return A smart_ptr of the wanted type - * \exception bad_alloc Raise this exception if - * the cast isn't successful or doable - */ - template - const smart_ptr cast_to() const throw(std::bad_cast); - - private: - template - smart_ptr(const smart_ptr& sptr) throw(std::bad_cast); - - struct contents_type - { - T* ptr; - unsigned int rc; - } - * _contents; - }; -} - -#endif - diff --git a/src/backend/sgpemv2/templates/smartp.tcc b/src/backend/sgpemv2/templates/smartp.tcc deleted file mode 100644 index 8f79e3b..0000000 --- a/src/backend/sgpemv2/templates/smartp.tcc +++ /dev/null @@ -1,178 +0,0 @@ -// smartp.tcc - Copyright 2005, Matteo Settenvini -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef SMARTP_TCC -#define SMARTP_TCC 1 - -#include - -namespace memory -{ - - template - const smart_ptr smart_ptr::null = 0; - - // ------------------------------ - - template - smart_ptr::smart_ptr( T* ptr ) throw(std::bad_alloc) - : _contents(new contents_type()) - { - _contents->rc = 1; - _contents->ptr = ptr; - } - - - template - smart_ptr::smart_ptr(const smart_ptr& sptr) throw() - : _contents(sptr._contents) - { - (_contents->rc)++; - } - - - template - smart_ptr::~smart_ptr() throw() - { - if (--(_contents->rc) == 0) - { - if (_contents->ptr != 0) - !isArray ? delete _contents->ptr : delete [] _contents->ptr; - delete _contents; - } - } - - // ------------------------------ - - template - smart_ptr& - smart_ptr::operator=(const smart_ptr& sptr) throw() - { - if (this != &sptr && _contents != sptr._contents) - { - if (--(_contents->rc) == 0) - { - if (_contents->ptr != 0) - !isArray ? delete _contents->ptr : delete [] _contents->ptr; - delete _contents; - } - - _contents = sptr._contents; - (_contents->rc)++; - } - - return *this; - } - - - template - bool - smart_ptr::operator==( const smart_ptr& sptr ) const throw() - { - return _contents->ptr == sptr._contents->ptr; - } - - - template - bool - smart_ptr::operator!=( const smart_ptr& sptr ) const throw() - { - return _contents->ptr != sptr._contents->ptr; - } - - - template - T& - smart_ptr::operator*() throw() - { - return *(_contents->ptr); - } - - - template - T* - smart_ptr::operator->() throw() - { - return _contents->ptr; - } - - - template - const T& - smart_ptr::operator*() const throw() - { - return *(_contents->ptr); - } - - - template - const T* - smart_ptr::operator->() const throw() - { - return _contents->ptr; - } - - - template - smart_ptr::operator bool() const throw() - { - return _contents->ptr != 0; - } - - // ------------------------------ - - template - unsigned int - smart_ptr::alive_refs() const throw() - { - return _contents->ptr != 0 ? _contents->rc : 0; - } - - - template - template - smart_ptr - smart_ptr::cast_to() throw(std::bad_cast) - { - return smart_ptr(*this); - } - - - template - template - const smart_ptr - smart_ptr::cast_to() const throw(std::bad_cast) - { - return smart_ptr(*this); - } - - - template - template - smart_ptr::smart_ptr(const smart_ptr& sptr) - throw(std::bad_cast) - { - if (!sptr._contents->ptr || dynamic_cast(sptr._contents->ptr) == 0) - throw std::bad_cast(); - - // I know, I know... this is Evil(TM): - _contents = reinterpret_cast::contents_type* > (sptr._contents); - (_contents->rc)++; - } - -} //~ namespace memory - -#endif diff --git a/src/backend/simulation.cc b/src/backend/simulation.cc index 3152c59..8cd1382 100644 --- a/src/backend/simulation.cc +++ b/src/backend/simulation.cc @@ -18,8 +18,6 @@ // along with SGPEMv2. If not, see http://www.gnu.org/licenses/. - - #include #include #include "concrete_simulation.hh" @@ -33,7 +31,7 @@ using namespace sgpem; // Explicit template instantiation to allow to export symbols from the DSO. -template class Singleton; +template class sgpem::Singleton; Simulation::Simulation() : _notify(true) diff --git a/src/backend/static_request.cc b/src/backend/static_request.cc index 8c6132d..f30314b 100644 --- a/src/backend/static_request.cc +++ b/src/backend/static_request.cc @@ -29,7 +29,7 @@ StaticRequest::StaticRequest(StaticThread* thread, unsigned int instant) : _thread(thread), _instant(instant) { - assert(thread != NULL); + assert(thread != nullptr); _thread->get_requests().push_back(this); } diff --git a/src/backend/string_utils.cc b/src/backend/string_utils.cc index ea5dc51..9c2b52e 100644 --- a/src/backend/string_utils.cc +++ b/src/backend/string_utils.cc @@ -31,14 +31,14 @@ namespace sgpem { /* Force template instantiation to allow visibility outside this DSO */ - template SG_DLLEXPORT int string_to(const Glib::ustring&) throw(domain_error); - template SG_DLLEXPORT float string_to(const Glib::ustring&) throw(domain_error); - template SG_DLLEXPORT double string_to(const Glib::ustring&) throw(domain_error); + template SG_DLLEXPORT int string_to(const Glib::ustring&); + template SG_DLLEXPORT float string_to(const Glib::ustring&); + template SG_DLLEXPORT double string_to(const Glib::ustring&); template SG_DLLEXPORT void to_string(const int val, Glib::ustring&); template SG_DLLEXPORT void to_string(const float val, Glib::ustring&); template SG_DLLEXPORT void to_string(const double val, Glib::ustring&); - + // Specialized further down in this file: // template SG_DLLEXPORT bool string_to(const Glib::ustring&); @@ -54,7 +54,7 @@ namespace sgpem */ template T - string_to(const ustring& str) throw(domain_error) + string_to(const ustring& str) { Tokens tokens = tokenize(str); @@ -65,14 +65,14 @@ namespace sgpem // not considered errors by the last test istringstream iss(tokens[0]); T result; - + iss.exceptions(ios_base::failbit | ios_base::badbit); try { iss >> result; } - catch (ios_base::failure e) + catch (ios_base::failure& e) { throw domain_error(e.what()); } @@ -93,8 +93,8 @@ namespace sgpem * \return A bool value converted from str. */ template <> - SG_DLLEXPORT bool - string_to(const Glib::ustring& str) throw(domain_error) + SG_DLLEXPORT bool + string_to(const Glib::ustring& str) { Tokens tokens = tokenize(str); @@ -105,14 +105,14 @@ namespace sgpem // not considered errors by the last test istringstream iss(tokens[0]); bool value; - + iss.exceptions(ios_base::failbit | ios_base::badbit); try { iss >> boolalpha >> value; } - catch (ios_base::failure e) + catch (ios_base::failure& e) { throw domain_error(e.what()); } diff --git a/src/cairo_widget.cc b/src/cairo_widget.cc index 5f6a6a8..7a5ccff 100644 --- a/src/cairo_widget.cc +++ b/src/cairo_widget.cc @@ -200,7 +200,7 @@ CairoWidget::on_draw (const Cairo::RefPtr& ctx) Glib::RefPtr style = get_style_context(); // style->paint_box (_buf, // Gtk::STATE_NORMAL, Gtk::SHADOW_ETCHED_IN, - // NULL, *this, "through", + // nullptr, *this, "through", // 0, 0, _client_w, _client_h); // Determine the final drawing dimensions diff --git a/src/configure_policy_dialog.cc b/src/configure_policy_dialog.cc index 4996713..9fc65a6 100644 --- a/src/configure_policy_dialog.cc +++ b/src/configure_policy_dialog.cc @@ -119,7 +119,7 @@ ConfigurePolicyDialog::ConfigurePolicyDialog(const Glib::ustring& title, parameter_string(it->second, row_n); } - if(_table_int == NULL && _table_float == NULL && _table_string == NULL) + if(_table_int == nullptr && _table_float == nullptr && _table_string == nullptr) { Label& message = *manage(new Label(_("No options to configure for this policy"))); message.set_padding(5, 5); @@ -193,7 +193,7 @@ void ConfigurePolicyDialog::on_okay() { // Save all values - if(_table_int != NULL) + if(_table_int != nullptr) { const Table::TableList list = _table_int->children(); @@ -204,18 +204,18 @@ ConfigurePolicyDialog::on_okay() Widget* w; w = it->get_widget(); // First column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); Glib::ustring name = static_cast(w)->get_text(); w = (++it)->get_widget(); // Pass to the second column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); int value = static_cast(w)->get_value_as_int(); _parameters.set_int(name, value); } } //~ if _table_int - if(_table_float != NULL) + if(_table_float != nullptr) { const Table::TableList list = _table_float->children(); @@ -226,18 +226,18 @@ ConfigurePolicyDialog::on_okay() Widget* w; w = it->get_widget(); // First column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); Glib::ustring name = static_cast(w)->get_text(); w = (++it)->get_widget(); // Pass to the second column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); double value = static_cast(w)->get_value(); _parameters.set_float(name, static_cast(value)); } } //~ if _table_float - if(_table_string != NULL) + if(_table_string != nullptr) { const Table::TableList list = _table_string->children(); @@ -248,11 +248,11 @@ ConfigurePolicyDialog::on_okay() Widget* w; w = it->get_widget(); // First column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); Glib::ustring name = static_cast(w)->get_text(); w = (++it)->get_widget(); // Pass to the second column - assert(dynamic_cast(w) != NULL); + assert(dynamic_cast(w) != nullptr); Glib::ustring value = static_cast(w)->get_text(); _parameters.set_string(name, value); diff --git a/src/graphical_preferences_editor.cc b/src/graphical_preferences_editor.cc index 689f29b..babb53f 100644 --- a/src/graphical_preferences_editor.cc +++ b/src/graphical_preferences_editor.cc @@ -118,11 +118,11 @@ PreferencesEditor::PreferencesEditor(const std::string& uifile) // Add and remove directory buttons - Gtk::Button* add_plugins_dir = NULL; + Gtk::Button* add_plugins_dir = nullptr; _refXml->get_widget("Plugins.Add", add_plugins_dir); add_plugins_dir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesEditor::on_add_plugins_dir)); - Gtk::Button* remove_plugins_dir = NULL; + Gtk::Button* remove_plugins_dir = nullptr; _refXml->get_widget("Plugins.Remove", remove_plugins_dir); remove_plugins_dir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesEditor::on_remove_plugins_dir)); @@ -194,11 +194,11 @@ PreferencesEditor::PreferencesEditor(const std::string& uifile) // Add and remove directory buttons - Gtk::Button* add_policies_dir = NULL; + Gtk::Button* add_policies_dir = nullptr; _refXml->get_widget("Policies.Add", add_policies_dir); add_policies_dir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesEditor::on_add_policies_dir)); - Gtk::Button* remove_policies_dir = NULL; + Gtk::Button* remove_policies_dir = nullptr; _refXml->get_widget("Policies.Remove", remove_policies_dir); remove_policies_dir->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesEditor::on_remove_policies_dir)); @@ -222,7 +222,7 @@ PreferencesEditor::PreferencesEditor(const std::string& uifile) // Close button - Gtk::Button* close = NULL; + Gtk::Button* close = nullptr; _refXml->get_widget("Close", close); close->signal_clicked().connect(sigc::mem_fun(*this, &PreferencesEditor::on_close)); diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 838383f..9d90ce2 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -89,7 +89,7 @@ GuiBuilder::on_simulation_jump_to_clicked() assert(target_instant >= 0); Glib::RefPtr jump_to_dialog_ui = Gtk::Builder::create_from_file(UIDIR "/jump-to-dialog.ui"); - JumpToDialog* jump_to_dialog = NULL; + JumpToDialog* jump_to_dialog = nullptr; jump_to_dialog_ui->get_widget_derived("JumpToDialog", jump_to_dialog); jump_to_dialog->set_transient_for(get_initial_window()); @@ -382,7 +382,7 @@ GuiBuilder::on_configure_cpu_policy() Simulation& sim = Simulation::get_instance(); CPUPolicy* policy = sim.get_policy(); - if(policy == NULL) + if(policy == nullptr) { MessageDialog warn(get_initial_window(), _("No CPU policy is currently selected.\nPlease choose one before trying to configure it."), @@ -410,7 +410,7 @@ GuiBuilder::on_configure_resource_policy() Simulation& sim = Simulation::get_instance(); ResourcePolicy* policy = sim.get_resource_policy(); - if(policy == NULL) + if(policy == nullptr) { MessageDialog warn(get_initial_window(), _("No CPU policy is currently selected.\nPlease choose one before trying to configure it."), @@ -478,7 +478,7 @@ GuiBuilder::on_selected_cpu_policy(CPUPolicy* pol) try { Simulation::get_instance().set_policy(pol); - if(pol != NULL) { + if(pol != nullptr) { sbar->push(_("Selected CPU policy ") + pol->get_name()); return; } @@ -540,7 +540,7 @@ GuiBuilder::on_selected_resource_policy(ResourcePolicy* pol) Simulation::get_instance().set_resource_policy(pol); Statusbar* sbar; _refXml->get_widget("MainStatusBar", sbar); - if(pol == NULL) + if(pol == nullptr) sbar->push(_("Current resource policy deselected.")); else sbar->push(_("Selected resource policy ") + pol->get_name()); @@ -554,11 +554,11 @@ GuiBuilder::on_toggle_simulation_mode() using Glib::RefPtr; RefPtr uimanager = RefPtr::cast_dynamic (_refXml->get_object("UIManager")); - CheckMenuItem* continuous_mode = NULL; + CheckMenuItem* continuous_mode = nullptr; continuous_mode = dynamic_cast(uimanager->get_widget ("/MenuBar/Action.Simulation/Action.Simulation.ContinuousMode")); - g_assert (continuous_mode != NULL); + g_assert (continuous_mode != nullptr); if(continuous_mode->get_active() == true) Simulation::get_instance().set_mode(Simulation::mode_continuous); @@ -689,7 +689,7 @@ GuiBuilder::GuiBuilder(const std::string& uifile) // --------------------------------------------------- // About dialog - AboutDialog* about_dialog = NULL; + AboutDialog* about_dialog = nullptr; _refXml->get_widget("AboutDialog", about_dialog); RefPtr::cast_dynamic (_refXml->get_object("Action.Help.About")) ->signal_activate().connect(sigc::mem_fun(*about_dialog, &Window::show)); @@ -698,7 +698,7 @@ GuiBuilder::GuiBuilder(const std::string& uifile) // Insert the schedulables TreeView custom widget - ScrolledWindow* schedulables_sw = NULL; + ScrolledWindow* schedulables_sw = nullptr; _refXml->get_widget("SchedulablesScrolledWindow", schedulables_sw); SchedulablesTreeWidget* scheds_tree = manage(new SchedulablesTreeWidget()); schedulables_sw->add(*scheds_tree); @@ -706,13 +706,13 @@ GuiBuilder::GuiBuilder(const std::string& uifile) scheds_tree->show(); // Resources ListView widget - ResourcesWidget* resources_widget = NULL; + ResourcesWidget* resources_widget = nullptr; _refXml->get_widget_derived("Resources.Tree", resources_widget); resources_widget->show(); // Main simulation widget - ScrolledWindow* simulation_window = NULL; + ScrolledWindow* simulation_window = nullptr; _refXml->get_widget("SimulationScrolledWindow", simulation_window); //SimulationWidget& simulation_widget = *manage(new SimulationWidget(Simulation::get_instance())); _simulation_widget = manage(new SimulationWidget(Simulation::get_instance())); @@ -730,7 +730,7 @@ GuiBuilder::GuiBuilder(const std::string& uifile) // JumpTo button - Button* simulation_jump_to = NULL; + Button* simulation_jump_to = nullptr; _refXml->get_widget("BottomHBox.JumpToButton", simulation_jump_to); simulation_jump_to->signal_clicked().connect(sigc::mem_fun(*this, &GuiBuilder::on_simulation_jump_to_clicked)); @@ -753,7 +753,7 @@ GuiBuilder::~GuiBuilder() Gtk::Window& GuiBuilder::get_initial_window() const { - Gtk::Window* main_window = NULL; + Gtk::Window* main_window = nullptr; _refXml->get_widget("MainWindow", main_window); return *main_window; } diff --git a/src/holt_widget.cc b/src/holt_widget.cc index 452ab2e..90d7c94 100644 --- a/src/holt_widget.cc +++ b/src/holt_widget.cc @@ -31,7 +31,6 @@ #include "holt_widget.hh" -#include "sgpemv2/templates/deletor.tcc" #include "sgpemv2/templates/sequences.tcc" #include @@ -55,7 +54,7 @@ using namespace std; #ifndef M_PI #define M_PI 3.14159265358979323846 #endif - + HoltNode::HoltNode(Vec2 pt) : _radius(20) @@ -114,7 +113,7 @@ void HoltResource::draw(Cairo::RefPtr& cr) static const float y_percent = 4.5f / 5; CairoElements ce(cr); - + // outline cr->set_source_rgb (0, 0, 0); @@ -122,14 +121,14 @@ void HoltResource::draw(Cairo::RefPtr& cr) Rectangle area(_pos.real() - _radius, _pos.imag() - _radius, 2*_radius, 2*_radius); ce.draw_3dcube(area, white, x_percent, y_percent); cr->save(); - + // clip text outside region cr->rectangle(_pos.real() - _radius, _pos.imag() + _radius * (1 - 2.0 * y_percent), 2 * _radius * x_percent, 2 * _radius * y_percent); - cr->clip(); - + cr->clip(); + // draw text Cairo::TextExtents extents; cr->get_text_extents(_resource->get_name(), extents); @@ -221,7 +220,7 @@ void HoltSchedulable::draw(Cairo::RefPtr& cr) cr->save(); // save context state const Point center(_pos.real(), _pos.imag()); - const Color* color = &red; + const Color* color = &red; // draw circle CairoElements cel(cr); @@ -345,7 +344,7 @@ void HoltRequest::arrow(Cairo::RefPtr& cr, Vec2 first, Vec2 seco if(traslate) { // if needed calc parallel versor of arrow - Vec2 direction = second - first; + Vec2 direction = second - first; direction /= std::abs(direction); // set unary modulus // and rotate it 90 degrees @@ -413,14 +412,14 @@ HoltWidget::~HoltWidget() const HoltResources& const_holt_resources = _holt_resources; for(Iseq it = iseq(const_holt_resources); it; ++it) delete it->second; - - for_each_in(_holt_schedulables, memory::deletor()); - for_each_in(_holt_requests, memory::deletor()); - + + for_each_in(_holt_schedulables, [] (auto *p) { delete p; }); + for_each_in(_holt_requests, [] (auto *p) { delete p; }); + // Unregister this HistoryObserver: _simulation->get_history().detach(*this); - + // Unregister this SimulationObserver: _simulation->detach(*this); } @@ -652,14 +651,14 @@ HoltWidget::acquire() delete it->second; _holt_resources.clear(); - for_each_in(_holt_schedulables, memory::deletor()); + for_each_in(_holt_schedulables, [] (auto *p) { delete p; }); _holt_schedulables.clear(); - for_each_in(_holt_requests, memory::deletor()); + for_each_in(_holt_requests, [] (auto *p) { delete p; }); _holt_requests.clear(); _n_res = _n_proc = 0; - + const History& hist = _simulation->get_history(); const Environment& env = hist.get_last_environment(); @@ -687,9 +686,9 @@ HoltWidget::acquire() // calc next position pos += Vec2(4*_radius, 0); } - + pos = Vec2(2*_radius, 8*_radius); - + // iter trough processes const Environment::Processes& pvect = env.get_processes(); Environment::Processes::const_iterator proc_iter = pvect.begin(); diff --git a/src/main.cc b/src/main.cc index 453887f..e63a056 100644 --- a/src/main.cc +++ b/src/main.cc @@ -18,6 +18,8 @@ // along with SGPEMv2. If not, see http://www.gnu.org/licenses/. +#include "sgpemv2/config.h" + #include "gettext.h" #include "main.hh" @@ -51,7 +53,7 @@ main(int argc, char* argv[]) #endif // mainly for debugging in Windows, where the type and - // content of uncaught exceptions is not easily + // content of uncaught exceptions is not easily // obtainable #ifndef NDEBUG try diff --git a/src/resources_widget.cc b/src/resources_widget.cc index 26424ef..b7f4e23 100644 --- a/src/resources_widget.cc +++ b/src/resources_widget.cc @@ -104,7 +104,7 @@ ResourcesWidget::get_selected_resource() return reinterpret_cast(const_cast(r_handle)); } else - return NULL; + return nullptr; } bool @@ -133,7 +133,7 @@ ResourcesWidget::on_button_press_event(GdkEventButton* event) "" " " " "; - if(get_selected_resource() != NULL) + if(get_selected_resource() != nullptr) ui_info += " " " " @@ -192,7 +192,7 @@ ResourcesWidget::add_edit_resource(bool adding) Entry* name_entry; SpinButton* places_spin; - Resource* resource = NULL; + Resource* resource = nullptr; _add_resource_dialog_ui->get_widget("Name.Entry", name_entry); _add_resource_dialog_ui->get_widget("Places.Spin", places_spin); diff --git a/src/schedulables_tree_widget.cc b/src/schedulables_tree_widget.cc index a0fdeea..6c3b844 100644 --- a/src/schedulables_tree_widget.cc +++ b/src/schedulables_tree_widget.cc @@ -135,13 +135,13 @@ T* SchedulablesTreeWidget::get_row_handle_as(const Gtk::TreeModel::iterator& row) { if(!row) - return NULL; + return nullptr; const void* p_handle = (*row)[_handles_column]; HandleType type = (*row)[_types_column]; if(!check_type(type)) - return NULL; + return nullptr; return reinterpret_cast(const_cast(p_handle)); } @@ -369,7 +369,7 @@ SchedulablesTreeWidget::add_edit_process(bool adding) ui->get_widget("Duration.Spin", duration_spin); ui->get_widget("BasePriority.Spin", base_priority_spin); - Process* selection = NULL; + Process* selection = nullptr; if(!adding) { @@ -444,7 +444,7 @@ SchedulablesTreeWidget::add_edit_thread(bool adding) ui->get_widget("ArrivalTime.Spin", arrival_time_spin); ui->get_widget("BasePriority.Spin", base_priority_spin); - Thread* t = NULL; + Thread* t = nullptr; if(!adding) { @@ -463,7 +463,7 @@ SchedulablesTreeWidget::add_edit_thread(bool adding) if(adding) { Process* p = get_selected(); - assert(p != NULL); + assert(p != nullptr); Simulation::get_instance().get_history().add_thread(name_entry->get_text(), *p, @@ -497,7 +497,7 @@ SchedulablesTreeWidget::_on_add_request() ui->get_widget_derived("AddRequestDialog", add_request_dialog); Thread* t = get_selected(); - assert(t != NULL); + assert(t != nullptr); add_request_dialog->run_add(*t); } @@ -515,7 +515,7 @@ SchedulablesTreeWidget::_on_edit_request() ui->get_widget_derived("AddRequestDialog", add_request_dialog); Request* r = get_selected(); - assert(r != NULL); + assert(r != nullptr); // FIXME: write more polite code for doing this, and probably using the same logic // for all other editing operations may be useful for making the app more robust @@ -545,7 +545,7 @@ void SchedulablesTreeWidget::_on_remove_process() { Process* p = get_selected(); - assert(p != NULL); + assert(p != nullptr); Simulation::get_instance().get_history().remove(*p); } @@ -554,7 +554,7 @@ void SchedulablesTreeWidget::_on_remove_thread() { Thread* t = get_selected(); - assert(t != NULL); + assert(t != nullptr); Simulation::get_instance().get_history().remove(*t); } @@ -563,7 +563,7 @@ void SchedulablesTreeWidget::_on_remove_request() { Request* r = get_selected(); - assert(r != NULL); + assert(r != nullptr); Simulation::get_instance().get_history().remove(*r); } diff --git a/src/simulation_controller.cc b/src/simulation_controller.cc index a1f3cae..8be3800 100644 --- a/src/simulation_controller.cc +++ b/src/simulation_controller.cc @@ -63,13 +63,13 @@ SimulationController::SimulationController(Simulation& simulation, Glib::RefPtr< refXml->get_widget("ToolBar.Pause", _toolbt_pause); refXml->get_widget("ToolBar.Stop", _toolbt_stop); - _action_start = RefPtr::cast_dynamic (refXml->get_object("Action.Simulation.Play")); + _action_start = RefPtr::cast_dynamic (refXml->get_object("Action.Simulation.Play")); _action_pause = RefPtr::cast_dynamic (refXml->get_object("Action.Simulation.Pause")); _action_stop = RefPtr::cast_dynamic (refXml->get_object("Action.Simulation.Stop")); - g_assert (_action_start != NULL); - g_assert (_action_pause != NULL); - g_assert (_action_stop != NULL); + g_assert (_action_start != nullptr); + g_assert (_action_pause != nullptr); + g_assert (_action_stop != nullptr); _toolbt_start->signal_clicked().connect(sigc::mem_fun(*this, &SimulationController::on_simulation_run)); _toolbt_pause->signal_clicked().connect(sigc::mem_fun(*this, &SimulationController::on_simulation_pause)); @@ -164,7 +164,7 @@ SimulationController::update(const Simulation& simulation) } // We should never enter here, if the code is correct: - // a step by step simulation should always be in paused + // a step by step simulation should always be in paused // or stopped state after performing a single step assert(simulation.get_mode() != Simulation::mode_step_by_step); @@ -190,24 +190,24 @@ SimulationController::run_simulation_adaptor() using namespace Glib; if(!_break_requested) - try + try { _sim.run(); } catch(const UserInterruptException& uie) { // Show the user a dialog - MessageDialog diag (_("The selected user CPU policy stopped before returning:\n") + Markup::escape_text(uie.what()), + MessageDialog diag (_("The selected user CPU policy stopped before returning:\n") + Markup::escape_text(uie.what()), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); diag.run(); } catch(const MalformedPolicyException& mpe) { // Show user a dialog - MessageDialog diag (_("The selected user CPU policy was malformed and failed to sort the queue:\n") + + MessageDialog diag (_("The selected user CPU policy was malformed and failed to sort the queue:\n") + Markup::escape_text(mpe.what()), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); diag.run(); - + try { // Deactivate the policy @@ -217,29 +217,29 @@ SimulationController::run_simulation_adaptor() { #ifndef _MSC_VER // Fatal error. We should never get here. - // Won't compile on Visual C++, what an idiotic compiler. Apparently he can't symphatize with the way - // Glib::ustring::compose() is written... + // Won't compile on Visual C++, what an idiotic compiler. Apparently he can't symphatize with the way + // Glib::ustring::compose() is written... std::cerr << Glib::ustring::compose( _(" [EE] Fatal error. Impossible to deactivate the policy in file %1:%2"), __FILE__, __LINE__) << std::endl << _(" [EE] ") << cpe.what() << std::endl; #else - // Fatal error. We should never get here. - std::cerr << _(" [EE] Fatal error. Impossible to deactivate the policy in file ") << __FILE__ << ":" << __LINE__ + // Fatal error. We should never get here. + std::cerr << _(" [EE] Fatal error. Impossible to deactivate the policy in file ") << __FILE__ << ":" << __LINE__ << std::endl << _(" [EE] ") << cpe.what() << std::endl; -#endif +#endif abort(); } } catch(const NullPolicyException& npe) { - MessageDialog diag(_("No active policy selected:\n") + Markup::escape_text(npe.what()), + MessageDialog diag(_("No active policy selected:\n") + Markup::escape_text(npe.what()), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); diag.run(); - + } catch(const CPUPolicyException& cpe) { - MessageDialog diag(_("Unexpected error:\n") + Markup::escape_text(cpe.what()), + MessageDialog diag(_("Unexpected error:\n") + Markup::escape_text(cpe.what()), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); diag.run(); } diff --git a/src/testsuite/test-holt_widget.cc b/src/testsuite/test-holt_widget.cc index 873cb3a..4c02bef 100644 --- a/src/testsuite/test-holt_widget.cc +++ b/src/testsuite/test-holt_widget.cc @@ -99,10 +99,10 @@ public: virtual ~PRRPolicy() {} - virtual void configure() throw(UserInterruptException, MalformedPolicyException) + virtual void configure() {} - virtual void sort_queue() const throw(UserInterruptException) + virtual void sort_queue() const { // here a lot of fun, exactly O(n^2) fun! // ReadyQueue sl = History.get_instance().get_simulation_status_at(get_current_time()); @@ -140,11 +140,11 @@ public: { return "FourtyTwo"; } - virtual bool is_pre_emptive() const throw(UserInterruptException, MalformedPolicyException) + virtual bool is_pre_emptive() const { return true; } - virtual int get_time_slice() const throw(UserInterruptException, MalformedPolicyException) + virtual int get_time_slice() const { return _quantum; } @@ -154,7 +154,7 @@ public: return _parameters; } - virtual void activate() throw(UserInterruptException, MalformedPolicyException) + virtual void activate() { } diff --git a/src/testsuite/test-parse_command.cc b/src/testsuite/test-parse_command.cc index 100b58a..400cdca 100644 --- a/src/testsuite/test-parse_command.cc +++ b/src/testsuite/test-parse_command.cc @@ -30,7 +30,6 @@ #include "backend/dynamic_schedulable.hh" #include "sgpemv2/ready_queue.hh" -#include "sgpemv2/templates/smartp.tcc" #include "standard_io.hh" #include "text_simulation.hh" @@ -38,6 +37,7 @@ #include #include +#include #include #include #include @@ -52,12 +52,12 @@ namespace sgpem class TestHistory : public History { public: - memory::smart_ptr get_scheduled_at(int time) + std::shared_ptr get_scheduled_at(int time) { std::cout << "get_scheduled_at" << time; return History::get_scheduled_at(time); } - memory::smart_ptr get_simulation_status_at(int time) const + std::shared_ptr get_simulation_status_at(int time) const { std::cout << "get_simulation_status_at" << time; return History::get_simulation_status_at(time); @@ -110,7 +110,7 @@ main(int, char**) TestHistory::get_instance(); //textual IO - memory::smart_ptr io(new StandardIO()); + std::shared_ptr io(new StandardIO()); text_sim.add_io_device(io); text_sim.update(); text_sim.run(); diff --git a/src/testsuite/test-simulation_widget.cc b/src/testsuite/test-simulation_widget.cc index e82d836..5510adb 100644 --- a/src/testsuite/test-simulation_widget.cc +++ b/src/testsuite/test-simulation_widget.cc @@ -95,10 +95,10 @@ public: virtual ~PRRPolicy() {} - virtual void configure() throw(UserInterruptException, MalformedPolicyException) + virtual void configure() {} - virtual void sort_queue() const throw(UserInterruptException) + virtual void sort_queue() const { // here a lot of fun, exactly O(n^2) fun! // ReadyQueue sl = History.get_instance().get_simulation_status_at(get_current_time()); @@ -136,11 +136,11 @@ public: { return "FourtyTwo"; } - virtual bool is_pre_emptive() const throw(UserInterruptException, MalformedPolicyException) + virtual bool is_pre_emptive() const { return true; } - virtual int get_time_slice() const throw(UserInterruptException, MalformedPolicyException) + virtual int get_time_slice() const { return _quantum; } @@ -150,7 +150,7 @@ public: return _parameters; } - virtual void activate() throw(UserInterruptException, MalformedPolicyException) + virtual void activate() { } diff --git a/src/testsuite/test-stepforward.cc b/src/testsuite/test-stepforward.cc index cad9b05..d0a816f 100644 --- a/src/testsuite/test-stepforward.cc +++ b/src/testsuite/test-stepforward.cc @@ -31,10 +31,9 @@ #include "sgpemv2/scheduler.hh" #include "sgpemv2/user_interrupt_exception.hh" -#include "sgpemv2/templates/smartp.tcc" - #include #include +#include #include #include @@ -43,9 +42,9 @@ namespace sgpem { /** An hard-coded Priority Round Robin policy - * It's actually called PRRPolicy, altough my personal taste would have suggested - * naming it - * Prioriy-Reliant Roughly-Realized Recently-Reimplemented Round-Robin Policy, + * It's actually called PRRPolicy, altough my personal taste would have suggested + * naming it + * Prioriy-Reliant Roughly-Realized Recently-Reimplemented Round-Robin Policy, * i.e. PRRRRRRR-Policy. * it adds a new constructor taking the quantum size (time slice)*/ @@ -75,7 +74,7 @@ namespace sgpem virtual void configure() {} - virtual void sort_queue() const throw(UserInterruptException) + virtual void sort_queue() const { // here a lot of fun, exactly O(n^2) fun! ReadyQueue sl = History.get_instance().get_simulation_status_at(get_current_time()); for (int i = 0; i < sl.size(); i++) @@ -100,11 +99,11 @@ namespace sgpem { return "42"; } - virtual bool is_pre_emptive() const throw(UserInterruptException) + virtual bool is_pre_emptive() const { return 1; } - virtual int get_time_slice() const throw(UserInterruptException) + virtual int get_time_slice() const { return _quantum; } @@ -127,7 +126,7 @@ namespace sgpem }; Policy* - PRRPolicy::_instance = NULL; + PRRPolicy::_instance = nullptr; @@ -153,7 +152,7 @@ namespace sgpem }; PolicyManager* - PolicyManager::_registered = NULL; + PolicyManager::_registered = nullptr; PolicyManager::PolicyManager() { @@ -163,7 +162,7 @@ namespace sgpem PolicyManager::~PolicyManager() { - if (_registered == this) _registered = NULL; + if (_registered == this) _registered = nullptr; } PolicyManager& @@ -179,8 +178,8 @@ namespace sgpem { public: - memory::smart_ptr get_scheduled_at(int time) const {} - memory::smart_ptr get_simulation_status_at(int time) const; + std::shared_ptr get_scheduled_at(int time) const {} + std::shared_ptr get_simulation_status_at(int time) const; int get_current_time() const {return _total_time_elapsed;} void enqueue_slice(const sgpem::ReadyQueue& status); void truncate_at(int instant) {} diff --git a/src/text_simulation.cc b/src/text_simulation.cc index e512304..274070b 100644 --- a/src/text_simulation.cc +++ b/src/text_simulation.cc @@ -42,7 +42,6 @@ #include #include #include -#include #include @@ -387,7 +386,7 @@ TextSimulation::on_run(const Tokens& arguments) sim.run(); break; case Simulation::mode_continuous: - int interval = GlobalPreferences::get_instance().get_speed() * 1000; + int interval = GlobalPreferences::get_instance().get_speed() * 1000; do { sim.run(); @@ -468,7 +467,7 @@ TextSimulation::on_jumpto(const Tokens& arguments) p_stderr(_("ERROR: provided instant is out of range.\n")); return; } - + p = static_cast(pos); } catch (domain_error e) @@ -552,8 +551,8 @@ TextSimulation::configure_policy(PolicyType& policy) IntParams int_params = parameters.get_registered_int_parameters(); FloatParams float_params = parameters.get_registered_float_parameters(); StringParams string_params = parameters.get_registered_string_parameters(); - - // check there is at least a parameter to configure + + // check there is at least a parameter to configure if(int_params.size() > 0 || float_params.size() > 0 || string_params.size() > 0) { p_stdout(_("Please provide a value for each attribute:\n")); @@ -581,7 +580,7 @@ TextSimulation::configure_policy(PolicyType& policy) // I tried solving this issue by using templates, but to make // it work will require adding to PolicyParameters a member template // method with 2 specializations... - + if(float_params.size() > 0) p_stdout(_("\nFloating-point arguments:\n")); @@ -628,19 +627,19 @@ TextSimulation::on_configure(const Tokens& arguments) { CPUPolicy* policy = Simulation::get_instance().get_policy(); - if (policy == NULL) + if (policy == nullptr) p_stderr(_("ERROR: No CPU policy actually selected for the simulation\n")); else - configure_policy(*policy); + configure_policy(*policy); } - else if(what == "resource-policy") + else if(what == "resource-policy") { ResourcePolicy* policy = Simulation::get_instance().get_resource_policy(); - if (policy == NULL) + if (policy == nullptr) p_stderr(_("ERROR: No resource policy actually selected for the simulation\n")); else - configure_policy(*policy); + configure_policy(*policy); } else p_stderr(ustring(_("ERROR: Nothing to configure for ")) + what + "\n"); @@ -683,8 +682,8 @@ TextSimulation::on_help(const Tokens& arguments) p_stdout(_("-- JUMPTO COMMAND --\nPauses the simulation and jumps to the specified instant.\n")); else if (command == "CONFIGURE") p_stdout(_("-- CONFIGURE COMMAND --\nConfigures a configurable entity.\n\n" - "Syntax: CONFIGURE \n" - "\twhere may be cpu-policy or resource-policy.\n" + "Syntax: CONFIGURE \n" + "\twhere may be cpu-policy or resource-policy.\n" "This is currently the only way to control the behaviour of " "policies without modifying their source code.\n")); else if (command == "HELP") @@ -706,7 +705,7 @@ TextSimulation::on_help(const Tokens& arguments) "identifier of the thread child of process identified by \n" "`SHOW subrequests ` where the numeric ids " "follow the same logic of the previous commands\n" - "`SHOW statistics`\n")); + "`SHOW statistics`\n")); else if (command == "ADD") p_stderr(_("-- ADD COMMAND --\nAdds an entity by using a questionary-like approach.\n\n" "Syntax depends from entity being added:\n" @@ -780,10 +779,10 @@ TextSimulation::on_get(const Tokens& arguments) template typename GatekeeperType::Manager::Policy& -policy_from_index(const Glib::ustring& value) throw(domain_error) +policy_from_index(const Glib::ustring& value) { int index = string_to(value) - 1; - + if (index < 0) throw domain_error(""); @@ -799,7 +798,7 @@ policy_from_index(const Glib::ustring& value) throw(domain_error) for (CPUPolicyIt pit = policies.begin(); pit != policies.end(); ++pit) { if (index == 0) - return *(*pit); + return *(*pit); --index; } @@ -867,7 +866,7 @@ TextSimulation::on_set(const Tokens& arguments) p_stderr(e.what()); p_stderr("\n"); } - + } else if (attr == "RESOURCE-POLICY") { @@ -1116,19 +1115,19 @@ TextSimulation::on_show_statistics(const Tokens& arguments) check_arguments_num(arguments, 0); const unsigned int front = Simulation::get_instance().get_history().get_front(); - Statistics::get_instance().calculateStatisticsAt(front); + Statistics::get_instance().calculateStatisticsAt(front); const SimulationStatistics* sim = Statistics::get_instance().get_simulation_statistics(); ostringstream oss; - - oss << "\n\n****** SIMULATION STATISTICS *******\n AVG_RESP= " + + oss << "\n\n****** SIMULATION STATISTICS *******\n AVG_RESP= " << sim->get_average_response_time() << " AVG_INACT= " << sim->get_average_inactivity_time() << - " AVG_EXEC= " << sim->get_average_execution_progress() << - "% AVG_EFFIC= " << sim->get_average_efficiency() << - "% AVG_TURN= " << sim->get_average_turn_around() << - " TERM_PROCS= " << sim->get_terminated_processes() << - " TERM_THRES= " << sim->get_terminated_threads() << - " THRU_PROCS= " << sim->get_average_processes_throughput() << + " AVG_EXEC= " << sim->get_average_execution_progress() << + "% AVG_EFFIC= " << sim->get_average_efficiency() << + "% AVG_TURN= " << sim->get_average_turn_around() << + " TERM_PROCS= " << sim->get_terminated_processes() << + " TERM_THRES= " << sim->get_terminated_threads() << + " THRU_PROCS= " << sim->get_average_processes_throughput() << " THRU_THREA= " << sim->get_average_threads_throughput() << "\n\n"; p_stdout(oss.str()); @@ -1693,7 +1692,7 @@ TextSimulation::parse_command(TextSimulation& sim, const ustring& str) // Ignore empty lines if (arguments.size() == 0) return; - + // Allow also comments into batch scripts (w/ echo): if(arguments[0].at(0) == '#') { @@ -1840,7 +1839,7 @@ TextSimulation::update(const Simulation& changed_simulation) // Flush buffer to screen p_stdout(oss.str()); oss.str(string()); - + // Set new format fillers static const unsigned int fill0 = 25; static const unsigned int fill1 = 15; @@ -1851,26 +1850,26 @@ TextSimulation::update(const Simulation& changed_simulation) oss << endl; // Print display header - + oss << left; oss << setw(fill0) << _("PROCESSES:"); oss << right; oss << setw(fill1) << _("state") - << setw(fill1) << _("arrival") - << setw(fill1) << _("requiring") - << setw(fill1) << _("elapsed") - << setw(fill1) << _("priority") - << setw(fill1) << _("resource_id") + << setw(fill1) << _("arrival") + << setw(fill1) << _("requiring") + << setw(fill1) << _("elapsed") + << setw(fill1) << _("priority") + << setw(fill1) << _("resource_id") << endl; // Display information for each schedulable/request in a tabular format - + for (unsigned int pi = 0; pi < processes.size(); ++pi) { // Display process - + Process& p = *processes[pi]; - oss << setw(2) << right << (pi + 1) << left << ". " + oss << setw(2) << right << (pi + 1) << left << ". " << setw(fill0 - 4) << p.get_name().substr(0, fill0 - 5); oss << right; oss << setw(fill1) << p.get_state(); @@ -1884,14 +1883,14 @@ TextSimulation::update(const Simulation& changed_simulation) oss.str(string()); // Display threads - + const vector threads = p.get_threads(); for (unsigned int ti = 0; ti < threads.size(); ++ti) { Thread& t = *threads[ti]; - oss << right << setw(tab.size() + 2) << ti + 1 << left << ". " + oss << right << setw(tab.size() + 2) << ti + 1 << left << ". " << setw(fill0 - 4 - tab.size()) << t.get_name().substr(0, fill0 - 5 - tab.size()); oss << right; oss << setw(fill1) << t.get_state(); @@ -1899,7 +1898,7 @@ TextSimulation::update(const Simulation& changed_simulation) oss << setw(fill1) << t.get_total_cpu_time(); oss << setw(fill1) << t.get_elapsed_time(); oss << setw(fill1) << t.get_current_priority(); - + // Temporary debug code. Remove me when done. // oss << setw(fill1 / 2) << t.get_last_acquisition(); // oss << setw(fill1 / 2) << t.get_last_release(); @@ -1910,7 +1909,7 @@ TextSimulation::update(const Simulation& changed_simulation) oss.str(string()); // Display requests - + const vector requests = t.get_requests(); for (unsigned int ri = 0; ri < requests.size(); ++ri) @@ -1918,7 +1917,7 @@ TextSimulation::update(const Simulation& changed_simulation) Request& r = *requests[ri]; // Display subrequests - + const vector subrequests = r.get_subrequests(); for (unsigned int sri = 0; sri < subrequests.size(); ++sri) @@ -1926,13 +1925,13 @@ TextSimulation::update(const Simulation& changed_simulation) SubRequest& sr = *subrequests[sri]; ResourceIt point = resources.find(sr.get_resource_key()); - oss << setw(2 + tab.size() * 2) << ri + 1 << left << "." << setw(2) << sri + 1 + oss << setw(2 + tab.size() * 2) << ri + 1 << left << "." << setw(2) << sri + 1 << setw(fill0 - 5 - tab.size() * 2) << (point->second)->get_name().substr(0, fill0 - 6 - tab.size() * 2); oss << right; oss << setw(fill1) << sr.get_state(); - oss << setw(fill1) << r.get_instant(); - oss << setw(fill1) << sr.get_length(); - oss << setw(fill1) << sr.get_length() - sr.get_remaining_time(); + oss << setw(fill1) << r.get_instant(); + oss << setw(fill1) << sr.get_length(); + oss << setw(fill1) << sr.get_length() - sr.get_remaining_time(); oss << setw(fill1 * 2) << sr.get_resource_key(); oss << endl;