aGrUM  0.14.2
PRMParameter_tpl.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 namespace gum {
28  namespace prm {
29 
30  template < typename GUM_SCALAR >
32  ParameterType type,
33  GUM_SCALAR value) :
34  PRMClassElement< GUM_SCALAR >(name),
35  __type(type), __value(value) {
36  GUM_CONSTRUCTOR(PRMParameter);
37  this->_safeName = name;
38  }
39 
40  template < typename GUM_SCALAR >
42  const PRMParameter< GUM_SCALAR >& source) :
43  PRMClassElement< GUM_SCALAR >(source.name()),
44  __type(source.valueType()), __value(source.value()) {
45  GUM_ERROR(OperationNotAllowed, "cannot copy Paramter<GUM_SCALAR");
46  }
47 
48  template < typename GUM_SCALAR >
51  GUM_ERROR(OperationNotAllowed, "cannot copy Paramter<GUM_SCALAR");
52  }
53 
54  template < typename GUM_SCALAR >
56  GUM_DESTRUCTOR(PRMParameter);
57  }
58 
59  template < typename GUM_SCALAR >
63  }
64 
65  template < typename GUM_SCALAR >
66  GUM_SCALAR PRMParameter< GUM_SCALAR >::value() const {
67  return __value;
68  }
69 
70  template < typename GUM_SCALAR >
71  void PRMParameter< GUM_SCALAR >::value(GUM_SCALAR value) {
72  __value = value;
73  }
74 
75  template < typename GUM_SCALAR >
78  return __type;
79  }
80 
81  template < typename GUM_SCALAR >
83  GUM_ERROR(OperationNotAllowed, "Parameters do not have a type");
84  }
85 
86  template < typename GUM_SCALAR >
88  GUM_ERROR(OperationNotAllowed, "Parameters do not have a type");
89  }
90 
91  template < typename GUM_SCALAR >
93  GUM_ERROR(OperationNotAllowed, "Parameters do not have a cpf");
94  }
95 
96  template < typename GUM_SCALAR >
98  GUM_ERROR(OperationNotAllowed, "Parameters do not have a cpf");
99  }
100 
101  template < typename GUM_SCALAR >
104  GUM_ERROR(OperationNotAllowed, "Parameters can not have parents");
105  }
106 
107  template < typename GUM_SCALAR >
110  GUM_ERROR(OperationNotAllowed, "Parameters can not have children");
111  }
112 
113  template < typename GUM_SCALAR >
116  GUM_ERROR(OperationNotAllowed, "Parameters can have cast descendants");
117  }
118 
119  } /* namespace prm */
120 } // namespace gum
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
Abstract class representing an element of PRM class.
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.
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:60
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:58
#define GUM_ERROR(type, msg)
Definition: exceptions.h:52
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.