DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Diades::Sdmdl::Experimental::EventEncoder Class Reference

#include <EventEncoder.hh>

Public Types

using VariableEncoderId = VariableVector::size_type
 
using Event = size_t
 

Public Member Functions

 EventEncoder (VariableFactory &varFactory)
 
template<typename EventIterator >
VariableEncoderId encodeEventRange (EventIterator first, EventIterator last)
 
VariablegetVariable (VariableEncoderId id)
 
std::vector< Event > & getDomain (VariableEncoderId id)
 

Private Member Functions

const ValueencodeEventInVariable (VariableEncoderId varId, Event evt)
 

Private Attributes

VariableFactory_variables
 
VariableVector _encodedVariables
 
std::vector< std::vector< Event > > _domains
 

Detailed Description

This class encodes ranges of Event as a Variable with a domain that encode the given range It might encode several range. For each range a new Variable is created. To access a Variable and its non-encoded domain (set of Event) the encoder provides an Id.

Definition at line 33 of file EventEncoder.hh.

Member Typedef Documentation

◆ Event

Parameters
Eventa classical Event represented as a size_t
See also
EventManager

Definition at line 45 of file EventEncoder.hh.

◆ VariableEncoderId

Definition at line 40 of file EventEncoder.hh.

Constructor & Destructor Documentation

◆ EventEncoder()

Diades::Sdmdl::Experimental::EventEncoder::EventEncoder ( VariableFactory varFactory)
inline

Constructor

Parameters
varFactorythe permanent reference to a VariableFactory

Definition at line 75 of file EventEncoder.hh.

Member Function Documentation

◆ encodeEventInVariable()

const Value& Diades::Sdmdl::Experimental::EventEncoder::encodeEventInVariable ( VariableEncoderId  varId,
Event  evt 
)
inlineprivate

Encode an event into predefined variable

Parameters
varthe Variable that is already created by the encode
evta new Event to encode in the domain of the variable
Returns
the encoded Value corresponding to the Event

Definition at line 88 of file EventEncoder.hh.

Referenced by encodeEventRange().

◆ encodeEventRange()

template<typename EventIterator >
VariableEncoderId Diades::Sdmdl::Experimental::EventEncoder::encodeEventRange ( EventIterator  first,
EventIterator  last 
)
inline

Encode a range of Events. Creation of a new Variable for this range

Parameters
firstFirst Event of the range
lastSecond Event of the range
Returns
the index of the new Variable

Definition at line 107 of file EventEncoder.hh.

References encodeEventInVariable(), Diades::Sdmdl::VariableFactory::newVariable(), and Diades::Sdmdl::VariableFactory::numberOfAllocatedVariables().

Referenced by runGlobalDiagnosisProblem().

◆ getDomain()

std::vector<Event>& Diades::Sdmdl::Experimental::EventEncoder::getDomain ( VariableEncoderId  id)
inline
Parameters
ida Variable Id given by the EventEncoder
Returns
the domain (set of Event) associated with the Variable of the given id

Definition at line 143 of file EventEncoder.hh.

◆ getVariable()

Variable& Diades::Sdmdl::Experimental::EventEncoder::getVariable ( VariableEncoderId  id)
inline
Parameters
ida Variable Id given by the EventEncoder
Returns
the Variable associated with the id

Definition at line 133 of file EventEncoder.hh.

Referenced by runGlobalDiagnosisProblem().

Member Data Documentation

◆ _domains

std::vector<std::vector<Event> > Diades::Sdmdl::Experimental::EventEncoder::_domains
private

Definition at line 67 of file EventEncoder.hh.

◆ _encodedVariables

VariableVector Diades::Sdmdl::Experimental::EventEncoder::_encodedVariables
private

Definition at line 60 of file EventEncoder.hh.

◆ _variables

VariableFactory& Diades::Sdmdl::Experimental::EventEncoder::_variables
private

Definition at line 54 of file EventEncoder.hh.


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