PPL  1.2
Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold > Class Template Reference

A class for pending watchdog events with embedded links. More...

#include <Pending_Element_defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >:
Collaboration diagram for Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >:

Public Member Functions

 Pending_Element (const Threshold &deadline, const Handler &handler, bool &expired_flag)
 Constructs an element with the given attributes. More...
 
void assign (const Threshold &deadline, const Handler &handler, bool &expired_flag)
 Modifies *this so that it has the given attributes. More...
 
const Threshold & deadline () const
 Returns the deadline of the event. More...
 
const Handlerhandler () const
 Returns the handler associated to the event. More...
 
bool & expired_flag () const
 Returns a reference to the "event-expired" flag. More...
 
bool OK () const
 Checks if all the invariants are satisfied. More...
 
- Public Member Functions inherited from Parma_Polyhedra_Library::Implementation::Doubly_Linked_Object
 Doubly_Linked_Object ()
 Default constructor. More...
 
 Doubly_Linked_Object (Doubly_Linked_Object *f, Doubly_Linked_Object *b)
 Creates a chain element with forward link f and backward link b. More...
 
void insert_before (Doubly_Linked_Object &y)
 Inserts y before *this. More...
 
void insert_after (Doubly_Linked_Object &y)
 Inserts y after *this. More...
 
Doubly_Linked_Objecterase ()
 Erases *this from the chain and returns a pointer to the next element. More...
 
 ~Doubly_Linked_Object ()
 Erases *this from the chain. More...
 

Private Attributes

Threshold d
 The deadline of the event. More...
 
const Handlerp_h
 A pointer to the handler associated to the event. More...
 
bool * p_f
 A pointer to a flag saying whether the event has already expired or not. More...
 

Detailed Description

template<typename Threshold>
class Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >

A class for pending watchdog events with embedded links.

Each pending watchdog event is characterized by a deadline (a positive time interval), an associated handler that will be invoked upon event expiration, and a Boolean flag that indicates whether the event has already expired or not.

Definition at line 39 of file Pending_Element_defs.hh.

Constructor & Destructor Documentation

template<typename Threshold >
Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::Pending_Element ( const Threshold &  deadline,
const Handler handler,
bool &  expired_flag 
)
inline

Constructs an element with the given attributes.

Definition at line 43 of file Pending_Element_inlines.hh.

References Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::OK().

47  assert(OK());
48 }
bool * p_f
A pointer to a flag saying whether the event has already expired or not.
bool & expired_flag() const
Returns a reference to the "event-expired" flag.
const Threshold & deadline() const
Returns the deadline of the event.
const Handler & handler() const
Returns the handler associated to the event.
const Handler * p_h
A pointer to the handler associated to the event.
bool OK() const
Checks if all the invariants are satisfied.

Member Function Documentation

template<typename Threshold >
void Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::assign ( const Threshold &  deadline,
const Handler handler,
bool &  expired_flag 
)
inline

Modifies *this so that it has the given attributes.

Definition at line 52 of file Pending_Element_inlines.hh.

54  {
55  d = deadline;
56  p_h = &handler;
57  p_f = &expired_flag;
58  assert(OK());
59 }
bool * p_f
A pointer to a flag saying whether the event has already expired or not.
bool & expired_flag() const
Returns a reference to the "event-expired" flag.
const Threshold & deadline() const
Returns the deadline of the event.
const Handler & handler() const
Returns the handler associated to the event.
const Handler * p_h
A pointer to the handler associated to the event.
bool OK() const
Checks if all the invariants are satisfied.
template<typename Threshold >
const Threshold & Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::deadline ( ) const
inline

Returns the deadline of the event.

Definition at line 63 of file Pending_Element_inlines.hh.

63  {
64  return d;
65 }
template<typename Threshold >
bool & Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::expired_flag ( ) const
inline

Returns a reference to the "event-expired" flag.

Definition at line 75 of file Pending_Element_inlines.hh.

75  {
76  return *p_f;
77 }
bool * p_f
A pointer to a flag saying whether the event has already expired or not.
template<typename Threshold >
const Handler & Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::handler ( ) const
inline

Returns the handler associated to the event.

Definition at line 69 of file Pending_Element_inlines.hh.

69  {
70  return *p_h;
71 }
const Handler * p_h
A pointer to the handler associated to the event.
template<typename Threshold >
bool Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::OK ( ) const
inline

Checks if all the invariants are satisfied.

Definition at line 37 of file Pending_Element_inlines.hh.

Referenced by Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::Pending_Element().

37  {
38  return true;
39 }

Member Data Documentation

template<typename Threshold>
Threshold Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::d
private

The deadline of the event.

Definition at line 66 of file Pending_Element_defs.hh.

template<typename Threshold>
bool* Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::p_f
private

A pointer to a flag saying whether the event has already expired or not.

Definition at line 72 of file Pending_Element_defs.hh.

template<typename Threshold>
const Handler* Parma_Polyhedra_Library::Implementation::Watchdog::Pending_Element< Threshold >::p_h
private

A pointer to the handler associated to the event.

Definition at line 69 of file Pending_Element_defs.hh.


The documentation for this class was generated from the following files: