APRONXX  0.9.12
/builddir/build/BUILD/apron-0.9.13/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 
32 namespace apron {
33 
34 
35 /* =============== */
36 /* tbool */
37 /* =============== */
38 
44 struct tbool {
45 
46 public:
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 
63  friend tbool operator|| (tbool a, tbool b);
64 
66  friend tbool operator&& (tbool a, tbool b);
67 
69  friend tbool operator! (tbool a);
70 
72  friend std::ostream& operator<<(std::ostream& os, tbool x);
73 
74 
75 };
76 
77 
78 /* =============== */
79 /* exceptions */
80 /* =============== */
81 
82 
84 class timeout : public std::logic_error {
85 public:
88  timeout(const std::string& x) : logic_error(x) {}
89 };
90 
91 
93 class not_implemented : public std::logic_error {
94 public:
97  not_implemented(const std::string& x) : logic_error(x) {}
98 };
99 
100 
101 class abstract0;
102 class abstract1;
103 
104 
105 /* =============== */
106 /* manager */
107 /* =============== */
108 
137 class manager : public use_malloc {
138 
139 protected:
140 
141  ap_manager_t* m;
142 
144  manager(ap_manager_t* m);
145 
146  friend class abstract0;
147  friend class abstract1;
148 
149 public:
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 */
apron::manager::get_library
std::string get_library() const
Returns the name of the library the manager comes from.
Definition: apxx_manager_inline.hh:173
apron::manager::fpu_init
static void fpu_init()
Sets the FPU rounding-mode towards +oo.
Definition: apxx_manager_inline.hh:216
apron::manager::exception_raised
bool exception_raised()
Internal use only. Whether APRON has raised an exception.
Definition: apxx_manager_inline.hh:82
apron::abstract0
Level 0 abstract value (ap_abstract0_t* wrapper).
Definition: apxx_abstract0.hh:78
apron::tbool::operator&&
friend tbool operator&&(tbool a, tbool b)
3-valued logical and.
apxx_generator0.hh
apron::manager::get_flag_exact
bool get_flag_exact()
Returns the 'is exact' flag associated to the last computed abstract function.
Definition: apxx_manager_inline.hh:195
apron::manager::manager
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
apxx_lincons0.hh
apron::not_implemented::not_implemented
not_implemented(const std::string &x)
Definition: apxx_manager.hh:97
apron::abstract1
Level 1 abstract value (ap_abstract1_t wrapper).
Definition: apxx_abstract1.hh:42
apron::use_malloc
Inherited by most wrappers to map new and delete to malloc and free.
Definition: apxx_scalar.hh:69
apron::tbool::operator<<
friend std::ostream & operator<<(std::ostream &os, tbool x)
Printing.
apron::manager::m
ap_manager_t * m
Pointer managed by APRON.
Definition: apxx_manager.hh:141
apron::manager::~manager
virtual ~manager()
Decrements the reference counter and, when reaching 0, frees the manager.
Definition: apxx_manager_inline.hh:160
apron::tbool::operator!
friend tbool operator!(tbool a)
3-valued logical not.
apron::manager::operator<<
friend std::ostream & operator<<(std::ostream &os, const manager &s)
Prints the library name and version.
apron::timeout::timeout
timeout(const std::string &x)
Definition: apxx_manager.hh:88
apron::manager::operator=
manager & operator=(const manager &x)
Assignment (actually performs some reference counter management).
Definition: apxx_manager_inline.hh:165
apron::timeout
Exception raised when a timeout occurs.
Definition: apxx_manager.hh:84
apron::manager::get_funopt
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
apron::tbool::operator||
friend tbool operator||(tbool a, tbool b)
3-valued logical or.
apron::manager::get_version
std::string get_version() const
Returns the version name of the library the manager comes from.
Definition: apxx_manager_inline.hh:178
apxx_tcons0.hh
apron::manager::get_scalar_discr
ap_scalar_discr_t & get_scalar_discr()
Returns a (modifiable) reference to the user's preferred scalar type.
Definition: apxx_manager_inline.hh:190
apron::manager::get_flag_best
bool get_flag_best()
Returns the 'is best' flag associated to the last computed abstract function.
Definition: apxx_manager_inline.hh:200
apron::tbool::tbool
tbool(bool a)
Converts true to tbool_true and false to tbool_false.
Definition: apxx_manager_inline.hh:23
apxx_manager_inline.hh
apron::not_implemented
Exception raised when a function is not implemented.
Definition: apxx_manager.hh:93
apron::manager
Library manager (ap_manager_t wrapper).
Definition: apxx_manager.hh:137
apron
Definition: apxx_abstract0.hh:27
apron::manager::get_ap_manager_t
ap_manager_t * get_ap_manager_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_manager_inline.hh:206
apron::tbool::x
tbool_t x
Either tbool_false, tbool_true, or tbool_top.
Definition: apxx_manager.hh:48
apron::tbool
3-valued boolean (tbool_t wrapper).
Definition: apxx_manager.hh:44