aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
IScheduleMultiDim_inl.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
48
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
50
51# include <sstream>
52# include <string>
53
54# include <agrum/agrum.h>
55
57
58namespace gum {
59
61 INLINE Idx IScheduleMultiDim::_newId_() { return ++_multidim_id_; }
62
65
68 id_(id == Idx(0) ? IScheduleMultiDim::_newId_() : id) {
69 // make sure that we won't get several IScheduleMultiDim with the same Id
70 if (id_ > _multidim_id_) _multidim_id_ = id_;
71
72 // for debugging purposes
73 GUM_CONSTRUCTOR(IScheduleMultiDim);
74 }
75
77 INLINE IScheduleMultiDim::IScheduleMultiDim(const IScheduleMultiDim& from) : id_(from.id_) {
78 // for debugging purposes
79 GUM_CONS_CPY(IScheduleMultiDim);
80 }
81
83 INLINE IScheduleMultiDim::IScheduleMultiDim(IScheduleMultiDim&& from) : id_(from.id_) {
84 // for debugging purposes
85 GUM_CONS_MOV(IScheduleMultiDim);
86 }
87
89 INLINE IScheduleMultiDim::~IScheduleMultiDim() {
90 // for debugging purposes
91 GUM_DESTRUCTOR(IScheduleMultiDim);
92 }
93
95 INLINE IScheduleMultiDim& IScheduleMultiDim::operator=(const IScheduleMultiDim& from) {
96 id_ = from.id_;
97 return *this;
98 }
99
101 INLINE IScheduleMultiDim& IScheduleMultiDim::operator=(IScheduleMultiDim&& from) {
102 id_ = from.id_;
103 return *this;
104 }
105
107 INLINE bool IScheduleMultiDim::operator==(const IScheduleMultiDim& m) const {
108 return id_ == m.id_;
109 }
110
112 INLINE bool IScheduleMultiDim::operator!=(const IScheduleMultiDim& m) const {
113 return id_ != m.id_;
114 }
115
117 INLINE Idx IScheduleMultiDim::id() const { return id_; }
118
119} /* namespace gum */
120
121#endif /* DOXYGEN_SHOULD_SKIP_THIS */
The Table-agnostic base class of scheduleMultiDim.
The Table-agnostic base class of scheduleMultiDim.
static Idx _newId_()
returns a new distinct ID for each abstract scheduleMultiDim
IScheduleMultiDim(const Idx id=0)
constructs a IScheduleMultiDim
static std::atomic< Idx > _multidim_id_
static void resetIdGenerator()
reset the id generator to 0
Size Idx
Type for indexes.
Definition types.h:79
gum is the global namespace for all aGrUM entities
Definition agrum.h:46