DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Dispatcher.hh>
Public Types | |
using | Array = std::array< unsigned, Size > |
Public Member Functions | |
Dispatcher (unsigned n) | |
const Array & | init () |
const Array & | next () |
bool | hasNext () const |
bool | empty () const |
unsigned | nbElements () const |
const long unsigned int | size () const |
Private Attributes | |
Array | _current |
std::stack< std::pair< unsigned, unsigned > > | _stack |
unsigned | _n |
A Dispatcher is a class that implements a simple dispatch algorithm. Suppose that there is n elements and M boxes. A dispatch is the assignment of the n elements in the m boxes. Basically, to use the dispatcher,
Definition at line 49 of file Dispatcher.hh.
using Diades::Utils::Dispatcher< Size >::Array = std::array<unsigned, Size> |
Definition at line 54 of file Dispatcher.hh.
|
inline |
Constructor
n | the number of elements to dispatch |
Definition at line 61 of file Dispatcher.hh.
|
inline |
Definition at line 137 of file Dispatcher.hh.
|
inline |
Definition at line 129 of file Dispatcher.hh.
|
inline |
Initialise the enumeration of the possible dispatches
Definition at line 68 of file Dispatcher.hh.
|
inline |
Definition at line 146 of file Dispatcher.hh.
|
inline |
Compute the next dispatch or the enumeration
Definition at line 84 of file Dispatcher.hh.
|
inline |
Definition at line 155 of file Dispatcher.hh.
|
private |
This array contains the current dispatch
Definition at line 166 of file Dispatcher.hh.
|
private |
Definition at line 180 of file Dispatcher.hh.
|
private |
This is the stack that is used to perform the enumeration of the dispatches An element of the stack is a pair
where k is the number of elements that is dispatched at this level and l is the number of remaining elements to dispatch in higher level of the stack. The size of the stack is in the worst case Size.
Definition at line 175 of file Dispatcher.hh.