Synthia
Generic and flexible data structure generator
ca.uqac.lif.synthia.util.Share< T > Class Template Reference

Detailed Description

Allows values of a single picker to be shared among multiple copies of a picker instance.

Parameters
<T>The type of the elements to pick

Definition at line 36 of file Share.java.

Classes

class  QueuePicker
 A picker that acts as a proxy for the values obtained by the parent Share picker. More...
 

Public Member Functions

 Share (Picker<? extends T > picker)
 Creates a new instance of the share picker. More...
 
QueuePicker getCopy ()
 Creates a new copy of QueuePicker from the original picker. More...
 
void reset ()
 Resets the original picker and all its copies. More...
 

Protected Member Functions

void ask ()
 Asks for a new value from the underlying picker, and adds this value to the internal queue of each linked instance of QueuePicker. More...
 

Protected Attributes

Picker<? extends T > m_picker
 The underlying picker from which elements are taken. More...
 
Set< QueuePickerm_pickers
 The set of "spawned" copies created. More...
 

Constructor & Destructor Documentation

◆ Share()

ca.uqac.lif.synthia.util.Share< T >.Share ( Picker<? extends T >  picker)

Creates a new instance of the share picker.

Parameters
pickerThe underlying picker from which elements are taken

Definition at line 52 of file Share.java.

Member Function Documentation

◆ ask()

void ca.uqac.lif.synthia.util.Share< T >.ask ( )
protected

Asks for a new value from the underlying picker, and adds this value to the internal queue of each linked instance of QueuePicker.

Definition at line 86 of file Share.java.

◆ getCopy()

Creates a new copy of QueuePicker from the original picker.

Returns
A new copy

Definition at line 63 of file Share.java.

◆ reset()

void ca.uqac.lif.synthia.util.Share< T >.reset ( )

Resets the original picker and all its copies.

Definition at line 73 of file Share.java.

Member Data Documentation

◆ m_picker

Picker<? extends T> ca.uqac.lif.synthia.util.Share< T >.m_picker
protected

The underlying picker from which elements are taken.

Definition at line 41 of file Share.java.

◆ m_pickers

Set<QueuePicker> ca.uqac.lif.synthia.util.Share< T >.m_pickers
protected

The set of "spawned" copies created.

Definition at line 46 of file Share.java.


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