DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Attributes | List of all members
Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator > Class Template Reference

#include <StateInserter.hh>

Public Types

using StateId = typename Fsm::StatePropertyId
 
using IdGen = _IdGenerator
 

Public Member Functions

 StateIdGenerator (const Fsm &target, IdGen &generator, bool rename)
 
StateId generate (StateId sourceStateId)
 

Private Attributes

Diades::Utils::Ptr< Fsm >::ConstP _target
 
Diades::Utils::Ptr< IdGen >::P _generator
 
bool _rename
 

Detailed Description

template<typename Fsm, typename _IdGenerator>
class Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >

This class is a template class that is used to generate stateId's that are not present in a target Fsm. The generation of the StateId is done by an _IdGenerator which is typically a class deriving from the Diades::Utils::IdGenerator (like PrefixedCounterIdGenerator, IncrementGenerator, ...)

See also
Diades::Utils::IdGenerator

A StateIdGenerator has two functioning mode. The first one is the 'rename' mode. It generates a new StateId after each call of generate that is independent from the given source state Id. If 'rename' mode is set to false, then the generator might return the given source state Id unless it was already in use in the target Fsm.

Definition at line 39 of file StateInserter.hh.

Member Typedef Documentation

◆ IdGen

template<typename Fsm , typename _IdGenerator >
using Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::IdGen = _IdGenerator

Definition at line 50 of file StateInserter.hh.

◆ StateId

template<typename Fsm , typename _IdGenerator >
using Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::StateId = typename Fsm::StatePropertyId

Definition at line 45 of file StateInserter.hh.

Constructor & Destructor Documentation

◆ StateIdGenerator()

template<typename Fsm , typename _IdGenerator >
Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::StateIdGenerator ( const Fsm &  target,
IdGen generator,
bool  rename 
)
inline
Parameters
targetthe Target Fsm
generatorthe generator that will be used to generate State Id's
renamethe functioning mode. If rename is set to true, the generated StateId's are simply generated independently from the given source Id. If rename is set to false and the sourceId given to 'generate' is not already in the target Fsm then this id is returned as a new id for the target Fsm.

Definition at line 83 of file StateInserter.hh.

Member Function Documentation

◆ generate()

template<typename Fsm , typename _IdGenerator >
_generator the IdGenerator that will be used to Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::generate ( StateId  sourceStateId)
inline
Parameters
sourceStateIda stateid coming from another Fsm
Returns
either the same sourceStateId if it is not already present in the target Fsm. If it is present, then generate an id that ensures it is not present in the target fsm. If rename was set, a new id is returned independently whether the sourceStateId is present or not.

the new StateId' to include in the target Fsm

Definition at line 99 of file StateInserter.hh.

Member Data Documentation

◆ _generator

template<typename Fsm , typename _IdGenerator >
Diades::Utils::Ptr<IdGen>::P Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::_generator
private

Definition at line 61 of file StateInserter.hh.

◆ _rename

template<typename Fsm , typename _IdGenerator >
Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::_rename
private

The functioning mode, if rename is set to true, the generated StateId's are simply generated independently from the given source Id. If rename is set to false and the sourceId given to 'generate' is not already in the target Fsm then this id is returned as a new id for the target Fsm.

Definition at line 70 of file StateInserter.hh.

◆ _target

template<typename Fsm , typename _IdGenerator >
Diades::Utils::Ptr<Fsm>::ConstP Diades::Automata::Experimental::StateIdGenerator< Fsm, _IdGenerator >::_target
private

Definition at line 56 of file StateInserter.hh.


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