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

#include <Variable.hh>

Public Types

typedef Diades::Utils::Exception< VariableFactoryException
 

Public Member Functions

 VariableFactory ()
 
 ~VariableFactory ()
 
void reset ()
 
void clear ()
 
bool operator== (const VariableFactory &factory) const
 
size_t numberOfAllocatedVariables () const
 
VariablenewVariable (const std::string &label)
 
VariablegetVariable (const std::string &label)
 
const VariablenullVariable () const
 
VariablenullVariable ()
 

Static Public Member Functions

static std::string typeName ()
 

Private Attributes

std::unordered_map< std::string, Variable::Pointer_dictionary
 
VariableVector _nullVariable
 

Detailed Description

Definition at line 407 of file Variable.hh.

Member Typedef Documentation

◆ Exception

Definition at line 412 of file Variable.hh.

Constructor & Destructor Documentation

◆ VariableFactory()

Diades::Sdmdl::VariableFactory::VariableFactory ( )
inline

Constructor

Definition at line 434 of file Variable.hh.

◆ ~VariableFactory()

Diades::Sdmdl::VariableFactory::~VariableFactory ( )
inline

Destructor

Definition at line 445 of file Variable.hh.

Member Function Documentation

◆ clear()

void Diades::Sdmdl::VariableFactory::clear ( )

Clear the factory

◆ getVariable()

Variable& Diades::Sdmdl::VariableFactory::getVariable ( const std::string &  label)
Parameters
labelthe label of the Variable to look for
Returns
the value with the given label if it exists, the null value otherwise

◆ newVariable()

Variable& Diades::Sdmdl::VariableFactory::newVariable ( const std::string &  label)
Parameters
labelthe label of the Variable to create
Returns
the value with the given label (don't create doublons)

Referenced by Diades::Sdmdl::Experimental::EventEncoder::encodeEventRange(), and Diades::Sdmdl::Experimental::StateInfoEncoder::encodeStateInfoRange().

◆ nullVariable() [1/2]

const Variable& Diades::Sdmdl::VariableFactory::nullVariable ( ) const
inline
Returns
the null Variable

Definition at line 510 of file Variable.hh.

◆ nullVariable() [2/2]

Variable& Diades::Sdmdl::VariableFactory::nullVariable ( )
inline
Returns
the null Variable

Definition at line 522 of file Variable.hh.

◆ numberOfAllocatedVariables()

size_t Diades::Sdmdl::VariableFactory::numberOfAllocatedVariables ( ) const
inline
Returns
the number of allocated variables in th current factory

Definition at line 481 of file Variable.hh.

Referenced by Diades::Sdmdl::Experimental::EventEncoder::encodeEventRange(), and Diades::Sdmdl::Experimental::StateInfoEncoder::encodeStateInfoRange().

◆ operator==()

bool Diades::Sdmdl::VariableFactory::operator== ( const VariableFactory factory) const
inline

Equality operator

Parameters
factorya VariableFactory
Returns
true if they both the same factory (reference equality)

Definition at line 472 of file Variable.hh.

◆ reset()

void Diades::Sdmdl::VariableFactory::reset ( )

Reset the VariableFactory

◆ typeName()

static std::string Diades::Sdmdl::VariableFactory::typeName ( )
inlinestatic

Definition at line 411 of file Variable.hh.

Member Data Documentation

◆ _dictionary

std::unordered_map<std::string,Variable::Pointer> Diades::Sdmdl::VariableFactory::_dictionary
private

_dictionary the diactionary of the created Variable objects

Definition at line 419 of file Variable.hh.

◆ _nullVariable

VariableVector Diades::Sdmdl::VariableFactory::_nullVariable
private

_nullVariable the null Variable of this factory

Definition at line 424 of file Variable.hh.


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