class SignallingCounter

A counter class. More...

Full nameTelEngine::SignallingCounter
Definition#include <libs/ysig/yatesig.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Counter management class. Keep a value between 0 and a given maximum one

inline  SignallingCounter (u_int32_t maxVal)

SignallingCounter

Constructor

Parameters:
maxValThe maximum value for the counter

inline void  maxVal (u_int32_t value)

maxVal

Set the maximum value for the counter

Parameters:
valueThe new maximum value for the counter

inline u_int32_t  maxVal ()

maxVal

[const]

Get the maximum value for the counter

Returns: The maximum value for the counter

inline u_int32_t  count ()

count

[const]

Get the current value of the counter

Returns: The current value of the counter

inline void  reset (bool down = true)

reset

Reset the counter's value

Parameters:
downTrue to reset to 0, false to reset to maxVal()

inline bool  inc ()

inc

Increment the counter's value if it can

Returns: False if the counter is full (reached the maximum value)

inline bool  dec ()

dec

Decrement the counter's value if it can

Returns: False if the counter is empty (reached 0)

inline bool  empty ()

empty

[const]

Check if the counter is empty (the value is 0)

Returns: True if the counter is empty

inline bool  full ()

full

[const]

Check if the counter is full (the value reached the maximum)

Returns: True if the counter is full


Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.