aGrUM  0.14.2
multiDimAdressable.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
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  ***************************************************************************/
31 #ifndef GUM_MULTIDIM_ADRESSABLE_H
32 #define GUM_MULTIDIM_ADRESSABLE_H
33 
34 #include <iostream>
35 #include <vector>
36 
37 #include <agrum/agrum.h>
38 
40 
41 namespace gum {
42  // =========================================================================
43  // === GUM_MULTI_DIM_ADRESSABLE ===
44  // =========================================================================
57  public:
58  // =======================================================================
60  // =======================================================================
62 
67 
73 
79 
80 
84  ~MultiDimAdressable() override;
85 
87  // =======================================================================
89  // =======================================================================
91 
96  virtual MultiDimAdressable& getMasterRef() = 0;
97 
103  virtual const MultiDimAdressable& getMasterRef() const = 0;
104 
110  virtual bool registerSlave(Instantiation& i) = 0;
111 
117  virtual bool unregisterSlave(Instantiation& i) = 0;
118 
126  virtual void changeNotification(const Instantiation& i,
127  const DiscreteVariable* const var,
128  Idx oldval,
129  Idx newval) = 0;
130 
135  virtual void setFirstNotification(const Instantiation& i) = 0;
136 
141  virtual void setLastNotification(const Instantiation& i) = 0;
142 
147  virtual void setIncNotification(const Instantiation& i) = 0;
148 
153  virtual void setDecNotification(const Instantiation& i) = 0;
154 
159  virtual void setChangeNotification(const Instantiation& i) = 0;
160 
166  virtual const std::string toString(const Instantiation* i) const = 0;
167 
169  };
170 
171 } /* namespace gum */
172 
173 #ifndef GUM_NO_INLINE
175 #endif /* GUM_NO_INLINE */
176 
177 #endif /* GUM_MULTIDIM_ADRESSABLE_H */
Inline implementation for the abstract base class for all multi dimensionnal containers.
virtual void setFirstNotification(const Instantiation &i)=0
Listen to setFirst in a given Instantiation.
virtual void setChangeNotification(const Instantiation &i)=0
Listen to an assignment of a value in a Instantiation.
virtual bool registerSlave(Instantiation &i)=0
Register i as a slave of this MultiDimAdressable.
Interface for all classes addressing in a multiDim fashion.
Base class for discrete random variable.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual void setIncNotification(const Instantiation &i)=0
Listen to increment in a given Instantiation.
virtual bool unregisterSlave(Instantiation &i)=0
Unregister i as a slave of this MultiDimAdressable.
Header files of gum::Instantiation.
~MultiDimAdressable() override
Destructor.
MultiDimAdressable & operator=(const MultiDimAdressable &from)
Default constructor.
virtual void setLastNotification(const Instantiation &i)=0
Listen to setLast in a given Instantiation.
Abstract base class for all multi dimensionnal addressable.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:80
virtual const std::string toString(const Instantiation *i) const =0
Return a string representation of internal data about i in this.
MultiDimAdressable()
Default constructor.
Size Idx
Type for indexes.
Definition: types.h:50
virtual void setDecNotification(const Instantiation &i)=0
Listen to increment in each recorded Instantiation.
virtual void changeNotification(const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval)=0
Listen to changes in a given Instantiation.
virtual MultiDimAdressable & getMasterRef()=0
In order to insure the dereference for decorators, we need to virtualize the access to master pointer...