aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::Variable Class Referenceabstract

Base class for every random variable. More...

#include <variable.h>

+ Inheritance diagram for gum::Variable:

Public Member Functions

Constructors / Destructors
virtual ~Variable ()
 destructor More...
 
virtual Variableclone () const =0
 Copy Factory. More...
 
Operators
Variableoperator= (const Variable &aRV)
 Copy operator. More...
 
virtual bool operator== (const Variable &aRV) const
 equality operator More...
 
virtual bool operator!= (const Variable &aRV) const
 inequality operator More...
 
Accessors / Modifiers
void setName (const std::string &theValue)
 sets the name of the variable More...
 
const std::string & name () const
 returns the name of the variable More...
 
void setDescription (const std::string &theValue) const
 sets the description of the variable More...
 
const std::string & description () const
 returns the description of the variable More...
 
virtual VarType varType () const =0
 returns the type of variable More...
 
virtual const std::string domain () const =0
 string represent the domain of the variable More...
 

Protected Member Functions

 Variable ()
 (protected) Default constructor More...
 
void copy_ (const Variable &aRV)
 protected copy More...
 
 Variable (const std::string &aName, const std::string &aDesc)
 constructor More...
 
 Variable (const Variable &aRV)
 copy constructor More...
 

Detailed Description

Base class for every random variable.

Definition at line 71 of file variable.h.

Constructor & Destructor Documentation

◆ ~Variable()

virtual gum::Variable::~Variable ( )
virtual

destructor

◆ Variable() [1/3]

gum::Variable::Variable ( )
inlineprotected

(protected) Default constructor

Definition at line 145 of file variable.h.

145  {
146  GUM_CONSTRUCTOR(Variable);
147  ;
148  }
Variable()
(protected) Default constructor
Definition: variable.h:145

◆ Variable() [2/3]

gum::Variable::Variable ( const std::string &  aName,
const std::string &  aDesc 
)
protected

constructor

Parameters
aNamename of the variable
aDescdescription of the variable

◆ Variable() [3/3]

gum::Variable::Variable ( const Variable aRV)
protected

copy constructor

Parameters
aRVthe variable we copy

Member Function Documentation

◆ clone()

virtual Variable* gum::Variable::clone ( ) const
pure virtual

◆ copy_()

void gum::Variable::copy_ ( const Variable aRV)
protected

protected copy

Parameters
aRVto be copied

◆ description()

const std::string& gum::Variable::description ( ) const

returns the description of the variable

◆ domain()

virtual const std::string gum::Variable::domain ( ) const
pure virtual

◆ name()

const std::string& gum::Variable::name ( ) const

returns the name of the variable

◆ operator!=()

virtual bool gum::Variable::operator!= ( const Variable aRV) const
virtual

inequality operator

◆ operator=()

Variable& gum::Variable::operator= ( const Variable aRV)

Copy operator.

Parameters
aRVto be copied
Returns
a const ref to *this

◆ operator==()

virtual bool gum::Variable::operator== ( const Variable aRV) const
virtual

equality operator

◆ setDescription()

void gum::Variable::setDescription ( const std::string &  theValue) const

sets the description of the variable

Warning
since description is mutable, setDescription() is const
Parameters
theValue

◆ setName()

void gum::Variable::setName ( const std::string &  theValue)

sets the name of the variable

Parameters
theValue

◆ varType()

virtual VarType gum::Variable::varType ( ) const
pure virtual

Member Data Documentation

◆ _description_

std::string gum::Variable::_description_
mutableprivate

the description of the variable since description is not a characteristic of a variable, we allow the description to be changed even in a const reference.

Definition at line 173 of file variable.h.

◆ _name_

std::string gum::Variable::_name_
private

the name of the variable

Definition at line 168 of file variable.h.


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