APRONXX 0.9.14
/builddir/build/BUILD/apron-0.9.15-build/apron-0.9.15/apronxx/apxx_manager.hh
Go to the documentation of this file.
1/* -*- C++ -*-
2 * apxx_manager.hh
3 *
4 * APRON Library / C++ class wrappers
5 *
6 * Copyright (C) Antoine Mine' 2007
7 *
8 */
9/* This file is part of the APRON Library, released under LGPL license
10 with an exception allowing the redistribution of statically linked
11 executables.
12
13 Please read the COPYING file packaged in the distribution.
14*/
15
16#ifndef __APXX_MANAGER_HH
17#define __APXX_MANAGER_HH
18
19#include <string>
20
21#include "ap_manager.h"
22#include "ap_abstract0.h"
23#include "ap_abstract1.h"
24#include "apxx_lincons0.hh"
25#include "apxx_tcons0.hh"
26#include "apxx_generator0.hh"
27
28#include "box.h"
29#include "pk.h"
30#include "oct.h"
31
32namespace apron {
33
34
35/* =============== */
36/* tbool */
37/* =============== */
38
44struct tbool {
45
46public:
47
48 tbool_t x;
49
51 tbool(bool a);
52
54 tbool(tbool_t a);
55
57 operator tbool_t();
58
60 operator bool();
61
64
67
70
72 friend std::ostream& operator<<(std::ostream& os, tbool x);
73
74
75};
76
77
78/* =============== */
79/* exceptions */
80/* =============== */
81
82
84class timeout : public std::logic_error {
85public:
88 timeout(const std::string& x) : logic_error(x) {}
89};
90
91
93class not_implemented : public std::logic_error {
94public:
97 not_implemented(const std::string& x) : logic_error(x) {}
98};
99
100
101class abstract0;
102class abstract1;
103
104
105/* =============== */
106/* manager */
107/* =============== */
108
137class manager : public use_malloc {
138
139protected:
140
141 ap_manager_t* m;
142
144 manager(ap_manager_t* m);
145
146 friend class abstract0;
147 friend class abstract1;
148
149public:
150
152 static void raise(ap_manager_t* m, const char* msg, ap_abstract0_t* a = NULL);
153
155 static void raise(ap_manager_t* m, const char* msg, ap_abstract1_t a);
156
158 void raise(const char* msg, ap_abstract0_t* a = NULL);
159
161 void raise(const char* msg, ap_abstract1_t a);
162
164 bool exception_raised();
165
166
169
175 manager(const manager& x);
176
178
179
182
184 virtual ~manager();
185
187
188
191
197 manager& operator= (const manager& x);
198
200
201
204
206 std::string get_library() const;
207
209 std::string get_version() const;
210
215 ap_funopt_t& get_funopt(ap_funid_t funid);
216
221 ap_scalar_discr_t& get_scalar_discr();
222
224 bool get_flag_exact();
225
227 bool get_flag_best();
228
230
231
234
246 static void fpu_init();
247
249
250
253
255 friend std::ostream& operator<< (std::ostream& os, const manager& s);
256
258
259
260 /* C-level compatibility */
261 /* ===================== */
262
265
267 ap_manager_t* get_ap_manager_t();
268 const ap_manager_t* get_ap_manager_t() const;
269
271
272};
273
274#include "apxx_manager_inline.hh"
275
276}
277
278#endif /* __APXX_MANAGER_HH */
Level 0 abstract value (ap_abstract0_t* wrapper).
Definition apxx_abstract0.hh:78
Level 1 abstract value (ap_abstract1_t wrapper).
Definition apxx_abstract1.hh:42
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
friend std::ostream & operator<<(std::ostream &os, const manager &s)
Prints the library name and version.
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
not_implemented(const std::string &x)
Definition apxx_manager.hh:97
Exception raised when a timeout occurs.
Definition apxx_manager.hh:84
timeout(const std::string &x)
Definition apxx_manager.hh:88
Definition apxx_abstract0.hh:27
3-valued boolean (tbool_t wrapper).
Definition apxx_manager.hh:44
tbool_t x
Either tbool_false, tbool_true, or tbool_top.
Definition apxx_manager.hh:48
friend tbool operator!(tbool a)
3-valued logical not.
friend tbool operator&&(tbool a, tbool b)
3-valued logical and.
friend std::ostream & operator<<(std::ostream &os, tbool x)
Printing.
tbool(bool a)
Converts true to tbool_true and false to tbool_false.
Definition apxx_manager_inline.hh:23
friend tbool operator||(tbool a, tbool b)
3-valued logical or.
Inherited by most wrappers to map new and delete to malloc and free.
Definition apxx_scalar.hh:69