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

#include <Value.hh>

Public Types

typedef Diades::Utils::Exception< ValueException
 
typedef std::reference_wrapper< Value const > ConstReference
 
typedef std::reference_wrapper< ValueReference
 
typedef std::vector< ConstReferenceValueVector
 
typedef ValuePointer
 

Public Member Functions

 ~Value ()
 
bool isNull () const
 
unsigned id () const
 
const std::string & label () const
 
bool operator== (const Value &val) const
 
bool operator!= (const Value &val) const
 
bool operator< (const Value &val) const
 
const ValueFactoryowner () const
 

Static Public Member Functions

static std::string typeName ()
 

Private Member Functions

 Value (ValueFactory &owner)
 
 Value (const std::string &label, unsigned id, ValueFactory &owner)
 

Private Attributes

unsigned _id
 
ValueFactory_owner
 
std::string _label
 

Friends

class ValueFactory
 
ostream & operator<< (ostream &os, const Value &val)
 

Detailed Description

A Value is an object that can be assigned to a Variable. A Value is created and is owned by a ValueFactory

Definition at line 25 of file Value.hh.

Member Typedef Documentation

◆ ConstReference

typedef std::reference_wrapper<Value const> Diades::Sdmdl::Value::ConstReference

Definition at line 32 of file Value.hh.

◆ Exception

Definition at line 29 of file Value.hh.

◆ Pointer

Definition at line 35 of file Value.hh.

◆ Reference

typedef std::reference_wrapper<Value> Diades::Sdmdl::Value::Reference

Definition at line 33 of file Value.hh.

◆ ValueVector

Definition at line 34 of file Value.hh.

Constructor & Destructor Documentation

◆ Value() [1/2]

Diades::Sdmdl::Value::Value ( ValueFactory owner)
inlineprivate

Create a null value

Parameters
ownerthe ValueFactory that creates the Null Value

Definition at line 65 of file Value.hh.

◆ Value() [2/2]

Diades::Sdmdl::Value::Value ( const std::string &  label,
unsigned  id,
ValueFactory owner 
)
inlineprivate

Creation of a new Value

Parameters
labelthe label (content) of th Value
idthe id of the Value
ownerthe ValueFactory that creates this Value

Definition at line 76 of file Value.hh.

◆ ~Value()

Diades::Sdmdl::Value::~Value ( )
inline

Destructor

Definition at line 86 of file Value.hh.

References isNull().

Member Function Documentation

◆ id()

unsigned Diades::Sdmdl::Value::id ( ) const
inline
Returns
the id of the Value

Definition at line 102 of file Value.hh.

References _id.

◆ isNull()

bool Diades::Sdmdl::Value::isNull ( ) const

◆ label()

const std::string& Diades::Sdmdl::Value::label ( ) const
inline

◆ operator!=()

bool Diades::Sdmdl::Value::operator!= ( const Value val) const
inline
Parameters
valValue to compare
Returns
true if both Value are not equal (reference equality)

Definition at line 138 of file Value.hh.

◆ operator<()

bool Diades::Sdmdl::Value::operator< ( const Value val) const
inline

Comparison operator

Parameters
valValue to compare
Returns
true if the current Value is lower than val (std::string <)
Precondition
both Value must have be owned by the same ValueFactory

Definition at line 149 of file Value.hh.

References _owner, label(), and require.

◆ operator==()

bool Diades::Sdmdl::Value::operator== ( const Value val) const
inline
Parameters
valValue to compare
Returns
true if both Value are equal (reference equality)

Definition at line 127 of file Value.hh.

◆ owner()

const ValueFactory& Diades::Sdmdl::Value::owner ( ) const
inline
Returns
the owner of this Value

Definition at line 162 of file Value.hh.

References _owner, and operator<<.

Referenced by Diades::Sdmdl::FormulaFactory::nullValue().

◆ typeName()

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

Definition at line 28 of file Value.hh.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Value val 
)
friend

The output stream

Parameters
osthe output stream
valthe Value to print out
Returns
the output stream

Referenced by owner().

◆ ValueFactory

friend class ValueFactory
friend

Definition at line 180 of file Value.hh.

Member Data Documentation

◆ _id

unsigned Diades::Sdmdl::Value::_id
private

_id the ID of the value created by the associated ValueFactory.

Definition at line 43 of file Value.hh.

Referenced by id().

◆ _label

std::string Diades::Sdmdl::Value::_label
private

_label the content of the Value

Definition at line 56 of file Value.hh.

Referenced by label().

◆ _owner

ValueFactory& Diades::Sdmdl::Value::_owner
private

_owner the ValueFactory that created and owns the Value.

Definition at line 49 of file Value.hh.

Referenced by operator<(), and owner().


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