aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
PRMReferenceSlot_tpl.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 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-2026 *
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#pragma once
42
43
51
52namespace gum {
53 namespace prm {
54
55 template < GUM_Numeric GUM_SCALAR >
64
65 // Destructor.
66 template < GUM_Numeric GUM_SCALAR >
70
71 template < GUM_Numeric GUM_SCALAR >
73 PRMClassElement< GUM_SCALAR >(source), _slotType_(source._slotType_),
74 _isArray_(source._isArray_) {
75 GUM_CONS_CPY(PRMReferenceSlot);
76 GUM_ERROR(FatalError, "illegal call to gum::ReferenceSlot copy constructor.")
77 }
78
79 // Copy operator. Raise a FatalError.
80 template < GUM_Numeric GUM_SCALAR >
83 GUM_ERROR(FatalError, "illegal call to gum::ReferenceSlot copy operator.")
84 }
85
86 template < GUM_Numeric GUM_SCALAR >
91
92 template < GUM_Numeric GUM_SCALAR >
96
97 template < GUM_Numeric GUM_SCALAR >
101
102 template < GUM_Numeric GUM_SCALAR >
104 return _isArray_;
105 }
106
107 template < GUM_Numeric GUM_SCALAR >
111
112 template < GUM_Numeric GUM_SCALAR >
114 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
115 }
116
117 template < GUM_Numeric GUM_SCALAR >
118 Tensor< GUM_SCALAR >& PRMReferenceSlot< GUM_SCALAR >::cpf() {
119 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
120 }
121
122 template < GUM_Numeric GUM_SCALAR >
123 const Tensor< GUM_SCALAR >& PRMReferenceSlot< GUM_SCALAR >::cpf() const {
124 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
125 }
126
127 template < GUM_Numeric GUM_SCALAR >
131
132 template < GUM_Numeric GUM_SCALAR >
134
135 template < GUM_Numeric GUM_SCALAR >
137
138 } /* namespace prm */
139} /* namespace gum */
Headers of gum::PRMClassElement.
Exception : fatal (unknown ?) error.
Exception : operation not allowed.
PRMAttribute is a member of a Class in a PRM.
<agrum/PRM/classElementContainer.h>
PRMClassElement(std::string_view name)
Default constructor of a PRMClassElement.
ClassElementType
Returns true if obj_ptr is of type PRMReferenceSlot.
std::string safeName_
The safe name of this PRMClassElement.
const std::string & name() const
Returns the name of this object.
static std::string RIGHT_CAST()
Enumeration of the different types of objects handled by a PRM.
static std::string LEFT_CAST()
Enumeration of the different types of objects handled by a PRM.
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
PRMReferenceSlot & operator=(const PRMReferenceSlot< GUM_SCALAR > &from)
Copy operator. Don't use it.
PRMAttribute< GUM_SCALAR > * getCastDescendant() const override
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant().
bool _isArray_
Flag indicating if this slot is an array.
virtual Tensor< GUM_SCALAR > & cpf()
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
PRMType & type() override
Raise an OperationNotAllowed. See gum::PRMClassElement::type().
PRMClassElement< GUM_SCALAR >::ClassElementType elt_type() const override
Implementation of the pure virtual method of PRMObject.
PRMClassElementContainer< GUM_SCALAR > & _slotType_
The type of this PRMReferenceSlot.
void addParent(const PRMClassElement< GUM_SCALAR > &elt) override
See gum::PRMClassElement::addParent().
bool isArray() const
Returns true if this reference slot is an array.
PRMClassElementContainer< GUM_SCALAR > & slotType()
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject).
PRMReferenceSlot(std::string_view name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false)
Default constructor.
void addChild(const PRMClassElement< GUM_SCALAR > &elt) override
See gum::PRMClassElement::addChild().
~PRMReferenceSlot() override
Destructor.
This is a decoration of the DiscreteVariable class.
Definition PRMType.h:78
#define GUM_ERROR(type, msg)
Definition exceptions.h:76
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46