DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Attributes | List of all members
Diades::Utils::IncrementGenerator< IncrementableType > Class Template Reference

#include <IdGenerators.hh>

Public Types

using IdGen = IdGenerator< IncrementableType >
 

Public Member Functions

 IncrementGenerator ()=default
 
 IncrementGenerator (IncrementGenerator const &other)=default
 
IncrementGeneratoroperator= (IncrementGenerator const &other)=default
 
 IncrementGenerator (IncrementGenerator &&other)=default
 
IncrementGeneratoroperator= (IncrementGenerator &&other)=default
 
virtual ~IncrementGenerator ()=default
 
 IncrementGenerator (IncrementableType initialValue)
 
virtual void init ()
 
virtual IncrementableType another ()
 

Private Attributes

IncrementableType _initial
 
IncrementableType _current
 

Detailed Description

template<typename IncrementableType>
class Diades::Utils::IncrementGenerator< IncrementableType >

Generator identifiers by simply incrementing the last generated one (IncrementableType requires the postfix ++ operator)

Definition at line 140 of file IdGenerators.hh.

Member Typedef Documentation

◆ IdGen

template<typename IncrementableType>
using Diades::Utils::IncrementGenerator< IncrementableType >::IdGen = IdGenerator<IncrementableType>

Definition at line 145 of file IdGenerators.hh.

Constructor & Destructor Documentation

◆ IncrementGenerator() [1/4]

template<typename IncrementableType>
Diades::Utils::IncrementGenerator< IncrementableType >::IncrementGenerator ( )
default

Default constructor

◆ IncrementGenerator() [2/4]

template<typename IncrementableType>
Diades::Utils::IncrementGenerator< IncrementableType >::IncrementGenerator ( IncrementGenerator< IncrementableType > const &  other)
default

Copy constructor (default)

Parameters
other

◆ IncrementGenerator() [3/4]

template<typename IncrementableType>
Diades::Utils::IncrementGenerator< IncrementableType >::IncrementGenerator ( IncrementGenerator< IncrementableType > &&  other)
default

Move constructor (default)

Parameters
other

◆ ~IncrementGenerator()

template<typename IncrementableType>
virtual Diades::Utils::IncrementGenerator< IncrementableType >::~IncrementGenerator ( )
virtualdefault

Destructor

◆ IncrementGenerator() [4/4]

template<typename IncrementableType>
Diades::Utils::IncrementGenerator< IncrementableType >::IncrementGenerator ( IncrementableType  initialValue)
inline

Parametrised constructor

Parameters
initialValuethe initial value By using init() the first generated identifier will be 'initialValue'

Definition at line 193 of file IdGenerators.hh.

Member Function Documentation

◆ another()

template<typename IncrementableType>
virtual IncrementableType Diades::Utils::IncrementGenerator< IncrementableType >::another ( )
inlinevirtual
Returns
another generated identifier If the previous identifier was 'N' then it generates 'N+1'

Implements Diades::Utils::IdGenerator< IncrementableType >.

Definition at line 213 of file IdGenerators.hh.

◆ init()

template<typename IncrementableType>
virtual void Diades::Utils::IncrementGenerator< IncrementableType >::init ( )
inlinevirtual

Reinitialise the generator

Returns
the first generated identifier

Implements Diades::Utils::IdGenerator< IncrementableType >.

Definition at line 202 of file IdGenerators.hh.

◆ operator=() [1/2]

template<typename IncrementableType>
IncrementGenerator& Diades::Utils::IncrementGenerator< IncrementableType >::operator= ( IncrementGenerator< IncrementableType > const &  other)
default

Assignement (default)

Parameters
other
Returns
the current IncrementGenerator

◆ operator=() [2/2]

template<typename IncrementableType>
IncrementGenerator& Diades::Utils::IncrementGenerator< IncrementableType >::operator= ( IncrementGenerator< IncrementableType > &&  other)
default

Move assignement (default)

Parameters
other
Returns
the current IncrementGenerator

Member Data Documentation

◆ _current

template<typename IncrementableType>
IncrementableType Diades::Utils::IncrementGenerator< IncrementableType >::_current
private

Definition at line 149 of file IdGenerators.hh.

◆ _initial

template<typename IncrementableType>
IncrementableType Diades::Utils::IncrementGenerator< IncrementableType >::_initial
private

Definition at line 148 of file IdGenerators.hh.


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