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

Line Exec Source
1
/*********************                                                        */
2
/*! \file modal_exception.h
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Morgan Deters, Andres Noetzli, Mathias Preiner
6
 ** This file is part of the CVC4 project.
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.\endverbatim
11
 **
12
 ** \brief An exception that is thrown when an interactive-only
13
 ** feature while CVC4 is being used in a non-interactive setting
14
 **
15
 ** An exception that is thrown when an interactive-only feature while
16
 ** CVC4 is being used in a non-interactive setting (for example, the
17
 ** "(get-assertions)" command in an SMT-LIBv2 script).
18
 **/
19
20
#include "cvc4_public.h"
21
22
#ifndef CVC4__SMT__MODAL_EXCEPTION_H
23
#define CVC4__SMT__MODAL_EXCEPTION_H
24
25
#include "base/exception.h"
26
27
namespace CVC4 {
28
29
21
class ModalException : public CVC4::Exception
30
{
31
 public:
32
  ModalException() :
33
    Exception("Feature used while operating in "
34
              "incorrect state") {
35
  }
36
37
  ModalException(const std::string& msg) :
38
    Exception(msg) {
39
  }
40
41
21
  ModalException(const char* msg) :
42
21
    Exception(msg) {
43
21
  }
44
}; /* class ModalException */
45
46
/**
47
 * Special case of ModalException that allows the execution of the solver to
48
 * continue.
49
 *
50
 * TODO(#1108): This exception should not be needed anymore in future versions
51
 * of the public API.
52
 */
53
17
class RecoverableModalException : public CVC4::ModalException
54
{
55
 public:
56
  RecoverableModalException(const std::string& msg) : ModalException(msg) {}
57
58
17
  RecoverableModalException(const char* msg) : ModalException(msg) {}
59
}; /* class RecoverableModalException */
60
61
}/* CVC4 namespace */
62
63
#endif /* CVC4__SMT__MODAL_EXCEPTION_H */