aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
PRMReferenceSlot.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2025 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2025 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41
48
49#ifndef GUM_REFERENCE_SLOT_H
50#define GUM_REFERENCE_SLOT_H
51
54
55namespace gum {
56 namespace prm {
57
78 // ==========================================================================
79 template < typename GUM_SCALAR >
80 class PRMReferenceSlot: public PRMClassElement< GUM_SCALAR > {
81 public:
82 // ========================================================================
84 // ========================================================================
86
94 PRMReferenceSlot(const std::string& name,
96 bool isArray = false);
97
101 virtual ~PRMReferenceSlot();
102
104 // ========================================================================
106 // ========================================================================
108
113
119
125
129 bool isArray() const;
130
132 virtual void addParent(const PRMClassElement< GUM_SCALAR >& elt);
133
135 virtual void addChild(const PRMClassElement< GUM_SCALAR >& elt);
136
138 // ========================================================================
140 // ========================================================================
142
145 virtual PRMType& type();
146
149 virtual const PRMType& type() const;
150
153 virtual Tensor< GUM_SCALAR >& cpf();
154
157 virtual const Tensor< GUM_SCALAR >& cpf() const;
158
162
164
165 private:
166 // ========================================================================
168 // ========================================================================
169 // @{
170
173
176
178 // ========================================================================
180 // ========================================================================
181 // @{
182
185
188
190 };
191
192
193#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
194 extern template class PRMReferenceSlot< double >;
195#endif
196
197
198 } /* namespace prm */
199} // namespace gum
200
202
203#endif /* GUM_CLASS_ELEMENT_H */
Headers of gum::prm::PRMClassElementContainer.
Headers of gum::PRMClassElement.
Inline implementation of gum::PRMReferenceSlot.
PRMAttribute is a member of a Class in a PRM.
<agrum/PRM/classElementContainer.h>
PRMClassElement(const std::string &name)
Default constructor of a PRMClassElement.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
const std::string & name() const
Returns the name of this object.
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject).
PRMReferenceSlot & operator=(const PRMReferenceSlot< GUM_SCALAR > &from)
Copy operator. Don't use it.
PRMReferenceSlot(const std::string &name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false)
Default constructor.
bool _isArray_
Flag indicating if this slot is an array.
virtual void addChild(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::addChild().
PRMClassElementContainer< GUM_SCALAR > & _slotType_
The type of this PRMReferenceSlot.
virtual void addParent(const PRMClassElement< GUM_SCALAR > &elt)
See gum::PRMClassElement::addParent().
virtual ~PRMReferenceSlot()
Destructor.
virtual PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const
Implementation of the pure virtual method of PRMObject.
bool isArray() const
Returns true if this reference slot is an array.
virtual PRMAttribute< GUM_SCALAR > * getCastDescendant() const
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant().
virtual Tensor< GUM_SCALAR > & cpf()
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
virtual PRMType & type()
Raise an OperationNotAllowed. See gum::PRMClassElement::type().
This is a decoration of the DiscreteVariable class.
Definition PRMType.h:78
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46