APRONXX  0.9.12
/home/mine/apron/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 
169 
175  manager(const manager& x);
176 
178 
182 
184  virtual ~manager();
185 
187 
188 
197  manager& operator= (const manager& x);
198 
200 
204 
206  std::string get_library() const;
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 */
tbool(bool a)
Converts true to tbool_true and false to tbool_false.
Definition: apxx_manager.hh:24
static void fpu_init()
Sets the FPU rounding-mode towards +oo.
Definition: apxx_manager.hh:217
Definition: apxx_abstract0.hh:27
not_implemented(const std::string &x)
Definition: apxx_manager.hh:97
Exception raised when a function is not implemented.
Definition: apxx_manager.hh:93
timeout(const std::string &x)
Definition: apxx_manager.hh:88
std::string get_library() const
Returns the name of the library the manager comes from.
Definition: apxx_manager.hh:174
ap_manager_t * get_ap_manager_t()
Returns a pointer to the internal APRON object stored in *this.
Definition: apxx_manager.hh:207
bool exception_raised()
Internal use only. Whether APRON has raised an exception.
Definition: apxx_manager.hh:83
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.
Definition: apxx_manager.hh:52
bool get_flag_exact()
Returns the 'is exact' flag associated to the last computed abstract function.
Definition: apxx_manager.hh:196
Level 0 abstract value (ap_abstract0_t* wrapper).
Definition: apxx_abstract0.hh:78
friend tbool operator &&(tbool a, tbool b)
3-valued logical and.
Definition: apxx_manager.hh:47
Library manager (ap_manager_t wrapper).
Definition: apxx_manager.hh:137
manager(ap_manager_t *m)
Internal use only (by subclasses). Initialise from a ap_manager_t* and take ownership (no copy).
Definition: apxx_manager.hh:75
ap_manager_t * m
Pointer managed by APRON.
Definition: apxx_manager.hh:141
friend tbool operator||(tbool a, tbool b)
3-valued logical or.
Definition: apxx_manager.hh:42
friend std::ostream & operator<<(std::ostream &os, tbool x)
Printing.
Definition: apxx_manager.hh:57
manager & operator=(const manager &x)
Assignment (actually performs some reference counter management).
Definition: apxx_manager.hh:166
Level 1 abstract value (ap_abstract1_t wrapper).
Definition: apxx_abstract1.hh:42
ap_scalar_discr_t & get_scalar_discr()
Returns a (modifiable) reference to the user's preferred scalar type.
Definition: apxx_manager.hh:191
bool get_flag_best()
Returns the 'is best' flag associated to the last computed abstract function.
Definition: apxx_manager.hh:201
Inherited by most wrappers to map new and delete to malloc and free.
Definition: apxx_scalar.hh:69
3-valued boolean (tbool_t wrapper).
Definition: apxx_manager.hh:44
friend std::ostream & operator<<(std::ostream &os, const manager &s)
Prints the library name and version.
Definition: apxx_manager.hh:223
virtual ~manager()
Decrements the reference counter and, when reaching 0, frees the manager.
Definition: apxx_manager.hh:161
ap_funopt_t & get_funopt(ap_funid_t funid)
Returns a (modifiable) reference to the options associated to some abstract function.
Definition: apxx_manager.hh:184
std::string get_version() const
Returns the version name of the library the manager comes from.
Definition: apxx_manager.hh:179
Exception raised when a timeout occurs.
Definition: apxx_manager.hh:84