GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/base/modal_exception.h Lines: 6 9 66.7 %
Date: 2021-05-22 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Morgan Deters, Andres Noetzli, Mathias Preiner
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * An exception that is thrown when an interactive-only feature while
14
 * cvc5 is being used in a non-interactive setting (for example, the
15
 * "(get-assertions)" command in an SMT-LIBv2 script).
16
 */
17
18
#include "cvc5_public.h"
19
20
#ifndef CVC5__SMT__MODAL_EXCEPTION_H
21
#define CVC5__SMT__MODAL_EXCEPTION_H
22
23
#include "base/exception.h"
24
25
namespace cvc5 {
26
27
23
class ModalException : public cvc5::Exception
28
{
29
 public:
30
  ModalException() :
31
    Exception("Feature used while operating in "
32
              "incorrect state") {
33
  }
34
35
  ModalException(const std::string& msg) :
36
    Exception(msg) {
37
  }
38
39
23
  ModalException(const char* msg) :
40
23
    Exception(msg) {
41
23
  }
42
}; /* class ModalException */
43
44
/**
45
 * Special case of ModalException that allows the execution of the solver to
46
 * continue.
47
 *
48
 * TODO(#1108): This exception should not be needed anymore in future versions
49
 * of the public API.
50
 */
51
19
class RecoverableModalException : public cvc5::ModalException
52
{
53
 public:
54
  RecoverableModalException(const std::string& msg) : ModalException(msg) {}
55
56
19
  RecoverableModalException(const char* msg) : ModalException(msg) {}
57
}; /* class RecoverableModalException */
58
59
}  // namespace cvc5
60
61
#endif /* CVC5__SMT__MODAL_EXCEPTION_H */