8 #include <glibmm/timeval.h> 13 extern const Glib::TimeVal
ETERNAL;
23 class ExpirationReminder;
149 virtual int setLimit(
int newLimit) = 0;
171 virtual int setExcess(
int newExcess) = 0;
209 Glib::TimeVal duration =
ETERNAL,
210 bool prioritized =
false,
211 Glib::TimeVal timeOut =
ETERNAL) = 0;
238 Glib::TimeVal& expiryTime,
239 Glib::TimeVal duration =
ETERNAL) = 0;
275 Glib::TimeVal expiryTime,
311 void operator=(
const Counter& unique);
375 void extend(Glib::TimeVal duration);
399 Glib::TimeVal expiryTime,
406 Glib::TimeVal expiryTime;
467 Glib::TimeVal expiryTime;
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
A class defining a common interface for counters.
Definition: Counter.h:105
bool isValid()
Returns the validity of a CounterTicket.
virtual ~Counter()
The destructor.
Glib::TimeVal getExpiryTime(Glib::TimeVal duration)
Computes an expiry time.
virtual int changeLimit(int amount)=0
Changes the limit of the counter.
virtual int changeExcess(int amount)=0
Changes the excess limit of the counter.
virtual int getValue()=0
Returns the current value of the counter.
ExpirationReminder getExpirationReminder(Glib::TimeVal expTime, Counter::IDType resID)
A "relay method" for the constructor of ExpirationReminder.
bool operator<(const ExpirationReminder &other) const
Less than operator, compares "soonness".
void cancel()
Cancels a reservation.
const Glib::TimeVal ETERNAL
A time very far in the future.
const Glib::TimeVal HISTORIC
A time very far in the past.
virtual int getExcess()=0
Returns the excess limit of the counter.
virtual void cancel(IDType reservationID)=0
Cancellation of a reservation.
Glib::TimeVal getExpiryTime() const
Returns the expiry time.
A class intended for internal use within counters.
Definition: Counter.h:424
A class for "tickets" that correspond to counter reservations.
Definition: Counter.h:347
Glib::TimeVal getCurrentTime()
Get the current time.
virtual int setExcess(int newExcess)=0
Sets the excess limit of the counter.
Counter::IDType getReservationID() const
Returns the identification number of the reservation.
virtual int setLimit(int newLimit)=0
Sets the limit of the counter.
unsigned long long int IDType
A typedef of identification numbers for reservation.
Definition: Counter.h:116
void extend(Glib::TimeVal duration)
Extends a reservation.
Counter()
Default constructor.
virtual CounterTicket reserve(int amount=1, Glib::TimeVal duration=ETERNAL, bool prioritized=false, Glib::TimeVal timeOut=ETERNAL)=0
Makes a reservation from the counter.
CounterTicket()
The default constructor.
virtual void extend(IDType &reservationID, Glib::TimeVal &expiryTime, Glib::TimeVal duration=ETERNAL)=0
Extension of a reservation.
CounterTicket getCounterTicket(Counter::IDType reservationID, Glib::TimeVal expiryTime, Counter *counter)
A "relay method" for a constructor of the CounterTicket class.
virtual int getLimit()=0
Returns the current limit of the counter.