Library manager (ap_manager_t wrapper).
More...
#include <apxx_manager.hh>
Inherits apron::use_malloc.
Inherited by apron::box_manager, apron::oct_manager, apron::pkgrid_manager, apron::polka_manager, apron::ppl_grid_manager, apron::ppl_poly_manager, and apron::t1p_manager.
|
static void | raise (ap_manager_t *m, const char *msg, ap_abstract0_t *a=NULL) |
| Internal use only. Translates APRON exceptions to C++ ones. More...
|
|
static void | raise (ap_manager_t *m, const char *msg, ap_abstract1_t a) |
| Internal use only. Translates APRON exceptions to C++ ones. More...
|
|
|
static void | fpu_init () |
| Sets the FPU rounding-mode towards +oo. More...
|
|
|
| manager (ap_manager_t *m) |
| Internal use only (by subclasses). Initialise from a ap_manager_t* and take ownership (no copy). More...
|
|
|
ap_manager_t * | m |
| Pointer managed by APRON. More...
|
|
Library manager (ap_manager_t wrapper).
A manager is an instance of a numerical abstract domain library. It has three roles:
- dispatch functions to the correct library (allowing multiple domain libraries to be used in a program),
- store instance-specific configuration options (such as precision/cost ratios) and feed-backs (such as exactness and best flag),
- store instance-specific scratch space used by algorithms (allowing thread-safe operations without too much allocation of function-local data).
The following guidelines should be followed:
- a manager instance is required to create and manipulate abstract0 elements,
- an abstract0 element can be manipulated using any manager compatible with the one it was created with (that is, a manager for the same library, created using the same parameter values, if any),
- two threads should always operate on distinct arguments, and using distinct managers (if they operate concurrently).
The manager class is an abstract base class for all managers. It has no effective constructor. Instead, you should use the derived class corresponding to the numerical domain library you wish to use.
Managers are reference-counted. In particular, copying simply increment the reference counter and does not create an independent manager with its own scratch space. Thus, a manager and its copy cannot be used by concurrent threads.
◆ manager() [1/2]
manager::manager |
( |
ap_manager_t * |
m | ) |
|
|
inlineprotected |
Internal use only (by subclasses). Initialise from a ap_manager_t* and take ownership (no copy).
◆ manager() [2/2]
manager::manager |
( |
const manager & |
x | ) |
|
|
inline |
Increments the reference counter.
- Warning
- After the assignment, x and the new manager share the same scratch space, and thus, cannot be used by concurrent threads.
◆ ~manager()
Decrements the reference counter and, when reaching 0, frees the manager.
◆ exception_raised()
bool manager::exception_raised |
( |
| ) |
|
|
inline |
Internal use only. Whether APRON has raised an exception.
◆ fpu_init()
void manager::fpu_init |
( |
| ) |
|
|
inlinestatic |
Sets the FPU rounding-mode towards +oo.
This is needed to ensure the soundness of all double-manipulating functions in APRON (coefficients or intervals with double bounds, floating-point abstract domains, etc.)
The FPU rounding-mode change is global. It affects all managers (already created or yet to be created) as well as all other floating-point computations in the program.
- Exceptions
-
std::runtime_error | if the APRON was not able to set the rounding-mode. |
◆ get_ap_manager_t() [1/2]
ap_manager_t * manager::get_ap_manager_t |
( |
| ) |
|
|
inline |
Returns a pointer to the internal APRON object stored in *this.
◆ get_ap_manager_t() [2/2]
const ap_manager_t * manager::get_ap_manager_t |
( |
| ) |
const |
|
inline |
◆ get_flag_best()
bool manager::get_flag_best |
( |
| ) |
|
|
inline |
Returns the 'is best' flag associated to the last computed abstract function.
◆ get_flag_exact()
bool manager::get_flag_exact |
( |
| ) |
|
|
inline |
Returns the 'is exact' flag associated to the last computed abstract function.
◆ get_funopt()
ap_funopt_t & manager::get_funopt |
( |
ap_funid_t |
funid | ) |
|
|
inline |
Returns a (modifiable) reference to the options associated to some abstract function.
- Exceptions
-
std::out_of_range | if funid is no between AP_FUNID_COPY and AP_FUNID_CLOSURE (inclusive). |
◆ get_library()
std::string manager::get_library |
( |
| ) |
const |
|
inline |
Returns the name of the library the manager comes from.
◆ get_scalar_discr()
ap_scalar_discr_t & manager::get_scalar_discr |
( |
| ) |
|
|
inline |
Returns a (modifiable) reference to the user's preferred scalar type.
- Returns
- the scalar type can be either
AP_SCALAR_DOUBLE
, AP_SCALAR_MPQ
, or AP_SCALAR_MPFR
.
◆ get_version()
std::string manager::get_version |
( |
| ) |
const |
|
inline |
Returns the version name of the library the manager comes from.
◆ operator=()
Assignment (actually performs some reference counter management).
- Warning
- After the assignment, x and *this share the same scratch space, and thus, cannot be used by concurrent threads.
◆ raise() [1/4]
void apron::manager::raise |
( |
ap_manager_t * |
m, |
|
|
const char * |
msg, |
|
|
ap_abstract0_t * |
a = NULL |
|
) |
| |
|
inlinestatic |
Internal use only. Translates APRON exceptions to C++ ones.
◆ raise() [2/4]
void manager::raise |
( |
ap_manager_t * |
m, |
|
|
const char * |
msg, |
|
|
ap_abstract1_t |
a |
|
) |
| |
|
inlinestatic |
Internal use only. Translates APRON exceptions to C++ ones.
◆ raise() [3/4]
void apron::manager::raise |
( |
const char * |
msg, |
|
|
ap_abstract0_t * |
a = NULL |
|
) |
| |
|
inline |
Internal use only. Translates APRON exceptions to C++ ones.
◆ raise() [4/4]
void manager::raise |
( |
const char * |
msg, |
|
|
ap_abstract1_t |
a |
|
) |
| |
|
inline |
Internal use only. Translates APRON exceptions to C++ ones.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const manager & |
s |
|
) |
| |
|
friend |
Prints the library name and version.
ap_manager_t* apron::manager::m |
|
protected |
Pointer managed by APRON.
The documentation for this class was generated from the following files: