X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/src/mc/checker/Checker.hpp diff --git a/src/mc/checker/Checker.hpp b/src/mc/checker/Checker.hpp index 96f5c36a3f..0db97a72b0 100644 --- a/src/mc/checker/Checker.hpp +++ b/src/mc/checker/Checker.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2019. The SimGrid Team. +/* Copyright (c) 2016-2021. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -7,13 +7,7 @@ #ifndef SIMGRID_MC_CHECKER_HPP #define SIMGRID_MC_CHECKER_HPP -#include -#include -#include - -#include "src/mc/Session.hpp" -#include "src/mc/mc_forward.hpp" -#include "src/mc/mc_record.hpp" +#include "src/mc/mc_api.hpp" namespace simgrid { namespace mc { @@ -32,9 +26,8 @@ namespace mc { * have all the necessary features). */ // abstract class Checker { - Session* session_; public: - explicit Checker(Session& session); + inline explicit Checker() { mc_api::get().set_checker(this); } // No copy: Checker(Checker const&) = delete; @@ -52,22 +45,22 @@ public: /** Show the current trace/stack * * Could this be handled in the Session/ModelChecker instead? */ - virtual RecordTrace getRecordTrace() = 0; + virtual RecordTrace get_record_trace() = 0; /** Generate a textual execution trace of the simulated application */ - virtual std::vector getTextualTrace() = 0; + virtual std::vector get_textual_trace() = 0; /** Log additional information about the state of the model-checker */ - virtual void logState() = 0; - -protected: - Session& getSession() { return *session_; } + virtual void log_state() = 0; }; -XBT_PUBLIC Checker* createLivenessChecker(Session& session); -XBT_PUBLIC Checker* createSafetyChecker(Session& session); -XBT_PUBLIC Checker* createCommunicationDeterminismChecker(Session& session); -} -} +// External constructors so that the types (and the types of their content) remain hidden +XBT_PUBLIC Checker* createLivenessChecker(); +XBT_PUBLIC Checker* createSafetyChecker(); +XBT_PUBLIC Checker* createCommunicationDeterminismChecker(); +XBT_PUBLIC Checker* createUdporChecker(); + +} // namespace mc +} // namespace simgrid #endif