Traits class for the deterministic timeout mechanism. More...
#include <globals.defs.hh>
Public Types | |
| typedef unsigned long long | Threshold |
| The type used to specify thresholds for computational weight. | |
| typedef unsigned long long | Delta |
| The type used to specify increments of computational weight. | |
Static Public Member Functions | |
| static const Threshold & | get () |
| Returns the current computational weight. | |
| static bool | less_than (const Threshold &a, const Threshold &b) |
Compares the two weights a and b. | |
| static void | from_delta (Threshold &threshold, const Delta &delta) |
Sets threshold to be delta units bigger than the current weigth. | |
Static Public Attributes | |
| static Threshold | weight = 0 |
| The current computational weight. | |
| static void(* | check_function )(void) |
| A pointer to the function that has to be called when checking the reaching of thresholds. | |
Traits class for the deterministic timeout mechanism.
This abstract base class should be instantiated by those users willing to provide a polynomial upper bound to the time spent by any invocation of a library operator.
Definition at line 97 of file globals.defs.hh.
| typedef unsigned long long Parma_Polyhedra_Library::Weightwatch_Traits::Delta |
The type used to specify increments of computational weight.
Definition at line 102 of file globals.defs.hh.
| typedef unsigned long long Parma_Polyhedra_Library::Weightwatch_Traits::Threshold |
The type used to specify thresholds for computational weight.
Definition at line 99 of file globals.defs.hh.
| void Parma_Polyhedra_Library::Weightwatch_Traits::from_delta | ( | Threshold & | threshold, | |
| const Delta & | delta | |||
| ) | [inline, static] |
Sets threshold to be delta units bigger than the current weigth.
Definition at line 48 of file globals.inlines.hh.
References weight.
00048 { 00049 threshold = weight + delta; 00050 }
| const Weightwatch_Traits::Threshold & Parma_Polyhedra_Library::Weightwatch_Traits::get | ( | ) | [inline, static] |
Returns the current computational weight.
Definition at line 38 of file globals.inlines.hh.
References weight.
00038 { 00039 return weight; 00040 }
| bool Parma_Polyhedra_Library::Weightwatch_Traits::less_than | ( | const Threshold & | a, | |
| const Threshold & | b | |||
| ) | [inline, static] |
Compares the two weights a and b.
Definition at line 43 of file globals.inlines.hh.
00043 { 00044 return b - a < 1ULL << (sizeof(Threshold)*8-1); 00045 }
void(* Parma_Polyhedra_Library::Weightwatch_Traits::check_function)(void)=0 [static] |
A pointer to the function that has to be called when checking the reaching of thresholds.
The pointer can be null if no thresholds are set.
Definition at line 122 of file globals.defs.hh.
Referenced by Parma_Polyhedra_Library::maybe_abandon().
The current computational weight.
Definition at line 114 of file globals.defs.hh.
Referenced by from_delta(), and get().
1.6.3