aGrUM  0.14.2
PRMParameter.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_PARAMETER_H
28 #define GUM_PARAMETER_H
29 
31 
35 
36 
37 namespace gum {
38  namespace prm {
39 
48  template < typename GUM_SCALAR >
49  class PRMParameter : public PRMClassElement< GUM_SCALAR > {
50  public:
51  enum ParameterType { INT, REAL };
52 
53  // ========================================================================
55  // ========================================================================
57 
65  PRMParameter(const std::string& name, ParameterType type, GUM_SCALAR value);
66 
68  virtual ~PRMParameter();
69 
71  // ========================================================================
73  // ========================================================================
75 
78  elt_type() const;
79 
80  GUM_SCALAR value() const;
81 
82  void value(GUM_SCALAR value);
83 
84  ParameterType valueType() const;
85 
87  virtual PRMType& type();
88 
90  virtual const PRMType& type() const;
91 
93  virtual Potential< GUM_SCALAR >& cpf();
94 
96  virtual const Potential< GUM_SCALAR >& cpf() const;
97 
100 
103 
107 
109  protected:
112 
116 
117  private:
118  // ========================================================================
120  // ========================================================================
122 
124 
125  GUM_SCALAR __value;
126 
128  };
129 
130 
131 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
132  extern template class PRMParameter< double >;
133 #endif
134 
135 
136  } /* namespace prm */
137 } // namespace gum
138 
140 
141 #endif /* GUM_PARAMETER_H */
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:57
PRMParameter is a member of a Class in a PRM.
Definition: PRMParameter.h:49
virtual Potential< GUM_SCALAR > & cpf()
See gum::PRMClassElement::cpf().
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:32
virtual ~PRMParameter()
Destructor.
PRMParameter< GUM_SCALAR > & operator=(const PRMParameter< GUM_SCALAR > &from)
Copy operator. Don&#39;t use it.
GUM_SCALAR value() const
See gum::PRMClassElement::elt_type().
Abstract class representing an element of PRM class.
void addParent(const gum::prm::PRMClassElement< GUM_SCALAR > &)
See gum::PRMClassElement::addParent().
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
PRMParameter(const std::string &name, ParameterType type, GUM_SCALAR value)
Constructor used by gum::Class.
Header of the Potential class.
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:60
Headers of Class.
Headers of gum::PRMClassElement.
Headers of gum::PRMAttribute.
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
Raise a gum::OperationNotAllowed See gum::PRMClassElement::getCastDescendant()
virtual PRMType & type()
See gum::PRMClassElement::type().
ParameterType __type
Definition: PRMParameter.h:123
Implementation of gum::PRMParameter.
ParameterType valueType() const
See gum::PRMClassElement::elt_type().
void addChild(const gum::prm::PRMClassElement< GUM_SCALAR > &)
See gum::PRMClassElement::addChild().
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:58
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
See gum::PRMClassElement::elt_type().
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.