aGrUM  0.14.2
PRMReferenceSlot_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 
28 namespace gum {
29  namespace prm {
30 
31  template < typename GUM_SCALAR >
33  const std::string& name,
35  bool isArray) :
36  PRMClassElement< GUM_SCALAR >(name),
37  __slotType(type), __isArray(isArray) {
38  GUM_CONSTRUCTOR(PRMReferenceSlot);
39  this->_safeName =
40  PRMObject::LEFT_CAST() + type.name() + PRMObject::RIGHT_CAST() + name;
41  }
42 
43  // Destructor.
44  template < typename GUM_SCALAR >
46  GUM_DESTRUCTOR(PRMReferenceSlot);
47  }
48 
49  template < typename GUM_SCALAR >
51  const PRMReferenceSlot< GUM_SCALAR >& source) :
52  PRMClassElement< GUM_SCALAR >(source),
53  __slotType(source.__slotType), __isArray(source.__isArray) {
54  GUM_CONS_CPY(PRMReferenceSlot);
56  "illegal call to gum::ReferenceSlot copy constructor.");
57  }
58 
59  // Copy operator. Raise a FatalError.
60  template < typename GUM_SCALAR >
63  GUM_ERROR(FatalError, "illegal call to gum::ReferenceSlot copy operator.");
64  }
65 
66  template < typename GUM_SCALAR >
69  return this->prm_refslot;
70  }
71 
72  template < typename GUM_SCALAR >
75  return __slotType;
76  }
77 
78  template < typename GUM_SCALAR >
81  return __slotType;
82  }
83 
84  template < typename GUM_SCALAR >
86  return __isArray;
87  }
88 
89  template < typename GUM_SCALAR >
91  GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.");
92  }
93 
94  template < typename GUM_SCALAR >
96  GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.");
97  }
98 
99  template < typename GUM_SCALAR >
101  GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.");
102  }
103 
104  template < typename GUM_SCALAR >
105  INLINE const Potential< GUM_SCALAR >&
107  GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.");
108  }
109 
110  template < typename GUM_SCALAR >
113  GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.");
114  }
115 
116 
117  template < typename GUM_SCALAR >
119  const PRMClassElement< GUM_SCALAR >& elt) {}
120 
121  template < typename GUM_SCALAR >
123  const PRMClassElement< GUM_SCALAR >& elt) {}
124 
125  } /* namespace prm */
126 } /* namespace gum */
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:57
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:32
Abstract class representing an element of PRM class.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
Definition: PRMObject.h:220
PRMReferenceSlot(const std::string &name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false)
Default constructor.
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:60
<agrum/PRM/classElementContainer.h>
PRMAttribute is a member of a Class in a PRM.
Definition: PRMAttribute.h:58
Headers of gum::PRMClassElement.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:52
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.