23inline tbool::tbool(
bool a) : x(a ? tbool_true : tbool_false)
31inline tbool::operator tbool_t()
36inline tbool::operator bool()
43 return tbool(tbool_or(a.x,b.x));
48 return tbool(tbool_and(a.x,b.x));
53 return tbool(tbool_not(a.x));
56inline std::ostream&
operator<<(std::ostream& os, tbool x)
59 case tbool_true:
return os <<
"true";
60 case tbool_false:
return os <<
"false";
61 case tbool_top:
return os <<
"top";
62 default:
throw std::invalid_argument(
"apron::operator<<(ostream&, tbool) invalid boolean");
76 if (!
m)
throw std::invalid_argument(
"apron::manager::manager(ap_manager_t* m) m is NULL");
78 for (
size_t i=0; i<AP_EXC_SIZE; i++)
79 m->option.abort_if_exception[i] = 0;
84 return (
m->result.exclog &&
m->result.exclog->exn!=AP_EXC_NONE);
88inline void manager::raise(ap_manager_t* m,
const char* msg, ap_abstract0_t* a)
90 if (!
m->result.exclog)
return;
92 std::string s = std::string(msg)+
" : "+
m->result.exclog->msg;
94 switch (
m->result.exclog->exn) {
100 ap_manager_clear_exclog(
m);
101 if (a) ap_abstract0_free(
m,a);
105 case AP_EXC_OUT_OF_SPACE:
106 ap_manager_clear_exclog(
m);
107 if (a) ap_abstract0_free(
m,a);
108 throw std::length_error(s);
111 case AP_EXC_OVERFLOW:
112 ap_manager_clear_exclog(
m);
113 if (a) ap_abstract0_free(
m,a);
114 throw std::overflow_error(s);
117 case AP_EXC_INVALID_ARGUMENT:
118 ap_manager_clear_exclog(
m);
119 if (a) ap_abstract0_free(
m,a);
120 throw std::invalid_argument(s);
123 case AP_EXC_NOT_IMPLEMENTED:
124 ap_manager_clear_exclog(
m);
125 if (a) ap_abstract0_free(
m,a);
130 ap_manager_clear_exclog(
m);
131 if (a) ap_abstract0_free(
m,a);
132 throw std::range_error(s+
" (unknwon exception type)");
144 if (!
m->result.exclog ||
m->result.exclog->exn==AP_EXC_NONE)
return;
145 ap_environment_free(a.env);
156 : m(ap_manager_copy(x.m))
167 ap_manager_t* mm = ap_manager_copy(x.
m);
175 return std::string(ap_manager_get_library(
m));
180 return std::string(ap_manager_get_version(
m));
185 if (funid<=AP_FUNID_UNKNOWN || funid>=AP_FUNID_SIZE)
186 throw std::out_of_range(
"apron::manager::get_funopt(ap_funid_t) unknown funid");
187 return m->option.funopt[funid];
192 return m->option.scalar_discr;
197 return ap_manager_get_flag_exact(
m);
202 return ap_manager_get_flag_best(
m);
219 throw std::runtime_error(
"apron::manager::fpu_init() failed");
222inline std::ostream&
operator<< (std::ostream& os,
const manager& s)
224 return os << ap_manager_get_library(s.m) <<
", " << ap_manager_get_version(s.m);
std::ostream & operator<<(std::ostream &os, const abstract0 &s)
Definition apxx_abstract0_inline.hh:292
tbool operator!(tbool a)
Definition apxx_manager_inline.hh:51
tbool operator&&(tbool a, tbool b)
Definition apxx_manager_inline.hh:46
tbool operator||(tbool a, tbool b)
Definition apxx_manager_inline.hh:41
Library manager (ap_manager_t wrapper).
Definition apxx_manager.hh:137
ap_funopt_t & get_funopt(ap_funid_t funid)
Returns a (modifiable) reference to the options associated to some abstract function.
Definition apxx_manager_inline.hh:183
bool exception_raised()
Internal use only. Whether APRON has raised an exception.
Definition apxx_manager_inline.hh:82
bool get_flag_exact()
Returns the 'is exact' flag associated to the last computed abstract function.
Definition apxx_manager_inline.hh:195
ap_manager_t * get_ap_manager_t()
Returns a pointer to the internal APRON object stored in *this.
Definition apxx_manager_inline.hh:206
static void fpu_init()
Sets the FPU rounding-mode towards +oo.
Definition apxx_manager_inline.hh:216
ap_scalar_discr_t & get_scalar_discr()
Returns a (modifiable) reference to the user's preferred scalar type.
Definition apxx_manager_inline.hh:190
bool get_flag_best()
Returns the 'is best' flag associated to the last computed abstract function.
Definition apxx_manager_inline.hh:200
std::string get_version() const
Returns the version name of the library the manager comes from.
Definition apxx_manager_inline.hh:178
std::string get_library() const
Returns the name of the library the manager comes from.
Definition apxx_manager_inline.hh:173
virtual ~manager()
Decrements the reference counter and, when reaching 0, frees the manager.
Definition apxx_manager_inline.hh:160
ap_manager_t * m
Pointer managed by APRON.
Definition apxx_manager.hh:141
manager(ap_manager_t *m)
Internal use only (by subclasses). Initialise from a ap_manager_t* and take ownership (no copy).
Definition apxx_manager_inline.hh:74
static void raise(ap_manager_t *m, const char *msg, ap_abstract0_t *a=NULL)
Internal use only. Translates APRON exceptions to C++ ones.
Definition apxx_manager_inline.hh:88
manager & operator=(const manager &x)
Assignment (actually performs some reference counter management).
Definition apxx_manager_inline.hh:165
Exception raised when a function is not implemented.
Definition apxx_manager.hh:93
Exception raised when a timeout occurs.
Definition apxx_manager.hh:84
tbool(bool a)
Converts true to tbool_true and false to tbool_false.
Definition apxx_manager_inline.hh:23