ARC SDK
|
A class for "tickets" that correspond to counter reservations. More...
#include <arc/Counter.h>
Public Member Functions | |
CounterTicket () | |
The default constructor. More... | |
bool | isValid () |
Returns the validity of a CounterTicket. More... | |
void | extend (Glib::TimeVal duration) |
Extends a reservation. More... | |
void | cancel () |
Cancels a reservation. More... | |
Friends | |
class | Counter |
The Counter class needs to be a friend. More... | |
A class for "tickets" that correspond to counter reservations.
This is a class for reservation tickets. When a reservation is made from a Counter, a ReservationTicket is returned. This ticket can then be queried about the validity of a reservation. It can also be used for cancellation and extension of reservations.
Typical usage is:
Arc::CounterTicket::CounterTicket | ( | ) |
The default constructor.
This is the default constructor. It creates a CounterTicket that is not valid. The ticket object that is created can later be assigned a ticket that is returned by the reserve() method of a Counter.
void Arc::CounterTicket::cancel | ( | ) |
Cancels a reservation.
This method is called to cancel a reservation. It may be called also for self-expiring reservations, which will then be cancelled before they were originally planned to expire.
void Arc::CounterTicket::extend | ( | Glib::TimeVal | duration | ) |
Extends a reservation.
Extends a self-expiring reservation. In order to succeed the extension should be made before the previous reservation expires.
duration | The time by which to extend the reservation. The new expiration time is computed based on the current time, NOT the previous expiration time. |
bool Arc::CounterTicket::isValid | ( | ) |
Returns the validity of a CounterTicket.
This method checks whether a CounterTicket is valid. The ticket was probably returned earlier by the reserve() method of a Counter but the corresponding reservation may have expired.