aGrUM 2.3.2
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-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#pragma once
41
42
50
51namespace gum {
52 namespace prm {
53
54 template < typename GUM_SCALAR >
62
63 // Destructor.
64 template < typename GUM_SCALAR >
68
69 template < typename GUM_SCALAR >
71 PRMClassElement< GUM_SCALAR >(source), _slotType_(source._slotType_),
72 _isArray_(source._isArray_) {
73 GUM_CONS_CPY(PRMReferenceSlot);
74 GUM_ERROR(FatalError, "illegal call to gum::ReferenceSlot copy constructor.")
75 }
76
77 // Copy operator. Raise a FatalError.
78 template < typename GUM_SCALAR >
81 GUM_ERROR(FatalError, "illegal call to gum::ReferenceSlot copy operator.")
82 }
83
84 template < typename GUM_SCALAR >
89
90 template < typename GUM_SCALAR >
95 template < typename GUM_SCALAR >
100
101 template < typename GUM_SCALAR >
103 return _isArray_;
104 }
105
106 template < typename GUM_SCALAR >
108 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
109 }
110
111 template < typename GUM_SCALAR >
113 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
114 }
115
116 template < typename GUM_SCALAR >
117 INLINE Tensor< GUM_SCALAR >& PRMReferenceSlot< GUM_SCALAR >::cpf() {
118 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
119 }
120
121 template < typename GUM_SCALAR >
122 INLINE const Tensor< GUM_SCALAR >& PRMReferenceSlot< GUM_SCALAR >::cpf() const {
123 GUM_ERROR(OperationNotAllowed, "This is a ReferenceSlot.")
124 }
125
126 template < typename GUM_SCALAR >
130
131 template < typename GUM_SCALAR >
134
135 template < typename GUM_SCALAR >
138
139 } /* namespace prm */
140} /* 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(const std::string &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 LEFT_CAST()
Enumeration of the different types of objects handled by a PRM.
Definition PRMObject.h:90
static std::string RIGHT_CAST()
Enumeration of the different types of objects handled by a PRM.
Definition PRMObject.h:92
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
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
#define GUM_ERROR(type, msg)
Definition exceptions.h:72
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46