X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bdef81fa4e3566ce31b435deb98fea7b8fe70e6e..732fb7b7871f8a5e0f3994c068bb613065d7cd63:/src/mc/checker/Checker.hpp diff --git a/src/mc/checker/Checker.hpp b/src/mc/checker/Checker.hpp index 4575439965..c0ba4a38cf 100644 --- a/src/mc/checker/Checker.hpp +++ b/src/mc/checker/Checker.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016. 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/mc_forward.hpp" -#include "src/mc/mc_record.h" -#include "src/mc/Session.hpp" +#include "src/mc/api.hpp" namespace simgrid { namespace mc { @@ -33,17 +27,18 @@ namespace mc { // abstract class Checker { Session* session_; + public: - Checker(Session& session); + explicit Checker(Session* session) : session_(session) {} // No copy: Checker(Checker const&) = delete; Checker& operator=(Checker const&) = delete; - virtual ~Checker(); + virtual ~Checker() = default; /** Main function of this algorithm */ - virtual int run() = 0; + virtual void run() = 0; /* These methods are callbacks called by the model-checking engine * to get and display information about the current state of the @@ -52,23 +47,24 @@ public: /** Show the current trace/stack * * Could this be handled in the Session/ModelChecker instead? */ - virtual RecordTrace getRecordTrace(); + virtual RecordTrace get_record_trace() = 0; /** Generate a textual execution trace of the simulated application */ - virtual std::vector getTextualTrace(); + virtual std::vector get_textual_trace() = 0; /** Log additional information about the state of the model-checker */ - virtual void logState(); + virtual void log_state() = 0; -protected: - Session& getSession() { return *session_; } + Session& get_session() { return *session_; } }; -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(Session* session); +XBT_PUBLIC Checker* createSafetyChecker(Session* session); +XBT_PUBLIC Checker* createCommunicationDeterminismChecker(Session* session); +XBT_PUBLIC Checker* createUdporChecker(Session* session); -} -} +} // namespace mc +} // namespace simgrid #endif